AffiliateTracker
Guide · Developers

Reading your data with the API

Affiliates, commissions, clicks and payouts as JSON, for your back office, a spreadsheet or an analytics tool. Read-only.

1. Create a key

From the dashboard, API section: give the key a name (for instance the system that will use it) and copy it right away, because you see it in full only once. You can have up to ten and revoke them one by one.

API keys can only read: they don't create affiliates, don't touch commissions, don't see full IBANs. They are not the shop's API key, which is for the module and shouldn't be given to other systems.

2. Make the first call

curl https://affiliatetracker.it/api/v1/data/affiliates?status=approved \
  -H "Authorization: Bearer atk_YOUR_KEY"
{
  "data": [
    {
      "id": "5b0c…",
      "type": "influencer",
      "status": "approved",
      "referral_code": "MARIO10",
      "email": "mario@example.com",
      "name": "Mario Rossi",
      "commission_pct": 10,
      "created_at": "2026-10-02T09:14:00Z",
      "payout": { "holder": "Mario Rossi", "iban_masked": "IT•• •••• 3456" },
      …
    }
  ],
  "pagination": { "limit": 50, "offset": 0, "has_more": false, "next_offset": null }
}

3. Pages and filters

Every list returns at most limit rows (50 by default, 200 at most). If has_more is true, call again with offset set to next_offset. Dates are written as 2026-11-01 or 2026-11-01T08:00:00Z; in from/to the to day is excluded.

4. The endpoints

GET /api/v1/data/affiliates
Affiliates, oldest first (sort=newest for the latest first). Filters: status (pending, approved, suspended, rejected), type (influencer, customer), email and referral_code (exact value, case insensitive).
GET /api/v1/data/affiliates/{id}
One affiliate with totals: orders, clicks, pending and confirmed commissions, already paid, due, COIN. The same figures as the affiliate page in the dashboard.
GET /api/v1/data/commissions
One row per attributed order, newest first: order_id is the order number in your shop, amount the commission in currency, coins the COIN of referring customers.affiliate holds the code, name and email of who brought it. Filters: status (pending, approved, cancelled), affiliate_id, from, to, updated_since. Order: sort=newest, oldest or recently_updated (latest change first).
GET /api/v1/data/clicks
Clicks, newest first. Bots and link previews are left out, as in the dashboard counts: add include_bots=true to get them. Filters: affiliate_id, from, to.
GET /api/v1/data/payouts
Payouts to affiliates recorded in the dashboard, newest first. Filters: affiliate_id, from, to (on the payment date).
GET /api/v1/data/me
Who the key belongs to: the account name and its shops. Add the X-AT-Key header with a shop API key and shop_key tells you whether it is valid and for which shop: handy to check it before sending orders.

5. Keeping a system in sync

A commission starts pending and becomes confirmed or cancelled days later. To keep a back office aligned don't re-read everything: call /commissions?updated_since=… with the latest updated_at you already have. In that case the list is ordered from the oldest change to the newest, so you can page through it and resume from the last row you saw.

6. Errors and limits

400
A parameter is not valid: error says which one (for instance invalid_status).
401
Key missing, mistyped or revoked.
402
Subscription suspended or expired.
404
The affiliate doesn't exist, or isn't yours.
429
More than 120 requests a minute with the same key: wait the number of seconds in Retry-After.
The field names described here are stable: if we add new ones, the existing ones don't change.
Would you rather we did it? Installation and migration are included.Write to support