Get affiliate analytics

Get affiliate analytics

Returns a time series for one metric, scoped to a single affiliate. Use all as the affiliate ID to aggregate every affiliate in the program (plus program-level points).

Query parameters

ParamValuesDefaultNotes
metricsee belowrequiredUnknown values are rejected with 400 Invalid or unsupported metric requested.
moderange (default) or singlerangesingle = one day, bucketed by hour. range = a date window.
dayYYYY-MM-DDtodaymode=single only. The window is that full day (00:00–23:59:59) in timezone.
start, endYYYY-MM-DDtodaymode=range only. The window runs from 00:00 on start to 23:59:59 on end, in timezone.
granularityhour, day, week, monthhour for single, day for rangeBucket size. single only supports hour; range supports day/week/month. Ranges longer than 7 days demote hour to day; longer than 90 days demote day to week.
timezoneIANA nameUTCBuckets and day boundaries resolve in this timezone (e.g. Europe/Paris).

Metrics

MetricChart typeMeaning
clicksnumberUnique clicks on the affiliate's referral link — the same IP + browser within 24 hours counts once.
conversionsnumberRecorded conversion events for the affiliate (+1 each).
referred_salesmoneyGross product value (products minus discount, excluding shipping and tax) of the affiliate's attributed sales, per event.
total_earningsmoneyCommission the affiliate earned per attributed sale (what they get paid).
total_commissionsmoneyRecorded alongside total_earnings with the same values — the merchant's name for the same number.
mrrmoneyMonthly-normalized recurring revenue the affiliate's subscriptions added (a $120/yr plan adds $10).
arrmoneySame movement annualized (MRR × 12).

Money metrics are in the currency's smallest unit (14950 = $149.50). Values are recorded per currency, so multi-currency programs split them.

Metrics without an affiliate dimension — gross_revenue, net_revenue, page_visits, total_affiliates, event_successful, event_failed — are recorded at program level only. Requested for a specific affiliate they return an empty series; requested with all they aggregate the whole program.

Plan gating

conversions requires the Scale plan; mrr and arr require Growth or Scale. On lower plans the endpoint still answers 200 with amount: 0, empty amounts/currencies, and a zero-filled series — clients render their locked-state chart from this.

Response — 200 OK

The payload depends on the metric's chart type, and which fields appear depends on it:

Money metrics (referred_sales, total_earnings, total_commissions, mrr, arr)

Example — metric=referred_sales&mode=range&start=2026-10-01&end=2026-10-02, an affiliate with one $50 sale on Oct 1 and one $99.50 sale on Oct 2, in a USD store:

{
  "amount": 14950,
  "amounts": [{ "currency": "usd", "amount": 14950 }],
  "series": [
    { "x": "2026-10-01T00:00:00.000Z", "y": 5000 },
    { "x": "2026-10-02T00:00:00.000Z", "y": 14950 }
  ],
  "currencySeries": [
    {
      "currency": "usd",
      "amount": 14950,
      "series": [
        { "x": "2026-10-01T00:00:00.000Z", "y": 5000 },
        { "x": "2026-10-02T00:00:00.000Z", "y": 14950 }
      ]
    }
  ],
  "type": "money",
  "currency": "usd",
  "currencies": ["usd"]
}

Reading it: the affiliate generated 14,950 smallest units ($149.50) in the window — $50.00 on Oct 1 and $99.50 on Oct 2. Every series/currencySeries[].series y is cumulative: Oct 1 shows that day's $50.00 (5,000), Oct 2 shows the running total (14,950). Buckets with no sales are still present with the previous running total carried forward (the raw value is zero-filled before cumulation).

Number metrics (clicks, conversions)

Example — metric=clicks over the same window, 3 clicks on Oct 1 and 2 on Oct 2:

{
  "amount": 5,
  "amounts": [],
  "series": [
    { "x": "2026-10-01T00:00:00.000Z", "y": 3 },
    { "x": "2026-10-02T00:00:00.000Z", "y": 5 }
  ],
  "type": "number",
  "currency": "usd",
  "currencies": []
}

Number metrics never carry amounts, currencies or currencySeries — no currency applies. amount is the plain count.

The gated shape (conversions on a sub-Scale plan, mrr/arr below Growth)

Still 200, but zeroed so clients can render their locked state:

{
  "amount": 0,
  "amounts": [],
  "series": [ { "x": "…", "y": 0 }, { "x": "…", "y": 0 } ],
  "type": "number",
  "currency": "usd",
  "currencies": []
}

series still covers the full requested window (zero-filled); type reflects the requested metric.

Field notes

FieldAlways present?Meaning
amountyesThe raw sum of the metric's values inside the window. Money metrics: smallest units, summed across currencies if the sales were multi-currency (use amounts for per-currency totals). Number metrics: the event count.
seriesyesOne bucket per granularity step covering the entire window (zero-filled, timezone-resolved). y is cumulative — each bucket adds its value to the running total, so the last bucket's y equals the window total (for money metrics: the primary-currency running total is what series shows; currencySeries carries the others). x is the bucket start as ISO 8601.
typeyesmoney for referred_sales, total_earnings, total_commissions, mrr, arr; number for clicks, conversions. Tells you which of the two shapes above you got.
currencyyesThe program's primary currency (the connected store's currency), lowercase; falls back to usd when no store is connected.
amountsmoney metrics onlyOne { currency, amount } entry per currency present in the window — the per-currency window totals. [] for number metrics.
currenciesmoney metrics onlyThe currency codes in amounts, same order. [] for number metrics.
currencySeriesmoney metrics onlyThe cumulative series per currency: { currency, amount, series }[], sorted with the program's primary currency first. This is where a multi-currency program's per-currency chart data lives — the top-level series only follows the primary currency. Omitted (field absent) for number metrics.

Errors — all { "error": "<message>" }:

Statuserror values
400Invalid parameters: <detail> (bad/missing dates, mode/granularity mismatches) · Invalid or unsupported metric requested: <metric>
403The affiliate must accept the current affiliate legal terms.
404Affiliate not found · Program not found