Get Payment Statistics
curl --request GET \
--url https://api.devkit4ai.com/api/v1/payments/stats \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.devkit4ai.com/api/v1/payments/stats"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.devkit4ai.com/api/v1/payments/stats', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.devkit4ai.com/api/v1/payments/stats",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.devkit4ai.com/api/v1/payments/stats"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.devkit4ai.com/api/v1/payments/stats")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devkit4ai.com/api/v1/payments/stats")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"total_projects": 123,
"projects_with_config": 123,
"projects_with_test": 123,
"projects_with_live": 123,
"total_subscriptions": 123,
"active_subscriptions": 123,
"total_payments": 123,
"successful_payments": 123,
"total_revenue_cents": 123,
"currency": "usd"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Payments
Get Payment Statistics
Get aggregated payment statistics across all developer’s projects
GET
/
api
/
v1
/
payments
/
stats
Get Payment Statistics
curl --request GET \
--url https://api.devkit4ai.com/api/v1/payments/stats \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.devkit4ai.com/api/v1/payments/stats"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.devkit4ai.com/api/v1/payments/stats', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.devkit4ai.com/api/v1/payments/stats",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.devkit4ai.com/api/v1/payments/stats"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.devkit4ai.com/api/v1/payments/stats")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.devkit4ai.com/api/v1/payments/stats")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"total_projects": 123,
"projects_with_config": 123,
"projects_with_test": 123,
"projects_with_live": 123,
"total_subscriptions": 123,
"active_subscriptions": 123,
"total_payments": 123,
"successful_payments": 123,
"total_revenue_cents": 123,
"currency": "usd"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}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
boolean
default:"true"
Include test mode data in statistics. Set to
false for live mode only.Response
integer
Total number of projects owned by the developer
integer
Number of projects with Stripe configuration
integer
Number of projects with test mode credentials
integer
Number of projects with live mode credentials
integer
Total number of subscriptions across all projects
integer
Number of currently active subscriptions
integer
Total number of payment transactions
integer
Number of successful payments
integer
Total revenue in cents
string
default:"usd"
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"
}
Formatting Revenue
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_subscriptions | Subscriptions with status active or trialing |
successful_payments | Payments with status succeeded |
total_revenue_cents | Sum 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
Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Query Parameters
Include test mode data
Response
Successful Response
Aggregated payment statistics.

