curl -X PUT "https://api.affonso.io/v1/commissions/com_abc123" \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"status": "ready_for_payment",
"sale_amount": 149.00,
"sale_amount_currency": "USD",
"commission_amount": 14.90,
"commission_currency": "USD"
}'
{
"success": true,
"data": {
"id": "com_abc123",
"referral_id": "ref_456def",
"affiliate_id": "aff_789ghi",
"sale_amount": 149.00,
"sale_amount_currency": "USD",
"commission_amount": 14.90,
"commission_currency": "USD",
"status": "ready_for_payment",
"sales_status": "complete",
"hold_period_days": null,
"payment_intent_id": null,
"invoice_id": null,
"created_at": "2024-01-20T15:30:00Z",
"updated_at": "2024-01-20T16:45:00Z"
}
}
Commissions
Update Commission
Update a commission’s status, transaction status, hold period, or amounts
PUT
/
v1
/
commissions
/
{id}
curl -X PUT "https://api.affonso.io/v1/commissions/com_abc123" \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"status": "ready_for_payment",
"sale_amount": 149.00,
"sale_amount_currency": "USD",
"commission_amount": 14.90,
"commission_currency": "USD"
}'
{
"success": true,
"data": {
"id": "com_abc123",
"referral_id": "ref_456def",
"affiliate_id": "aff_789ghi",
"sale_amount": 149.00,
"sale_amount_currency": "USD",
"commission_amount": 14.90,
"commission_currency": "USD",
"status": "ready_for_payment",
"sales_status": "complete",
"hold_period_days": null,
"payment_intent_id": null,
"invoice_id": null,
"created_at": "2024-01-20T15:30:00Z",
"updated_at": "2024-01-20T16:45:00Z"
}
}
Path Parameters
string
required
The unique identifier of the commission to update
Body Parameters
All body parameters are optional. Only include the fields you want to update.string
Update the commission status. Valid values:
pending, pending_manual_approval, ready_for_payment, paid, declined. Status changes may trigger webhook events (transaction.approved, transaction.rejected, transaction.paid).string
Status of the customer’s purchase. Valid values:
open, complete, trialing, failed, refunded, partial_refunded.integer
Number of days to hold commission before it’s ready for payment. Must be a non-negative integer.
number
Update the sale/transaction amount. Must be a positive number.
string
Update the currency code for the sale amount. Must be a 3-letter currency code (e.g.,
USD, EUR).number
Update the commission amount to be paid. Must be a non-negative number.
string
Update the currency code for the commission. Must be a 3-letter currency code (e.g.,
USD, EUR).Response
boolean
Always
true for successful responsesobject
The updated commission object.
Show Data Object Properties
Show Data Object Properties
string
Unique identifier for the commission
string
The referral ID this commission is associated with
string
The affiliate ID who will receive this commission
number
The total sale/transaction amount
string
The currency code for the sale (3 letters)
number
The commission amount to be paid
string | null
The currency code for the commission. Can be
null when the transaction exists without an affiliate earning.string
Commission status:
pending, pending_manual_approval, ready_for_payment, paid, declinedstring
Sales status:
open, complete, trialing, failed, refunded, partial_refundedinteger | null
Number of days commission is on hold
string | null
Payment intent ID if provided
string | null
Invoice ID if linked
string
ISO 8601 timestamp of creation
string
ISO 8601 timestamp of last update
curl -X PUT "https://api.affonso.io/v1/commissions/com_abc123" \
-H "Authorization: Bearer sk_live_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"status": "ready_for_payment",
"sale_amount": 149.00,
"sale_amount_currency": "USD",
"commission_amount": 14.90,
"commission_currency": "USD"
}'
{
"success": true,
"data": {
"id": "com_abc123",
"referral_id": "ref_456def",
"affiliate_id": "aff_789ghi",
"sale_amount": 149.00,
"sale_amount_currency": "USD",
"commission_amount": 14.90,
"commission_currency": "USD",
"status": "ready_for_payment",
"sales_status": "complete",
"hold_period_days": null,
"payment_intent_id": null,
"invoice_id": null,
"created_at": "2024-01-20T15:30:00Z",
"updated_at": "2024-01-20T16:45:00Z"
}
}
Was this page helpful?
