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
| Param | Values | Default | Notes |
|---|---|---|---|
| metric | see below | required | Unknown values are rejected with 400 Invalid or unsupported metric requested. |
| mode | range (default) or single | range | single = one day, bucketed by hour. range = a date window. |
| day | YYYY-MM-DD | today | mode=single only. The window is that full day (00:00–23:59:59) in timezone. |
| start, end | YYYY-MM-DD | today | mode=range only. The window runs from 00:00 on start to 23:59:59 on end, in timezone. |
| granularity | hour, day, week, month | hour for single, day for range | Bucket 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. |
| timezone | IANA name | UTC | Buckets and day boundaries resolve in this timezone (e.g. Europe/Paris). |
Metrics
| Metric | Chart type | Meaning |
|---|---|---|
clicks | number | Unique clicks on the affiliate's referral link — the same IP + browser within 24 hours counts once. |
conversions | number | Recorded conversion events for the affiliate (+1 each). |
referred_sales | money | Gross product value (products minus discount, excluding shipping and tax) of the affiliate's attributed sales, per event. |
total_earnings | money | Commission the affiliate earned per attributed sale (what they get paid). |
total_commissions | money | Recorded alongside total_earnings with the same values — the merchant's name for the same number. |
mrr | money | Monthly-normalized recurring revenue the affiliate's subscriptions added (a $120/yr plan adds $10). |
arr | money | Same 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 withallthey 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)
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)
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
| Field | Always present? | Meaning |
|---|---|---|
amount | yes | The 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. |
series | yes | One 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. |
type | yes | money for referred_sales, total_earnings, total_commissions, mrr, arr; number for clicks, conversions. Tells you which of the two shapes above you got. |
currency | yes | The program's primary currency (the connected store's currency), lowercase; falls back to usd when no store is connected. |
amounts | money metrics only | One { currency, amount } entry per currency present in the window — the per-currency window totals. [] for number metrics. |
currencies | money metrics only | The currency codes in amounts, same order. [] for number metrics. |
currencySeries | money metrics only | The 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>" }:
| Status | error values |
|---|---|
| 400 | Invalid parameters: <detail> (bad/missing dates, mode/granularity mismatches) · Invalid or unsupported metric requested: <metric> |
| 403 | The affiliate must accept the current affiliate legal terms. |
| 404 | Affiliate not found · Program not found |
