Skip to content

Affiliate

Affiliate and referral endpoints. Each user has a unique 5-digit referral code. Invited users and their activity are tracked, with configurable commission percentages.


GET /api/affiliate/invitation

Returns the user's referral invitation URL.

Authentication: Required

Example Request

bash
curl -H "Authorization: Bearer YOUR_TOKEN" \
  https://fangate.info/api/affiliate/invitation

Response (200)

json
{
  "success": true,
  "errors_message": null,
  "data": {
    "url": "https://fangate.info/invite/abc12",
    "code": "abc12"
  }
}

Get invitation code

GET /api/affiliate/invitation/code

Returns the user's 5-digit referral code only.

Authentication: Required

Response (200)

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

Get invited users

GET /api/affiliate/invited

Returns list of users invited by the authenticated user (referrals).

Authentication: Required

Example Request

bash
curl -H "Authorization: Bearer YOUR_TOKEN" \
  https://fangate.info/api/affiliate/invited

Response (200)

json
{
  "success": true,
  "errors_message": null,
  "data": [
    {
      "id": 2,
      "email": "invited@example.com",
      "created_at": "2026-01-10T12:00:00Z",
      "revenue_generated": 1500
    }
  ]
}

Get affiliate revenue

GET /api/affiliate/revenue

Returns total affiliate earnings and breakdown.

Authentication: Required

Example Request

bash
curl -H "Authorization: Bearer YOUR_TOKEN" \
  https://fangate.info/api/affiliate/revenue

Response (200)

json
{
  "success": true,
  "errors_message": null,
  "data": {
    "total_revenue": 2500,
    "transactions": [ ... ]
  }
}

Referral mechanics

  • Each user has a unique 5-digit referral code (also shareable via URL)
  • Commission percentage is configurable per user (e.g. via master_id and fee_percentage at registration)
  • Tracking: Invited users and their sales are tracked
  • Earnings from referred sales appear in wallet as affiliate_earning
  • Use invite_code during registration to link a new user to a referrer

Fangate API Documentation