Discounts

Update discount

Updates an existing discount

patch/discounts/{id}

Request

  • Base URL: https://api.crevio.co/v1
  • URL: https://api.crevio.co/v1/discounts/{id}
  • Auth: API key in header Authorization

Path parameters

idstring required

The resource ID (e.g., "prod_abc123") or slug (e.g., "my-product")

Request body

codestring
discount_type'percentage' | 'fixed'
amount_offinteger nullable
percent_offnumber nullable
currencystring nullable
duration'forever' | 'once' | 'repeating'
duration_in_monthsinteger nullable
starts_atstring date-time nullable

When the code becomes usable. Checkout rejects it before this time; omit it to make the code usable right away. For a sale that starts later, create the discount now with starts_at set rather than scheduling its creation.

redeem_bystring date-time nullable

When the code stops being usable. Must be in the future and after starts_at.

max_redemptionsinteger nullable
price_variantsstring[]

Response

Discount updated

idstring required
objectstring required
status'active' | 'inactive' required
discount_type'percentage' | 'fixed' required
codestring required
amount_offinteger nullable required
duration'forever' | 'once' | 'repeating' required
duration_in_monthsinteger nullable required
max_redemptionsinteger nullable required
times_redeemedinteger required
starts_atstring date-time nullable required
redeem_bystring date-time nullable required
created_atstring date-time required
updated_atstring date-time required
percent_offnumber double nullable required
currencystring nullable required

Changes

No recorded changes to this operation across all 2 revisions of this API.