Read the newest completed invoice sales in the requested window. Use this report for your Telegram subscription bot or Discord subscription bot project.
GET /v2/projects/ {project_id} /analytics/recent CopyTry it Authorization Bearer API Key Required
API key scope: analytics:charts:read for restricted keys. Unrestricted project keys also support this endpoint.
Query Parameters First UTC calendar day, YYYY-MM-DD; default to minus 29 days.
Last UTC calendar day inclusive, YYYY-MM-DD; default today.
Digits-only integer from 1 to 100; default 20.
Dates must be real calendar days between 2000-01-01 and 2099-12-31, with from no later than to and at most 366 days inclusive. Unknown query parameters are rejected. There is no request body. See the shared analytics date, money, and cache rules .
Results sort by paid_at descending; older payments without settlement use creation time. The list is capped rather than paginated. Restricted keys receive no user_id; unrestricted keys can receive identifiers. Plan names are not included. The provider is retained after merchant removal where recorded, otherwise unknown.
curl "https://api.botsubscription.com/v2/projects/11111111-1111-4111-8111-111111111111/analytics/recent?from=2026-10-01&to=2026-10-31" \
-H "Authorization: Bearer YOUR_API_KEY" Report with unrestricted project key application/json
{
"ok" : true ,
"request_id" : "44444444-4444-4444-8444-444444444444" ,
"method" : "GET" ,
"path" : "/v2/projects/11111111-1111-4111-8111-111111111111/analytics/recent" ,
"code" : 200 ,
"data" : {
"period" : {
"from" : "2026-10-01" ,
"to" : "2026-10-31" ,
"interval" : null ,
"timezone" : "UTC" ,
"generated_at" : "2026-11-01T12:00:00.000Z"
},
"items" : [
{
"paid_at" : "2026-10-30T18:04:11.250Z" ,
"amount" : "10.5" ,
"currency" : "USD" ,
"renewal" : true ,
"provider" : "stripe" ,
"plan_id" : "22222222-2222-4222-8222-222222222222" ,
"user_id" : "810000000000000001"
},
{
"paid_at" : "2026-10-29T09:00:00.000Z" ,
"amount" : "20" ,
"currency" : "EUR" ,
"renewal" : false ,
"provider" : "unknown" ,
"plan_id" : "33333333-3333-4333-8333-333333333333" ,
"user_id" : "810000000000000002"
}
],
"disclosures" : {
"cache_ttl_seconds" : 120 ,
"timezone" : "UTC" ,
"currency_conversion" : false ,
"timestamp_anchor" : "settled_at_or_created_at" ,
"source" : "completed_invoice_payment_requests" ,
"customer_identifiers_included" : true ,
"order" : "paid_at_desc" ,
"max_items" : 100 ,
"provider_source" : "merchant_account_or_removal_record"
}
}
} Restricted key with redacted fields application/json
{
"ok" : true ,
"request_id" : "44444444-4444-4444-8444-444444444444" ,
"method" : "GET" ,
"path" : "/v2/projects/11111111-1111-4111-8111-111111111111/analytics/recent" ,
"code" : 200 ,
"data" : {
"period" : {
"from" : "2026-10-01" ,
"to" : "2026-10-31" ,
"interval" : null ,
"timezone" : "UTC" ,
"generated_at" : "2026-11-01T12:00:00.000Z"
},
"items" : [
{
"paid_at" : "2026-10-30T18:04:11.250Z" ,
"amount" : "10.5" ,
"currency" : "USD" ,
"renewal" : true ,
"provider" : "stripe" ,
"plan_id" : "22222222-2222-4222-8222-222222222222"
},
{
"paid_at" : "2026-10-29T09:00:00.000Z" ,
"amount" : "20" ,
"currency" : "EUR" ,
"renewal" : false ,
"provider" : "unknown" ,
"plan_id" : "33333333-3333-4333-8333-333333333333"
}
],
"disclosures" : {
"cache_ttl_seconds" : 120 ,
"timezone" : "UTC" ,
"currency_conversion" : false ,
"timestamp_anchor" : "settled_at_or_created_at" ,
"source" : "completed_invoice_payment_requests" ,
"customer_identifiers_included" : false ,
"order" : "paid_at_desc" ,
"max_items" : 100 ,
"provider_source" : "merchant_account_or_removal_record"
}
}
} UNAUTHORIZED application/json
{
"ok" : false ,
"request_id" : "44444444-4444-4444-8444-444444444444" ,
"method" : "GET" ,
"path" : "/v2/projects/11111111-1111-4111-8111-111111111111/analytics/recent" ,
"code" : 401 ,
"error" : {
"error_code" : "UNAUTHORIZED" ,
"message" : "Invalid or expired authentication token."
}
} FORBIDDEN application/json
{
"ok" : false ,
"request_id" : "44444444-4444-4444-8444-444444444444" ,
"method" : "GET" ,
"path" : "/v2/projects/11111111-1111-4111-8111-111111111111/analytics/recent" ,
"code" : 403 ,
"error" : {
"error_code" : "FORBIDDEN" ,
"message" : "Access is not permitted."
}
} VALIDATION_ERROR application/json
{
"ok" : false ,
"request_id" : "44444444-4444-4444-8444-444444444444" ,
"method" : "GET" ,
"path" : "/v2/projects/11111111-1111-4111-8111-111111111111/analytics/recent" ,
"code" : 422 ,
"error" : {
"error_code" : "VALIDATION_ERROR" ,
"message" : "Invalid request parameters."
}
} TOO_MANY_REQUESTS application/json
{
"ok" : false ,
"request_id" : "44444444-4444-4444-8444-444444444444" ,
"method" : "GET" ,
"path" : "/v2/projects/11111111-1111-4111-8111-111111111111/analytics/recent" ,
"code" : 429 ,
"error" : {
"error_code" : "TOO_MANY_REQUESTS" ,
"message" : "Too many requests. Please try again later."
}
} Invalid calendar day application/json
{
"ok" : false ,
"request_id" : "44444444-4444-4444-8444-444444444444" ,
"method" : "GET" ,
"path" : "/v2/projects/11111111-1111-4111-8111-111111111111/analytics/recent" ,
"code" : 422 ,
"errors" : [
{
"message" : "query: from Not a valid calendar date." ,
"error_code" : "VALIDATION_ERROR"
}
]
} Use the project API authentication reference for API-key setup.