curl -X PUT "https://api.affonso.io/v1/affiliates/cmj8pptm10002p3010z8mk9ak" \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"invoice_details": {
"company_name": "John LLC",
"first_name": "John",
"last_name": "Doe",
"address_line_1": "123 Main St",
"city": "New York",
"postal_code": "10001",
"state": "NY",
"country": "US"
},
"payout_method": "paypal",
"payout_details": {
"email": "john@example.com"
},
"status": "approved",
"external_user_id": "user_456",
"metadata": {
"plan": "enterprise"
}
}'
{
"success": true,
"data": {
"id": "cmj8pptm10002p3010z8mk9ak",
"name": "John Doe",
"email": "john@example.com",
"tracking_id": "john-doe",
"source": "api",
"partnership_status": "APPROVED",
"onboarding_completed": false,
"group_id": null,
"external_user_id": "user_456",
"metadata": {
"plan": "enterprise"
},
"created_at": "2024-01-15T10:30:00Z"
}
}
Affiliates
Update Affiliate
Update an existing affiliate
PUT
/
v1
/
affiliates
/
{id}
curl -X PUT "https://api.affonso.io/v1/affiliates/cmj8pptm10002p3010z8mk9ak" \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"invoice_details": {
"company_name": "John LLC",
"first_name": "John",
"last_name": "Doe",
"address_line_1": "123 Main St",
"city": "New York",
"postal_code": "10001",
"state": "NY",
"country": "US"
},
"payout_method": "paypal",
"payout_details": {
"email": "john@example.com"
},
"status": "approved",
"external_user_id": "user_456",
"metadata": {
"plan": "enterprise"
}
}'
{
"success": true,
"data": {
"id": "cmj8pptm10002p3010z8mk9ak",
"name": "John Doe",
"email": "john@example.com",
"tracking_id": "john-doe",
"source": "api",
"partnership_status": "APPROVED",
"onboarding_completed": false,
"group_id": null,
"external_user_id": "user_456",
"metadata": {
"plan": "enterprise"
},
"created_at": "2024-01-15T10:30:00Z"
}
}
Path Parameters
string
required
The unique identifier of the affiliate to update
Body Parameters
All body parameters are optional. Only include the fields you want to update.string
Update the affiliate’s display name. Must be between 1 and 100 characters.
string
Update the affiliate’s email address. Must be a valid email format. If the email is already in use by another user, the request will fail with a conflict error.
string | null
Affiliate group ID (null to remove).
string | null
Company name for invoice. Maximum 100 characters. Set to
null to clear.string | null
2-letter ISO country code. Set to
null to clear. Legacy alias for invoice country when invoice_details is omitted.object
Partial billing and invoice details. Omitted keys keep their current values.
null clears optional fields. If the affiliate has no invoice record yet, you must send first_name, last_name, address_line_1, city, and country. Required fields cannot be cleared. vat_validated and vat_validated_at are read-only on GET with expand=invoiceDetails and are rejected on write.company_name(string | null, max 100)first_name(string)last_name(string)address_line_1(string)address_line_2(string | null)city(string)postal_code(string | null)state(string | null)country(2-letter ISO 3166-1 alpha-2)vat_id(string | null)tax_id(string | null)
invoice_details and the top-level company_name / country_code aliases are sent, invoice_details wins.string
Payout method (none to remove). Valid values:
paypal, wise, payoneer, paxum, webmoney, skrill, wire_transfer, bitcoin, ethereum, alipay, wechat, manual, none.object
Payout details (snake_case fields). 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
string
Partnership approval status. Valid values:
pending, approved, rejected.string | null
Your external user ID for linking referral users to your own user system. Set to
null to clear.object | null
Custom key-value data for storing additional information about the affiliate. Set to
null to clear.Response
The response includes the updated affiliate object with the same structure as the create endpoint.boolean
Always
true for successful responsesobject
The updated affiliate object.
Show Data Object Properties
Show Data Object Properties
string
Unique identifier for the affiliate
string
The affiliate’s display name
string
The affiliate’s email address
string
Unique tracking ID for the affiliate
string
Source of the affiliate creation
string
Partnership status with the program:
"PENDING", "APPROVED", "REJECTED", or nullboolean
Whether the affiliate has completed their onboarding process
string | null
The affiliate group ID if assigned, otherwise
nullstring | null
Your external user ID if set, otherwise
nullobject | null
Custom key-value data if set, otherwise
nullstring
ISO 8601 timestamp of when the affiliate was created
curl -X PUT "https://api.affonso.io/v1/affiliates/cmj8pptm10002p3010z8mk9ak" \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"invoice_details": {
"company_name": "John LLC",
"first_name": "John",
"last_name": "Doe",
"address_line_1": "123 Main St",
"city": "New York",
"postal_code": "10001",
"state": "NY",
"country": "US"
},
"payout_method": "paypal",
"payout_details": {
"email": "john@example.com"
},
"status": "approved",
"external_user_id": "user_456",
"metadata": {
"plan": "enterprise"
}
}'
{
"success": true,
"data": {
"id": "cmj8pptm10002p3010z8mk9ak",
"name": "John Doe",
"email": "john@example.com",
"tracking_id": "john-doe",
"source": "api",
"partnership_status": "APPROVED",
"onboarding_completed": false,
"group_id": null,
"external_user_id": "user_456",
"metadata": {
"plan": "enterprise"
},
"created_at": "2024-01-15T10:30:00Z"
}
}
GET /v1/affiliates/{id}?expand=invoiceDetails. Combine expands as needed: promoCodes,commissionOverrides,invoiceDetails,payoutMethod.Was this page helpful?
