curl "https://api.affonso.io/v1/embed/data?token=a1b2c3d4e5f6789..."
{
"success": true,
"data": {
"affiliate": {
"name": "John Doe",
"email": "[email protected]",
"trackingId": "john-doe",
"avatarUrl": null
},
"link": "https://acme.com?via=john-doe",
"websiteUrl": "https://acme.com",
"rewards": {
"type": "percentage",
"amount": 20,
"recurring": true,
"duration": "lifetime"
},
"incentives": [],
"stats": {
"clicks": 150,
"leads": 45,
"sales": 12,
"salesAmount": 2400,
"earnings": {
"pending": 120,
"approved": 280,
"paid": 480
}
},
"earnings": [
{
"id": "tx_abc123",
"customerId": "ref_xyz789",
"date": "2024-01-14T15:30:00.000Z",
"amount": 99.00,
"commission": 19.80,
"status": "APPROVED"
}
],
"portalUrl": "https://yourcompany.affonso.io/auth?email=john%40example.com",
"coupon": {
"code": "JOHN20",
"discountType": "percentage",
"discountValue": 20
},
"couponBlueprint": null,
"creatives": [
{
"id": "cr_123",
"name": "Banner 300x250",
"description": "Standard banner ad",
"category": "banners",
"url": "https://cdn.example.com/banner.png",
"dimensions": { "width": 300, "height": 250 }
}
],
"program": {
"name": "Acme Affiliate Program",
"logoUrl": "https://acme.com/logo.png"
},
"theme": {
"primaryColor": "#881337",
"secondaryColor": "#f0f0f0"
},
"token": "a1b2c3d4e5f6789..."
}
}
Retrieve all data needed to render the embedded referral dashboard
curl "https://api.affonso.io/v1/embed/data?token=a1b2c3d4e5f6789..."
{
"success": true,
"data": {
"affiliate": {
"name": "John Doe",
"email": "[email protected]",
"trackingId": "john-doe",
"avatarUrl": null
},
"link": "https://acme.com?via=john-doe",
"websiteUrl": "https://acme.com",
"rewards": {
"type": "percentage",
"amount": 20,
"recurring": true,
"duration": "lifetime"
},
"incentives": [],
"stats": {
"clicks": 150,
"leads": 45,
"sales": 12,
"salesAmount": 2400,
"earnings": {
"pending": 120,
"approved": 280,
"paid": 480
}
},
"earnings": [
{
"id": "tx_abc123",
"customerId": "ref_xyz789",
"date": "2024-01-14T15:30:00.000Z",
"amount": 99.00,
"commission": 19.80,
"status": "APPROVED"
}
],
"portalUrl": "https://yourcompany.affonso.io/auth?email=john%40example.com",
"coupon": {
"code": "JOHN20",
"discountType": "percentage",
"discountValue": 20
},
"couponBlueprint": null,
"creatives": [
{
"id": "cr_123",
"name": "Banner 300x250",
"description": "Standard banner ad",
"category": "banners",
"url": "https://cdn.example.com/banner.png",
"dimensions": { "width": 300, "height": 250 }
}
],
"program": {
"name": "Acme Affiliate Program",
"logoUrl": "https://acme.com/logo.png"
},
"theme": {
"primaryColor": "#881337",
"secondaryColor": "#f0f0f0"
},
"token": "a1b2c3d4e5f6789..."
}
}
token query parameter for authentication.POST /v1/embed/token.true for successful responses.Show Data Object Properties
name (string | null): Display nameemail (string): Email addresstrackingId (string | null): Unique tracking identifieravatarUrl (string | null): Profile picture URLtype (string): “percentage” or “flat”amount (number): Commission amountrecurring (boolean): Whether commission is recurringduration (string | null): Duration typeclicks (number): Total referralsleads (number): Leads generatedsales (number): Successful conversionssalesAmount (number): Total sales amountearnings.pending (number): Pending commissionearnings.approved (number): Approved but unpaidearnings.paid (number): Total paid outid (string): Transaction IDcustomerId (string): Referral ID (for anonymous name generation)date (string): ISO 8601 timestampamount (number): Transaction amountcommission (number): Commission earnedstatus (string): “PENDING”, “APPROVED”, “PAID”, “REFUNDED”, or “DECLINED”code (string): The coupon codediscountType (string): “percentage” or “flat”discountValue (number): Discount amount/v1/embed/coupon.discountType (string): “percentage” or “flat”discountValue (number): Discount amountname (string): Program namelogoUrl (string | null): Program logoprimaryColor (string | null): HEX color codesecondaryColor (string | null): HEX color codeCache-Control: private, max-age=60 header. Data can be cached for up to 60 seconds client-side.
curl "https://api.affonso.io/v1/embed/data?token=a1b2c3d4e5f6789..."
{
"success": true,
"data": {
"affiliate": {
"name": "John Doe",
"email": "[email protected]",
"trackingId": "john-doe",
"avatarUrl": null
},
"link": "https://acme.com?via=john-doe",
"websiteUrl": "https://acme.com",
"rewards": {
"type": "percentage",
"amount": 20,
"recurring": true,
"duration": "lifetime"
},
"incentives": [],
"stats": {
"clicks": 150,
"leads": 45,
"sales": 12,
"salesAmount": 2400,
"earnings": {
"pending": 120,
"approved": 280,
"paid": 480
}
},
"earnings": [
{
"id": "tx_abc123",
"customerId": "ref_xyz789",
"date": "2024-01-14T15:30:00.000Z",
"amount": 99.00,
"commission": 19.80,
"status": "APPROVED"
}
],
"portalUrl": "https://yourcompany.affonso.io/auth?email=john%40example.com",
"coupon": {
"code": "JOHN20",
"discountType": "percentage",
"discountValue": 20
},
"couponBlueprint": null,
"creatives": [
{
"id": "cr_123",
"name": "Banner 300x250",
"description": "Standard banner ad",
"category": "banners",
"url": "https://cdn.example.com/banner.png",
"dimensions": { "width": 300, "height": 250 }
}
],
"program": {
"name": "Acme Affiliate Program",
"logoUrl": "https://acme.com/logo.png"
},
"theme": {
"primaryColor": "#881337",
"secondaryColor": "#f0f0f0"
},
"token": "a1b2c3d4e5f6789..."
}
}
<iframe
src="https://yourcompany.affonso.io/embed/referrals?token=a1b2c3d4e5f6789..."
width="100%"
height="600"
frameborder="0"
/>
TOKEN_EXPIRED error, generate a new token using POST /v1/embed/token.Was this page helpful?