curl -X GET "https://api.affonso.io/v1/referrals/ref_abc123" \
-H "Authorization: Bearer sk_live_your_api_key"
curl -X GET "https://api.affonso.io/v1/referrals/ref_abc123?expand=affiliate&include=stats" \
-H "Authorization: Bearer sk_live_your_api_key"
{
"success": true,
"data": {
"id": "ref_abc123",
"affiliate_id": "aff_456def",
"program_id": "prg_789ghi",
"email": "customer@example.com",
"customer_id": "cust_123",
"external_user_id": "user_42",
"subscription_id": null,
"status": "customer",
"name": "John Doe",
"metadata": {
"plan": "enterprise"
},
"created_at": "2024-01-20T15:30:00Z",
"converted_at": "2024-01-20T15:30:00Z"
}
}
{
"success": true,
"data": {
"id": "ref_abc123",
"affiliate_id": "aff_456def",
"program_id": "prg_789ghi",
"email": "customer@example.com",
"customer_id": "cust_123",
"external_user_id": "user_42",
"subscription_id": null,
"status": "customer",
"name": "John Doe",
"metadata": {
"plan": "enterprise"
},
"created_at": "2024-01-20T15:30:00Z",
"converted_at": "2024-01-20T15:30:00Z",
"affiliate": {
"id": "aff_456def",
"name": "John Doe",
"email": "john@example.com",
"tracking_id": "PARTNER123",
"source": "api",
"partnership_status": "APPROVED",
"onboarding_completed": true,
"program_id": "prg_789ghi",
"group_id": null,
"created_at": "2024-01-15T10:30:00Z"
},
"stats": {
"total_revenue": 297.00,
"total_commission": 29.70,
"total_orders": 3,
"last_order_at": "2024-01-25T10:00:00Z"
}
}
}
Referrals
Get Referral
Retrieve a single referral by ID with optional expanded data and statistics
GET
/
v1
/
referrals
/
{id}
curl -X GET "https://api.affonso.io/v1/referrals/ref_abc123" \
-H "Authorization: Bearer sk_live_your_api_key"
curl -X GET "https://api.affonso.io/v1/referrals/ref_abc123?expand=affiliate&include=stats" \
-H "Authorization: Bearer sk_live_your_api_key"
{
"success": true,
"data": {
"id": "ref_abc123",
"affiliate_id": "aff_456def",
"program_id": "prg_789ghi",
"email": "customer@example.com",
"customer_id": "cust_123",
"external_user_id": "user_42",
"subscription_id": null,
"status": "customer",
"name": "John Doe",
"metadata": {
"plan": "enterprise"
},
"created_at": "2024-01-20T15:30:00Z",
"converted_at": "2024-01-20T15:30:00Z"
}
}
{
"success": true,
"data": {
"id": "ref_abc123",
"affiliate_id": "aff_456def",
"program_id": "prg_789ghi",
"email": "customer@example.com",
"customer_id": "cust_123",
"external_user_id": "user_42",
"subscription_id": null,
"status": "customer",
"name": "John Doe",
"metadata": {
"plan": "enterprise"
},
"created_at": "2024-01-20T15:30:00Z",
"converted_at": "2024-01-20T15:30:00Z",
"affiliate": {
"id": "aff_456def",
"name": "John Doe",
"email": "john@example.com",
"tracking_id": "PARTNER123",
"source": "api",
"partnership_status": "APPROVED",
"onboarding_completed": true,
"program_id": "prg_789ghi",
"group_id": null,
"created_at": "2024-01-15T10:30:00Z"
},
"stats": {
"total_revenue": 297.00,
"total_commission": 29.70,
"total_orders": 3,
"last_order_at": "2024-01-25T10:00:00Z"
}
}
}
Path Parameters
string
required
The unique identifier of the referral to retrieve
Query Parameters
string
Comma-separated list of related data to include. Valid values:
affiliate. Example: expand=affiliate.string
Comma-separated list of additional data to include. Valid values:
stats. Example: include=stats. The stats include provides aggregated statistics about the referral’s transactions.Response
The response includes the referral object with optional expanded/included data.boolean
Always
true for successful responsesobject
The referral object.
Show Data Object Properties
Show Data Object Properties
string
Unique identifier for the referral
string
The affiliate ID who referred this customer
string
The affiliate program ID
string | null
The customer’s email address
string | null
Your internal customer ID if provided
string | null
Your external user ID if this referral is linked to a user from your application
string | null
Your internal subscription ID if provided
string
The referral status (lowercase):
lead, trialing, customer, active, canceled, rejectedstring | null
The customer’s name if provided
object | null
Custom key-value data if provided
string
ISO 8601 timestamp of when the referral was created
string | null
ISO 8601 timestamp of when the referral was converted (set when status is not
lead)curl -X GET "https://api.affonso.io/v1/referrals/ref_abc123" \
-H "Authorization: Bearer sk_live_your_api_key"
curl -X GET "https://api.affonso.io/v1/referrals/ref_abc123?expand=affiliate&include=stats" \
-H "Authorization: Bearer sk_live_your_api_key"
{
"success": true,
"data": {
"id": "ref_abc123",
"affiliate_id": "aff_456def",
"program_id": "prg_789ghi",
"email": "customer@example.com",
"customer_id": "cust_123",
"external_user_id": "user_42",
"subscription_id": null,
"status": "customer",
"name": "John Doe",
"metadata": {
"plan": "enterprise"
},
"created_at": "2024-01-20T15:30:00Z",
"converted_at": "2024-01-20T15:30:00Z"
}
}
{
"success": true,
"data": {
"id": "ref_abc123",
"affiliate_id": "aff_456def",
"program_id": "prg_789ghi",
"email": "customer@example.com",
"customer_id": "cust_123",
"external_user_id": "user_42",
"subscription_id": null,
"status": "customer",
"name": "John Doe",
"metadata": {
"plan": "enterprise"
},
"created_at": "2024-01-20T15:30:00Z",
"converted_at": "2024-01-20T15:30:00Z",
"affiliate": {
"id": "aff_456def",
"name": "John Doe",
"email": "john@example.com",
"tracking_id": "PARTNER123",
"source": "api",
"partnership_status": "APPROVED",
"onboarding_completed": true,
"program_id": "prg_789ghi",
"group_id": null,
"created_at": "2024-01-15T10:30:00Z"
},
"stats": {
"total_revenue": 297.00,
"total_commission": 29.70,
"total_orders": 3,
"last_order_at": "2024-01-25T10:00:00Z"
}
}
}
Was this page helpful?
⌘I
