curl -X PUT "https://api.affonso.io/v1/referrals/ref_abc123" \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"status": "customer"
}'
{
"success": true,
"data": {
"id": "ref_abc123",
"affiliate_id": "aff_456def",
"email": "customer@example.com",
"customer_id": "cust_123",
"subscription_id": null,
"status": "customer",
"name": "John Doe",
"metadata": {
"plan": "enterprise"
},
"created_at": "2024-01-20T15:30:00Z",
"converted_at": "2024-01-20T16:00:00Z"
}
}
Referrals
Update Referral
Update an existing referral’s email, customer ID, subscription ID, or status
PUT
/
v1
/
referrals
/
{id}
curl -X PUT "https://api.affonso.io/v1/referrals/ref_abc123" \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"status": "customer"
}'
{
"success": true,
"data": {
"id": "ref_abc123",
"affiliate_id": "aff_456def",
"email": "customer@example.com",
"customer_id": "cust_123",
"subscription_id": null,
"status": "customer",
"name": "John Doe",
"metadata": {
"plan": "enterprise"
},
"created_at": "2024-01-20T15:30:00Z",
"converted_at": "2024-01-20T16:00:00Z"
}
}
Path Parameters
string
required
The unique identifier of the referral to update
Body Parameters
All body parameters are optional. Only include the fields you want to update.string
Update the customer’s email address. Must be a valid email format.
string
Update your internal customer ID. Set to
null to clear.string
Update your internal subscription ID. Set to
null to clear.string
Update the referral status. Valid values:
lead, trialing, customer, active, canceled, rejected. If changing from lead to any other status, convertedAt will be automatically set. Status changes may trigger webhook events (referral.converted).string
Update the customer’s name.
object
Update the custom key-value data. Pass a new object to replace the existing metadata.
Response
boolean
Always
true for successful responsesobject
The updated 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 | null
The customer’s email address
string | null
Your internal customer ID
string | null
Your internal subscription ID
string
The referral status:
lead, trialing, customer, active, canceled, rejectedstring | null
The customer’s name
object | null
Custom key-value data
string
ISO 8601 timestamp of when the referral was created
string | null
ISO 8601 timestamp of when the referral was converted
curl -X PUT "https://api.affonso.io/v1/referrals/ref_abc123" \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"status": "customer"
}'
{
"success": true,
"data": {
"id": "ref_abc123",
"affiliate_id": "aff_456def",
"email": "customer@example.com",
"customer_id": "cust_123",
"subscription_id": null,
"status": "customer",
"name": "John Doe",
"metadata": {
"plan": "enterprise"
},
"created_at": "2024-01-20T15:30:00Z",
"converted_at": "2024-01-20T16:00:00Z"
}
}
Was this page helpful?
