Referrals API
The referral program lets affiliates earn recurring commissions by inviting new users to Affilync. Referred affiliates generate 20% commission for 12 months.
Get Program Info
curl https://api.affilync.com/api/affiliate/referrals \
-H "Authorization: Bearer YOUR_TOKEN"
Response (200):
{
"referral_code": "REF_A1B2C3",
"referral_link": "https://app.affilync.com/signup?ref=REF_A1B2C3",
"commission_rate": 20.0,
"bonus_tiers": [
{ "tier_name": "Bronze", "required_referrals": 1, "commission_rate": 20.0, "benefits": ["Basic support"] },
{ "tier_name": "Silver", "required_referrals": 5, "commission_rate": 22.0, "benefits": ["Priority support", "Custom landing pages"] },
{ "tier_name": "Gold", "required_referrals": 15, "commission_rate": 25.0, "benefits": ["Dedicated manager", "Advanced analytics"] },
{ "tier_name": "Platinum", "required_referrals": 30, "commission_rate": 30.0, "benefits": ["VIP support", "Custom integrations", "API access"] }
],
"terms_and_conditions": "Earn 20% commission on all subscription payments from users you refer for the first 12 months."
}
Get Referral Stats
curl https://api.affilync.com/api/affiliate/referrals/stats \
-H "Authorization: Bearer YOUR_TOKEN"
Response (200):
{
"total_referrals": 24,
"active_referrals": 18,
"pending_referrals": 6,
"total_earnings": 2487.50,
"lifetime_earnings": 2487.50,
"conversion_rate": 75.0,
"average_earning_per_referral": 103.64
}
List Referrals
curl "https://api.affilync.com/api/affiliate/referrals/list?status=active&page=1&per_page=20" \
-H "Authorization: Bearer YOUR_TOKEN"
Query Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
status | string | — | Filter: active, pending, inactive |
page | int | 1 | Page number |
per_page | int | 10 | Results per page (max 100) |
Response (200):
[
{
"id": "ref_abc123",
"referral_code": "REF_A1B2C3",
"referred_email": "[email protected]",
"referred_name": "Jane D.",
"status": "active",
"signup_date": "2026-02-15T10:30:00Z",
"earnings_generated": 900.00,
"commission_earned": 180.00,
"created_at": "2026-02-15T10:30:00Z"
}
]
Send Referral Invitation
curl -X POST https://api.affilync.com/api/affiliate/referrals/invite \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"name": "John",
"message": "Join Affilync and start earning!"
}'
Rate Limit: 10 invitations per user per day.
Response (200):
{
"data": {
"invitation_id": "inv_xyz789",
"email": "[email protected]",
"referral_link": "https://app.affilync.com/signup?ref=REF_A1B2C3",
"message": "Invitation sent successfully"
}
}
Error Responses:
429- Rate limit exceeded (max 10 invitations/day)400- Invalid email or request format
Leaderboard
curl "https://api.affilync.com/api/affiliate/referrals/leaderboard?period=month&limit=10" \
-H "Authorization: Bearer YOUR_TOKEN"
Query Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
period | string | month | week, month, year, all-time |
limit | int | 10 | Max results (1-100) |
Response (200):
[
{
"rank": 1,
"affiliate_name": "Sar***",
"total_referrals": 47,
"active_referrals": 42,
"earnings_generated": 25000.00,
"commission_earned": 5000.00,
"is_current_user": false
}
]
Public Referral Link
Share https://app.affilync.com/ref/{YOUR_CODE} — this sets a 60-day cookie and redirects to signup. No authentication required.
Bonus Progress
curl https://api.affilync.com/api/affiliate/referrals/bonus-progress \
-H "Authorization: Bearer YOUR_TOKEN"
Response (200):
{
"data": {
"current_referrals": 18,
"next_bonus": { "tier_name": "Gold", "required_referrals": 25, "commission_rate": 25.0 },
"bonus_tiers": [
{ "tier_name": "Bronze", "required_referrals": 1, "reached": true },
{ "tier_name": "Silver", "required_referrals": 5, "reached": true },
{ "tier_name": "Gold", "required_referrals": 25, "reached": false },
{ "tier_name": "Platinum", "required_referrals": 30, "reached": false }
],
"total_bonuses_earned": 0
}
}