Retrieve aggregated payment statistics across all projects owned by the authenticated developer. Includes subscription counts, payment totals, and revenue metrics.
Authentication
This endpoint requires developer authentication via OAuth2 Bearer Token.
Query Parameters
Include test mode data in statistics. Set to false for live mode only.
Response
Total number of projects owned by the developer
Number of projects with Stripe configuration
Number of projects with test mode credentials
Number of projects with live mode credentials
Total number of subscriptions across all projects
Number of currently active subscriptions
Total number of payment transactions
Number of successful payments
Currency for revenue (lowercase ISO code)
Example Request
curl "https://api.devkit4ai.com/api/v1/payments/stats?test_mode=true" \
-H "Authorization: Bearer {developer_jwt}"
Example Response
{
"total_projects" : 3 ,
"projects_with_config" : 2 ,
"projects_with_test" : 2 ,
"projects_with_live" : 1 ,
"total_subscriptions" : 45 ,
"active_subscriptions" : 38 ,
"total_payments" : 127 ,
"successful_payments" : 120 ,
"total_revenue_cents" : 359700 ,
"currency" : "usd"
}
To display revenue as currency:
const revenue = stats . total_revenue_cents / 100 ;
const formatted = new Intl . NumberFormat ( 'en-US' , {
style: 'currency' ,
currency: stats . currency . toUpperCase ()
}). format ( revenue );
// $3,597.00
Dashboard Metrics
Use these statistics to build a developer dashboard:
(((REPLACE_THIS_WITH_IMAGE: cloud-admin-payment-stats-dashboard.png: Developer dashboard showing payment statistics with subscription counts, revenue chart, and project configuration status)))
Key Metrics Explained
Metric Description active_subscriptionsSubscriptions with status active or trialing successful_paymentsPayments with status succeeded total_revenue_centsSum of all successful payment amounts
When test_mode=true, statistics include both test and live data. Set test_mode=false to see only production metrics.
Related Pages
List Subscriptions View all subscriptions
List Transactions View payment transactions
Console Statistics Cloud Admin statistics view
The access token received from the authorization server in the OAuth 2.0 flow.
Aggregated payment statistics.