Affiliate
Referral codes, invite links, invited users, and affiliate revenue views.
Referral rules
Confirmed current backend rules:
- invite codes are generated server-side
fee_percentageis capped at10- self-referral is not supported through the creator-tagging system and affiliate linkage is validated server-side
master_idandinvite_codeare 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
| Parameter | Type | Required | Notes |
|---|---|---|---|
fee_percentage | number | No | If 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
datais 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
| Parameter | Type | Required |
|---|---|---|
fee_percentage | number | No |
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
| Field | Type |
|---|---|
id | integer |
email | string |
fee_percentage | number |
GET /api/affiliate/revenue
Alias endpoint for affiliate revenue and affiliate transaction history.
- Auth required: Yes
- Roles: Authenticated creator
Query parameters
| Parameter | Type | Required |
|---|---|---|
page | integer | No |
limit | integer | No |
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
- creator calls
GET /api/affiliate/invitationorGET /api/affiliate/invitation/code - new user opens the invite link or enters the invite code
- registration sends either:
invite_code, ormaster_idplus optionalfee_percentage
- backend resolves the affiliate relationship during
POST /api/register - affiliate revenue later appears in:
GET /api/walletGET /api/wallet/affiliateGET /api/affiliate/revenue