GET
/api/v1/affiliates/{id}/statsReturns one affiliate's results in your program for a period, with the preceding period for comparison. This is the endpoint behind an affiliate dashboard in your own product. id is the affiliate's partnership id, as returned by List Affiliates.
Query parameters
| Parameter | Type | Description |
|---|---|---|
period | string | Time period: 7d, 30d, 90d, or 12m. Defaults to 30d. |
Example request
bash
curl "https://anderro.com/api/v1/affiliates/part_abc123/stats?period=30d" \
-H "x-api-key: sk_acct_your_key" \
-H "X-Anderro-Product: your_product_id"
Responses
200The affiliate's stats for the period
json
{
"data": {
"id": "part_abc123",
"referral_code": "jane-smith",
"period": "30d",
"clicks": 142,
"signups": 19,
"conversions": 8,
"revenue_cents": 196000,
"commissions_cents": 39200,
"conversion_rate": 5.63,
"previous_period": {
"clicks": 120,
"signups": 11,
"conversions": 5,
"revenue_cents": 122500,
"commissions_cents": 24500
}
}
}
404No such affiliate in this product
json
{ "error": "Affiliate not found" }
What the numbers mean
conversions and revenue_cents are the paid sales this affiliate referred, net of refunds. commissions_cents is what they earned on them (rejected commissions excluded), including 2nd-tier commissions. Test-mode activity is not counted.