Skip to main content
PUT
Update Discount

Update Discount

Updates an existing discount code. Only provided fields will be updated.

Request

Path Parameters

id
string
required
The unique discount ID to update

Body Parameters

All parameters are optional. Only provided fields will be updated. Any field not listed below is ignored.
code
string
Discount code (changing code affects any saved links)
type
string
Discount type: percentage, fixed_amount, free_shipping, buy_x_get_y
value
number
Discount value (percentage or fixed amount). Must be >= 0.
applies_to
string
What the discount applies to: all, products, collections
product_ids
array
Product IDs (when applies_to is products)
collection_ids
array
Collection IDs (when applies_to is collections)
minimum_amount
number
Minimum order amount required for the discount to apply
usage_limit
integer
Maximum total uses. Must be >= 1.
once_per_customer
boolean
Limit to one use per customer
starts_at
string
Start date (ISO 8601)
ends_at
string
End date (ISO 8601)
status
string
Discount status: active, expired, scheduled, disabled

Response

Returns the standard response envelope with the updated discount row under data.discount.
status
integer
HTTP status code (e.g. 200)
state
string
Response state: success or error
message
string
Human-readable message (null on success)
data.discount
object
The updated discount object

Example Response

Notes

  • Setting status to disabled (or any value other than active) deactivates the discount; active reactivates it.
  • Changing the code will affect any shared links or saved customer carts.
  • Usage count cannot be modified directly.

Error Response

Errors return the same envelope with an error state. A missing discount returns 404: