Archive Promotion Code
Permanently archive a promotion code in your store.
Irreversible
Archiving hides the code from default listings and deactivates it at the payment
provider, so it cannot be redeemed at checkout. There is no /unarchive — archive is
final.
For a reversible "pause this code" use
PATCH /promotion-codes/{id} with {"active": false} instead.
The archived code:
- still exists and can be fetched directly by ID, or via the list with
?status=archived - has
status: "archived",is_hidden: true, andpublished: false - cannot be redeemed at checkout
Calling this endpoint on an already-archived code is a no-op (returns 200 with the
current state).
Request
POST /promotion-codes/{id}/archive
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Promotion code UUID |
Example Request
curl -X POST "https://cart.easy.tools/api/v1/promotion-codes/550e8400-e29b-41d4-a716-446655440030/archive" \
-H "Authorization: Bearer YOUR_API_TOKEN"
Response
Success Response (200)
Returns the archived promotion code.
{
"id": "550e8400-e29b-41d4-a716-446655440030",
"code": "BLACKFRIDAY20",
"name": "Black Friday 2026",
"discount_type": "percent_off",
"amount_off": null,
"percent_off": 20,
"currency": null,
"duration": "once",
"duration_in_months": null,
"max_redemptions": 100,
"times_redeemed": 14,
"expires_at": "2026-12-31T23:59:59+00:00",
"first_time_transaction": false,
"minimum_amount": null,
"minimum_amount_currency": null,
"scope": {
"type": "global"
},
"status": "archived",
"created_at": "2026-05-27T10:16:00+00:00",
"updated_at": "2026-05-28T11:00:00+00:00"
}
See the Get Promotion Codes reference for a full description of each field.
Error Responses
Bad Request (400)
{
"message": "Invalid promotion code ID"
}
Promotion Code Not Found (404)
{
"message": "Promotion code with ID 550e8400-e29b-41d4-a716-446655440030 not found"
}
Unauthorized (401)
{
"message": "Unauthenticated."
}