Skip to main content

Update Promotion Code

Update an existing promotion code in your store. This endpoint uses PATCH semantics, meaning only the fields you include in the request body will be updated.

Only three fields are mutable

Only active, name, and price_uuids can be changed after creation. The discount amount/percent, currency, duration, expiry, max redemptions, and the first_time_transaction / minimum_amount restrictions are frozen. To change a frozen field, archive the code and create a new one.

Deactivate vs. archive

Setting active: false is a reversible deactivation — call again with {"active": true} to re-enable. For permanent end-of-life use Archive a promotion code instead.

Request

PATCH /promotion-codes/{id}

Path Parameters

ParameterTypeRequiredDescription
idstringYesPromotion code UUID

Request Body

All fields are optional. Only include the fields you want to update.

ParameterTypeDescription
activebooleanReversibly toggles the code on (true) or off (false).
namestringInternal name shown in dashboards, max 40 characters. Pass null to clear.
price_uuidsarrayVariant UUIDs the code applies to. Pass null or [] to widen back to "all prices of the product" (only meaningful for product-scoped codes).

Example Request — temporarily deactivate

curl -X PATCH "https://cart.easy.tools/api/v1/promotion-codes/550e8400-e29b-41d4-a716-446655440030" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"active": false
}'

Example Request — rename

curl -X PATCH "https://cart.easy.tools/api/v1/promotion-codes/550e8400-e29b-41d4-a716-446655440030" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Black Friday 2026 — extended"
}'

Example Request — re-scope to a different set of variants

curl -X PATCH "https://cart.easy.tools/api/v1/promotion-codes/550e8400-e29b-41d4-a716-446655440030" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"price_uuids": [
"550e8400-e29b-41d4-a716-446655440001",
"550e8400-e29b-41d4-a716-446655440002"
]
}'

Response

Success Response (200)

Returns the updated promotion code.

{
"id": "550e8400-e29b-41d4-a716-446655440030",
"code": "BLACKFRIDAY20",
"name": "Black Friday 2026 — extended",
"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": "active",
"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"
}

Validation Error (422)

{
"message": "The given data was invalid.",
"errors": {
"name": [
"The name field must not be greater than 40 characters."
]
}
}

Unauthorized (401)

{
"message": "Unauthenticated."
}