Skip to main content
DELETE
/
v1
/
coupons
/
{id}
curl -X DELETE "https://api.affonso.io/v1/coupons/cpn_abc123" \
  -H "Authorization: Bearer sk_live_your_api_key"
{
  "success": true,
  "data": {
    "id": "cpn_abc123",
    "deleted": true
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.affonso.io/llms.txt

Use this file to discover all available pages before exploring further.

Permanently delete a coupon. The coupon is also deleted at your payment provider.
This action cannot be undone. Once deleted, the coupon code becomes available for reuse.

Path Parameters

id
string
required
The unique identifier of the coupon to delete.

Response

success
boolean
Always true for successful responses
data
object
Confirmation object containing the deleted coupon’s ID.
curl -X DELETE "https://api.affonso.io/v1/coupons/cpn_abc123" \
  -H "Authorization: Bearer sk_live_your_api_key"
{
  "success": true,
  "data": {
    "id": "cpn_abc123",
    "deleted": true
  }
}

Error Responses

404 Not Found
Returned when the coupon doesn’t exist or has already been deleted. Error code: NOT_FOUND
500 Internal Server Error
Returned when the coupon is missing provider records. This indicates a data integrity issue. Error code: INTERNAL_ERROR
502 Bad Gateway
Returned when the payment provider fails to delete the coupon. The coupon remains in Affonso’s database.