Reports

Run a report

Clicks, leads, customers, sales, refunds, revenue and commissions, cut by dimension over an inclusive range. Rows keyed direct are money that arrived without a partner; filtering by partner, group or tag reports that slice of the partner programme and excludes direct money. The window of the same length immediately before from rides along as previous_period with a basis-point delta, so a chart never needs two round trips; pass compare=none to skip it. drill_down_config says how a row's key becomes a filter.

Scope: read

get/v1/reports

Request

  • Base URL: https://api.affiliaterail.com
  • URL: https://api.affiliaterail.com/v1/reports
  • Auth: HTTP bearer

Query parameters

program_idstring required
Example:prg_7uSyy9FqVLCFWrdPeZaK
dimension'partner' | 'link' | 'product' | 'group' | 'tag' | 'period'
fromstring

ISO date, inclusive. Defaults to twelve months back.

tostring

ISO date, inclusive. Defaults to now.

partner_idstring
group_idstring
tag_idstring
granularity'day' | 'week' | 'month'

Bucket size for the period dimension

compare'previous_period' | 'none'

previous_period (the default) returns the preceding window and the delta in the same response

Response

The report

object'report' required
dimension'partner' | 'link' | 'product' | 'group' | 'tag' | 'period' required
currencystring required

ISO-4217

fromstring date-time required

ISO-8601, UTC

tostring date-time required

ISO-8601, UTC

Example response

{
  "currency": "USD",
  "from": "2026-08-21T10:15:30.000Z",
  "to": "2026-08-21T10:15:30.000Z",
  "rows": [
    {
      "revenue_minor": 2500,
      "commissions_minor": 2500
    }
  ],
  "totals": {
    "revenue_minor": 2500,
    "commissions_minor": 2500
  },
  "previous_period": {
    "from": "2026-08-21T10:15:30.000Z",
    "to": "2026-08-21T10:15:30.000Z",
    "rows": [
      {
        "revenue_minor": 2500,
        "commissions_minor": 2500
      }
    ],
    "totals": {
      "revenue_minor": 2500,
      "commissions_minor": 2500
    }
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.