get analytics

GET /v2/ecommerceReports/coupons/{couponId}/analytics — Per-coupon KPIs and usage limit

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

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

ParameterTypeDescription
couponIdstringEcommerce coupon id

Query

ParameterTypeRequiredDefaultDescription
dateRangestringNolast_7_dayslast_7_days, last_thirty_days, last_90_days, last_180_days, or custom
startDatestring (YYYY-MM-DD)When dateRange=custom—Inclusive lower bound (UTC)
endDatestring (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

StatusWhen
400Affiliate context is required
401Missing or invalid bearer token
403Role or couponAnalytics view access denied (AFFILIATE_SUPER_ADMIN or AFFILIATE_ADMIN only — not AFFILIATE_AGENT)
404Unknown couponId or coupon owned by another affiliate
409Conflicting record exists

Response (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
    }
  }
}
FieldNotes
kpis.spendingPerNewUserAverage discount cost per new affiliate customer in range — not revenue per customer
usageLimit.usedLifetime APPLIED count; not scoped to dateRange or order qualify (may differ from kpis.uses)

OpenAPI schema: CouponAnalyticsSuccessEnvelope → CouponAnalyticsResponse.

Language
LoadingLoading…
Response
Click Try It! to start a request and see the response here!