Skip to content

Affiliate

Referral codes, invite links, invited users, and affiliate revenue views.


Referral rules

Confirmed current backend rules:

  • invite codes are generated server-side
  • fee_percentage is capped at 10
  • self-referral is not supported through the creator-tagging system and affiliate linkage is validated server-side
  • master_id and invite_code are mutually exclusive during registration
  • affiliate currency mismatches can cause registration failure and cleanup

GET /api/affiliate/invitation

Return a shareable affiliate invitation link.

  • Auth required: Yes
  • Roles: Authenticated creator

Query parameters

ParameterTypeRequiredNotes
fee_percentagenumberNoIf omitted, backend uses the default master fee from DB.

Success response example

json
{
  "success": true,
  "errors_message": null,
  "data": "https://fangate.info/applink/uuid-value"
}

Important notes

  • response data is a string URL, not an object
  • backend reuses an existing matching invitation app link when possible

GET /api/affiliate/invitation/code

Return the invitation code associated with the creator's affiliate invite setup.

  • Auth required: Yes
  • Roles: Authenticated creator

Query parameters

ParameterTypeRequired
fee_percentagenumberNo

Success response example

json
{
  "success": true,
  "errors_message": null,
  "data": {
    "code": "1234s"
  }
}

Important note

Current live backend returns data.code. Older documentation that used invite_code in the response body is stale.


GET /api/affiliate/invited

Return creators invited by the authenticated creator.

  • Auth required: Yes
  • Roles: Authenticated creator

Success response example

json
{
  "success": true,
  "errors_message": null,
  "data": [
    {
      "id": 91,
      "email": "invited@example.com",
      "fee_percentage": 4
    }
  ]
}

Returned fields

FieldType
idinteger
emailstring
fee_percentagenumber

GET /api/affiliate/revenue

Alias endpoint for affiliate revenue and affiliate transaction history.

  • Auth required: Yes
  • Roles: Authenticated creator

Query parameters

ParameterTypeRequired
pageintegerNo
limitintegerNo

Success response example

json
{
  "success": true,
  "errors_message": null,
  "data": {
    "referral_revenue": 2500,
    "transactions": {
      "data": [
        {
          "id": 33,
          "amount": 220,
          "type": "affiliate_earning",
          "created_at": "2026-04-20 10:15:00",
          "title": "Referral revenue"
        }
      ]
    }
  }
}

Important note

This endpoint overlaps with GET /api/wallet/affiliate. Treat both as affiliate revenue views over the same wallet domain.


Example flow: using an affiliate invite

  1. creator calls GET /api/affiliate/invitation or GET /api/affiliate/invitation/code
  2. new user opens the invite link or enters the invite code
  3. registration sends either:
    • invite_code, or
    • master_id plus optional fee_percentage
  4. backend resolves the affiliate relationship during POST /api/register
  5. affiliate revenue later appears in:
    • GET /api/wallet
    • GET /api/wallet/affiliate
    • GET /api/affiliate/revenue

Fangate backend developer documentation