Delete a voucher code

DELETE
/voucher-codes/{id}

Deletes a voucher code, expired or not, and returns it one last time — subsequent requests for it return 404. Its reductions are removed from pending line items, so it stops discounting bookings that have not been paid for; bookings already paid for keep the discount they were given. Deleting also drops the voucher code's variants and date_ranges, so the returned resource lists neither, and frees its code for a new voucher code to use.

Path Parameters

id*string

ID of the voucher code (e.g. vc_aBcDeFgHiJ).

Header Parameters

Idempotency-Key?string

Client-generated key for idempotent writes; the server deduplicates retries within a 24-hour window.

Response Body

application/json

application/json

application/json

curl -X DELETE "https://example.com/voucher-codes/string" \  -H "Easol-API-Version: 2026-11-01"
{
  "id": "vc_aBcDeFgHiJ",
  "object": "voucher_code",
  "code": "SUMMER25",
  "discount_type": "percentage",
  "discount_percentage": 25,
  "discount_amount": {
    "amount": 0,
    "currency": "string"
  },
  "bogof_purchase": 2,
  "bogof_free": 1,
  "redemption_limit": 100,
  "redemptions": 12,
  "minimum_quantity": 1,
  "expires_on": "2026-12-31",
  "applies_automatically": true,
  "apply_to_all_products": true,
  "status": "valid",
  "variants": {
    "object": "list",
    "url": "string",
    "has_more": false,
    "next_cursor": "string",
    "data": [
      {
        "id": "expv_aBcDeFgHiJ",
        "object": "experience_variant",
        "name": "Double room",
        "tagline": "Sea view, breakfast included"
      }
    ]
  },
  "date_ranges": {
    "object": "list",
    "url": "string",
    "has_more": false,
    "next_cursor": "string",
    "data": [
      {
        "start_on": "2026-09-01",
        "end_on": "2026-09-30"
      }
    ]
  }
}
{
  "error": {
    "code": "string",
    "message": "string"
  }
}
{
  "error": {
    "code": "string",
    "message": "string"
  }
}