Body Parameters
The affiliate’s full display name. Must be between 1 and 100 characters.
The affiliate’s email address. Must be a valid email format. If a user with this email already exists, they will be linked to the affiliate account.
Program ID to associate affiliate with.
Optional affiliate group ID.
Company name for invoice. Maximum 100 characters.
2-letter ISO country code.
Payout method (lowercase with underscores). Valid values: paypal, wise, payoneer, paxum, webmoney, skrill, wire_transfer, bitcoin, ethereum, alipay, wechat, manual, none.
Payout details (fields vary by method, all snake_case). The required fields depend on the payout_method:
Email-based methods (paypal, wise, payoneer, paxum, skrill): email (string, valid email)
ID-based methods (webmoney, alipay, wechat): account_id (string)
Crypto methods (bitcoin, ethereum): address (string, wallet address)
Wire transfer (wire_transfer): bank_name, account_number, swift_code, iban, routing_number, account_name (all strings)
Manual (manual): No details required
Response
The response includes the created affiliate object with the following fields:
Always true for successful responses
The created affiliate object. Show Data Object Properties
Unique identifier for the affiliate
The affiliate’s display name
The affiliate’s email address
Unique tracking ID for the affiliate, automatically generated from the name or a random suffix if needed
Source of the affiliate creation, always "api" for API-created affiliates
Partnership status with the program. Will be "APPROVED" for newly created affiliates. Can be "PENDING", "APPROVED", "REJECTED", or null.
Whether the affiliate has completed their onboarding process. Always false for newly created affiliates.
The affiliate program ID the affiliate is assigned to
The affiliate group ID if assigned, otherwise null
ISO 8601 timestamp of when the affiliate was created
curl -X POST "https://api.affonso.io/v1/affiliates" \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Jane Smith",
"email": "[email protected] ",
"program_id": "cm7xutqbb0001yfkcrnpextmp",
"company_name": "Jane LLC",
"country_code": "US",
"payout_method": "paypal",
"payout_details": {
"email": "[email protected] "
}
}'
{
"success" : true ,
"data" : {
"id" : "cmj8q1wau0003sb01lpvka478" ,
"name" : "Jane Smith" ,
"email" : "[email protected] " ,
"tracking_id" : "jane-smith" ,
"source" : "api" ,
"partnership_status" : "APPROVED" ,
"onboarding_completed" : false ,
"program_id" : "cm7xutqbb0001yfkcrnpextmp" ,
"group_id" : null ,
"created_at" : "2024-01-25T09:15:00Z"
}
}
Note: To retrieve related data like promo codes, commission overrides, invoice details, and payout methods, use GET /v1/affiliates/{id}?expand=promoCodes,commissionOverrides,invoiceDetails,payoutMethod.