get
https://example.com
GET /v2/ecommerceReports/coupons/{couponId}/analytics — Per-coupon KPIs and usage limit
Recent Requests
Log in to see full request history
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Loading…
Returns date-filtered KPIs and lifetime usage limit for the Coupon analytics modal. Redeemer segments and retention are on GET .../analytics/redeemers. Product rows are on GET .../analytics/products. All-coupon report: GET .../used-on-orders.
Full metric definitions: Coupon analytics metrics and definitions.
Path
| Parameter | Type | Description |
|---|---|---|
couponId | string | Ecommerce coupon id |
Query
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
dateRange | string | No | last_7_days | last_7_days, last_thirty_days, last_90_days, last_180_days, or custom |
startDate | string (YYYY-MM-DD) | When dateRange=custom | — | Inclusive lower bound (UTC) |
endDate | string (YYYY-MM-DD) | When dateRange=custom | — | Inclusive upper bound (end-of-day UTC) |
Invalid preset, missing custom dates, bad date format, or reversed custom range → 422 (key: INVALID_FIELD).
Auth and errors
| Status | When |
|---|---|
| 400 | Affiliate context is required |
| 401 | Missing or invalid bearer token |
| 403 | Role or couponAnalytics view access denied (AFFILIATE_SUPER_ADMIN or AFFILIATE_ADMIN only — not AFFILIATE_AGENT) |
| 404 | Unknown couponId or coupon owned by another affiliate |
| 409 | Conflicting record exists |
Response (200)
200){
"success": true,
"data": {
"coupon": {
"id": "ecpn::example",
"code": "SAVE20",
"description": "20% off first order",
"discountType": "percent",
"discountMode": "one-time",
"amount": 20
},
"range": {
"startDate": "2026-09-17T00:00:00.000Z",
"endDate": "2026-09-24T23:59:59.999Z",
"preset": "last_7_days"
},
"kpis": {
"uses": 52,
"revenueCollected": 12500.5,
"discountCost": 2100.25,
"spendingPerNewUser": 52.51
},
"usageLimit": {
"unlimited": false,
"used": 120,
"cap": 500,
"remaining": 380,
"percentConsumed": 24
}
}
}| Field | Notes |
|---|---|
kpis.spendingPerNewUser | Average discount cost per new affiliate customer in range — not revenue per customer |
usageLimit.used | Lifetime APPLIED count; not scoped to dateRange or order qualify (may differ from kpis.uses) |
OpenAPI schema: CouponAnalyticsSuccessEnvelope → CouponAnalyticsResponse.
