Compare coupon redemptions and the revenue collected after discounts. Use this report for your Telegram subscription bot or Discord subscription bot project.
GET /v2/projects/ {project_id} /analytics/coupons CopyTry it Authorization Bearer API Key Required
API key scope: analytics:charts:read for restricted keys. Unrestricted project keys also support this endpoint.
Add coupons:read to include coupon codes. Without it, codes are omitted.
Query Parameters First UTC calendar day, YYYY-MM-DD; default to minus 29 days.
Last UTC calendar day inclusive, YYYY-MM-DD; default today.
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 .
A redemption is a completed payment carrying the coupon, including balance top-ups. The chart reports paid revenue, not the discount value. Deleted coupons lose their historical link and drop out. Without coupons:read, code is omitted and coupon_codes_included is false. Rows sort by redemptions descending, then coupon ID. More than 100 qualifying coupons returns 413.
curl "https://api.botsubscription.com/v2/projects/11111111-1111-4111-8111-111111111111/analytics/coupons?from=2026-10-01&to=2026-10-10" \
-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/coupons" ,
"code" : 200 ,
"data" : {
"period" : {
"from" : "2026-10-01" ,
"to" : "2026-10-10" ,
"interval" : null ,
"timezone" : "UTC" ,
"generated_at" : "2026-10-15T12:00:00.000Z"
},
"coupons" : [
{
"coupon_id" : "22222222-2222-4222-8222-222222222222" ,
"code" : "ZETA" ,
"redemptions" : 4 ,
"revenue" : {
"gbp" : "4"
}
},
{
"coupon_id" : "33333333-3333-4333-8333-333333333333" ,
"code" : "XMAS" ,
"redemptions" : 3 ,
"revenue" : {
"eur" : "5" ,
"usd" : "0.3"
}
},
{
"coupon_id" : "44444444-4444-4444-8444-444444444444" ,
"code" : "YEAR" ,
"redemptions" : 3 ,
"revenue" : {
"usd" : "30"
}
}
],
"totals" : {
"coupons" : 3 ,
"redemptions" : 10 ,
"revenue" : {
"eur" : "5" ,
"gbp" : "4" ,
"usd" : "30.3"
}
},
"disclosures" : {
"cache_ttl_seconds" : 120 ,
"timezone" : "UTC" ,
"coupon_codes_included" : true ,
"singleton_groups_possible" : true ,
"currency_conversion_applied" : false ,
"revenue_anchor" : "settled_at_or_created_at" ,
"max_coupons" : 100
}
}
} 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/coupons" ,
"code" : 200 ,
"data" : {
"period" : {
"from" : "2026-10-01" ,
"to" : "2026-10-10" ,
"interval" : null ,
"timezone" : "UTC" ,
"generated_at" : "2026-10-15T12:00:00.000Z"
},
"coupons" : [
{
"coupon_id" : "22222222-2222-4222-8222-222222222222" ,
"redemptions" : 4 ,
"revenue" : {
"gbp" : "4"
}
},
{
"coupon_id" : "33333333-3333-4333-8333-333333333333" ,
"redemptions" : 3 ,
"revenue" : {
"eur" : "5" ,
"usd" : "0.3"
}
},
{
"coupon_id" : "44444444-4444-4444-8444-444444444444" ,
"redemptions" : 3 ,
"revenue" : {
"usd" : "30"
}
}
],
"totals" : {
"coupons" : 3 ,
"redemptions" : 10 ,
"revenue" : {
"eur" : "5" ,
"gbp" : "4" ,
"usd" : "30.3"
}
},
"disclosures" : {
"cache_ttl_seconds" : 120 ,
"timezone" : "UTC" ,
"coupon_codes_included" : false ,
"singleton_groups_possible" : true ,
"currency_conversion_applied" : false ,
"revenue_anchor" : "settled_at_or_created_at" ,
"max_coupons" : 100
}
}
} UNAUTHORIZED application/json
{
"ok" : false ,
"request_id" : "44444444-4444-4444-8444-444444444444" ,
"method" : "GET" ,
"path" : "/v2/projects/11111111-1111-4111-8111-111111111111/analytics/coupons" ,
"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/coupons" ,
"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/coupons" ,
"code" : 422 ,
"error" : {
"error_code" : "VALIDATION_ERROR" ,
"message" : "Invalid request parameters."
}
} EXPORT_LIMIT_EXCEEDED application/json
{
"ok" : false ,
"request_id" : "44444444-4444-4444-8444-444444444444" ,
"method" : "GET" ,
"path" : "/v2/projects/11111111-1111-4111-8111-111111111111/analytics/coupons" ,
"code" : 413 ,
"error" : {
"error_code" : "EXPORT_LIMIT_EXCEEDED" ,
"message" : "The requested window exceeds the report limit."
}
} 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/coupons" ,
"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/coupons" ,
"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.