API/Affiliate Partners API

Affiliate Partners API

Create affiliate partners, change their status and pay their commissions.

Partners are the people who refer customers. This endpoint covers their lifecycle: invite, activate, pause and pay.

List partners

GET /api/v1/affiliates
ParameterTypeDescription
statusstringOptional invited, active or paused filter.
limitnumberRows to scan, 1-200 (default 100).
{
  "affiliates": [
    {
      "id": "n97...",
      "name": "Marie Dupont",
      "email": "[email protected]",
      "code": "marie-4f2",
      "status": "active",
      "stripeAccountStatus": "enabled",
      "payoutCurrency": "eur",
      "clicksCount": 812,
      "customersCount": 24,
      "revenueAmount": 482000,
      "commissionAmount": 96400,
      "paidAmount": 64000,
      "unpaidAmount": 32400
    }
  ],
  "sampleLimited": false
}

All amounts are in minor units (cents) of the partner's payout currency. The status filter is applied to the scanned window, so sampleLimited: true means more partners exist beyond it.

Get one partner

GET /api/v1/affiliates/:affiliateId

Returns the partner plus the program it belongs to.

Create a partner

POST /api/v1/affiliates
FieldTypeDescription
namestringRequired partner name.
emailstringRequired, must be unique in the organization.
codestringReferral code. Generated from the name when omitted.
targetUrlstringLanding URL for the referral link. Falls back to the program default.
curl -X POST -H "x-api-key: org_api_key" -H "Content-Type: application/json" \
  -d '{"name":"Marie Dupont","email":"[email protected]"}' \
  "https://growth.example.com/api/v1/affiliates"

The partner is created in the organization's default program with status invited, and the invitation email is sent. The response carries affiliateId, code and inviteToken.

Change status

PATCH /api/v1/affiliates/:affiliateId

Body: { "status": "active" | "paused" | "invited" }. A paused partner keeps its history but stops earning on new conversions.

Pay a partner

POST /api/v1/affiliates/:affiliateId/payout

Transfers every approved commission of that partner from the organization's connected Stripe balance to the partner's Stripe account, and returns payoutId, stripeTransferId, amount and currency.

curl -X POST -H "x-api-key: org_api_key" \
  "https://growth.example.com/api/v1/affiliates/n97.../payout"

Error responses:

StatusMeaning
400Missing fields, duplicate email or code, Stripe onboarding incomplete, or not enough available balance.
401Missing or invalid API key.
404Unknown partner, or a partner owned by another organization.

Notes

Email Surveys APIAffiliate Promo Codes API