Skip to content

Affiliate referrals


id: affiliatewp-affiliates-referrals owner: affiliatewp method: GET path: /wp-json/headlesswp/v1/affiliates/referrals title: Affiliate referrals usedBySite: true

GET /wp-json/headlesswp/v1/affiliates/referrals

Returns cursor-paginated referral rows for the current affiliate.

Auth + CSRF

  • Auth: cookie session required.
  • Proxy nonce required: yes.

Request schema

  • Query params:
    • limit (optional): integer 1..100, default 20.
    • cursor (optional): opaque base64url string returned by the API.

Response schema

{
  "data": {
    "referrals": [
      {
        "id": "number",
        "amountMinor": "number",
        "currency": "string",
        "status": "string",
        "createdAtUtc": "string"
      }
    ],
    "nextCursor": "string | null"
  }
}

Error codes

StatusCodeNotes
401NOT_AUTHENTICATEDLogin required.
403AFFILIATE_NOT_ACTIVEAffiliate exists but is not active.
403AFFILIATE_TERMS_REQUIREDTerms acceptance required before referrals access.
404AFFILIATE_NOT_FOUNDNo affiliate account for current user (or feature disabled upstream).
422VALIDATION_FAILEDInvalid limit/cursor or forbidden scope override parameters.
500CONFIG_INVALID_AFFILIATE_TERMS_VERSIONTerms config invalid while gating active.
500UPSTREAM_UNAVAILABLEDynamic passthrough fallback code from AffiliateReferralsService failures.