API/Affiliate Revenue API

Affiliate Revenue API

Read payments, commissions, payouts and program totals from the API.

The money side of the affiliate program: what came in, what partners earned, and what has been paid out. All amounts are in minor units (cents).

Payments

GET /api/v1/affiliate/payments
ParameterTypeDescription
affiliateIdstringOnly payments attributed to this partner.
cursorstringCursor from the previous page.
limitnumberRows per page, 1-200 (default 100).
{
  "payments": [
    {
      "id": "q44...",
      "customerKey": "cus_123",
      "customerEmail": "[email protected]",
      "amount": 4900,
      "refundedAmount": 0,
      "netAmount": 4900,
      "currency": "eur",
      "paymentType": "subscription",
      "source": "webhook",
      "affiliateId": "n97...",
      "affiliateName": "Marie Dupont",
      "occurredAt": 1785312000000
    }
  ],
  "cursor": "eyJ..."
}

One row per payment, dated by when the money actually moved, so subscription renewals appear on their own date. cursor is null on the last page.

Payments summary

GET /api/v1/affiliate/payments/summary

Rolling four-week totals computed server-side over the whole window:

{
  "summary": {
    "count": 128,
    "amount": 627300,
    "subscriptions": 96,
    "currency": "eur",
    "partial": false,
    "latestOccurredAt": 1785312000000,
    "latestCustomerEmail": "[email protected]",
    "windowDays": 28
  }
}

partial: true means the window was clipped at 1000 payments, so the figures are a floor.

Commissions

GET /api/v1/affiliate/commissions
ParameterTypeDescription
statusstringpending, approved, processing, paid or void.
affiliateIdstringOnly this partner's commissions.
limitnumberRows to return, 1-200 (default 100).

Approve a pending commission so it becomes payable:

POST /api/v1/affiliate/commissions/:commissionId/approve
curl -X POST -H "x-api-key: org_api_key" \
  "https://growth.example.com/api/v1/affiliate/commissions/c88.../approve"

The call is idempotent: a commission that is not pending is returned unchanged.

Payouts

GET /api/v1/affiliate/payouts

Lists transfers to partners (processing, paid or failed) with their Stripe transfer id and the number of commissions each one settled. Create a payout with POST /api/v1/affiliates/:affiliateId/payout.

Program stats

GET /api/v1/affiliate/stats
{
  "stats": {
    "affiliates": { "total": 12, "active": 9, "invited": 2, "paused": 1 },
    "clicks": 4820,
    "customers": 143,
    "revenueAmount": 1928000,
    "commissionAmount": 385600,
    "paidAmount": 240000,
    "pendingCommissions": { "count": 18, "amount": 62400 },
    "approvedCommissions": { "count": 7, "amount": 31200 },
    "payments": { "count": 128, "amount": 627300, "currency": "eur" },
    "sampleLimited": false
  }
}

Error responses:

StatusMeaning
400Invalid status filter.
401Missing or invalid API key.
404Unknown commission.

Notes

Affiliate Offers APIPartner Outreach (Quick Send) API