Skip to main content
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",
    "program_id": "prg_789ghi",
    "email": "[email protected]",
    "customer_id": "cust_123",
    "subscription_id": null,
    "status": "customer",
    "created_at": "2024-01-20T15:30:00Z",
    "converted_at": "2024-01-20T16:00:00Z"
  }
}

Path Parameters

id
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.
email
string
Update the customer’s email address. Must be a valid email format.
customer_id
string
Update your internal customer ID. Set to null to clear.
subscription_id
string
Update your internal subscription ID. Set to null to clear.
status
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).

Response

success
boolean
Always true for successful responses
data
object
The updated referral object.
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",
    "program_id": "prg_789ghi",
    "email": "[email protected]",
    "customer_id": "cust_123",
    "subscription_id": null,
    "status": "customer",
    "created_at": "2024-01-20T15:30:00Z",
    "converted_at": "2024-01-20T16:00:00Z"
  }
}