API Reference
Referrals
Referral program - generate codes, track referrals, earn rewards, and manage payouts
Get Referral Code
Authorization
HTTPBearer AuthorizationBearer <token>
In: header
Response Body
application/json
curl -X GET "https://loading/api/v1/referrals/code"{
"code": "string",
"is_active": true,
"expires_at": "2019-08-24T14:15:22Z",
"max_uses": 1,
"metadata": {},
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",
"current_uses": 0,
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}Create Referral Code
Authorization
HTTPBearer AuthorizationBearer <token>
In: header
Request Body
application/json
code?|
Custom referral code (auto-generated if not provided)
expires_at?|
Code expiration date
max_uses?|
Maximum number of uses
metadata?
Additional metadata
Response Body
application/json
application/json
curl -X POST "https://loading/api/v1/referrals/code" \ -H "Content-Type: application/json" \ -d '{}'{
"code": "string",
"is_active": true,
"expires_at": "2019-08-24T14:15:22Z",
"max_uses": 1,
"metadata": {},
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",
"current_uses": 0,
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}Track Referral
Authorization
HTTPBearer AuthorizationBearer <token>
In: header
Request Body
application/json
referral_code*string
Referral code to use
Length
1 <= length <= 20Response Body
application/json
application/json
curl -X POST "https://loading/api/v1/referrals/track" \ -H "Content-Type: application/json" \ -d '{ "referral_code": "string" }'{
"referral_code": "string",
"status": "pending",
"verification_metadata": {},
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"referrer_id": "4751ff8a-bd55-443e-9163-37cba794193e",
"referred_id": "4e8ef7e7-026b-4de9-835c-804fee004463",
"referral_code_id": "f6c3fcad-829d-4cd3-993f-fe09dc7e1db7",
"verified_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}Get Referral Link
Authorization
HTTPBearer AuthorizationBearer <token>
In: header
Response Body
application/json
curl -X GET "https://loading/api/v1/referrals/link"{
"code": "string",
"referral_url": "string",
"shareable_text": "string"
}Get Referral Stats
Authorization
HTTPBearer AuthorizationBearer <token>
In: header
Response Body
application/json
curl -X GET "https://loading/api/v1/referrals/stats"{
"total_referrals": 0,
"verified_referrals": 0,
"pending_referrals": 0,
"total_earnings": "0",
"pending_earnings": "0",
"paid_earnings": "0",
"total_payouts": 0,
"last_payout_date": "2019-08-24T14:15:22Z",
"current_tier_name": "string",
"commission_rate": "string"
}Get User Tier
Authorization
HTTPBearer AuthorizationBearer <token>
In: header
Response Body
application/json
curl -X GET "https://loading/api/v1/referrals/tier"{
"tier_id": "b1cd8bf0-c8eb-4fce-9cae-ebe5317fe7f6",
"current_tier": "string",
"tier_level": 0,
"commission_rate": "string",
"min_referrals": 0,
"max_referrals": 0,
"current_referral_count": 0,
"next_tier": "string",
"next_tier_level": 0,
"next_tier_min_referrals": 0,
"progress_to_next_tier": 0
}Get Referral History
Authorization
HTTPBearer AuthorizationBearer <token>
In: header
Query Parameters
limit?integer
Maximum referrals to return
Default
50Range
1 <= value <= 200offset?integer
Offset for pagination
Default
0Range
0 <= valueResponse Body
application/json
application/json
curl -X GET "https://loading/api/v1/referrals/history"[
{
"referral_code": "string",
"status": "pending",
"verification_metadata": {},
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"referrer_id": "4751ff8a-bd55-443e-9163-37cba794193e",
"referred_id": "4e8ef7e7-026b-4de9-835c-804fee004463",
"referral_code_id": "f6c3fcad-829d-4cd3-993f-fe09dc7e1db7",
"verified_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}
]{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}Get Referral Rewards
Authorization
HTTPBearer AuthorizationBearer <token>
In: header
Query Parameters
limit?integer
Maximum rewards to return
Default
50Range
1 <= value <= 200offset?integer
Offset for pagination
Default
0Range
0 <= valueResponse Body
application/json
application/json
curl -X GET "https://loading/api/v1/referrals/rewards"[
{
"reward_type": "signup_bonus",
"amount": "string",
"currency": "USD",
"status": "pending",
"metadata": {},
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"referral_id": "2d946960-d63d-4137-b67f-4dc8d4a3067c",
"referrer_id": "4751ff8a-bd55-443e-9163-37cba794193e",
"referred_id": "4e8ef7e7-026b-4de9-835c-804fee004463",
"tier_id": "b1cd8bf0-c8eb-4fce-9cae-ebe5317fe7f6",
"tier_name": "string",
"commission_rate": "string",
"paid_at": "2019-08-24T14:15:22Z",
"payout_id": "89e4daf5-d103-4869-b9da-3d54ecc98dfe",
"transaction_reference": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}
]{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}Get Payout History
Authorization
HTTPBearer AuthorizationBearer <token>
In: header
Query Parameters
limit?integer
Maximum payouts to return
Default
50Range
1 <= value <= 200offset?integer
Offset for pagination
Default
0Range
0 <= valueResponse Body
application/json
application/json
curl -X GET "https://loading/api/v1/referrals/payouts"[
{
"payout_schedule": "weekly",
"amount": "string",
"currency": "USD",
"payment_method": "string",
"payment_details": {},
"metadata": {},
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",
"status": "pending",
"transaction_id": "string",
"transaction_hash": "string",
"processed_at": "2019-08-24T14:15:22Z",
"failed_reason": "string",
"retry_count": 0,
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}
]{
"detail": [
{
"loc": [
"string"
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}Request Payout
Authorization
HTTPBearer AuthorizationBearer <token>
In: header
Response Body
application/json
curl -X POST "https://loading/api/v1/referrals/payouts/request"{}