Update discount
Changed onUpdates an existing discount. The terms checkouts charge are fixed once the discount exists: changing discount_type, percent_off, amount_off, duration, duration_in_months, or a fixed discount's currency, raising max_redemptions, or moving redeem_by later returns 422 naming the field. Create a new discount for different terms.
Request
- Base URLhttps://api.crevio.co/v1
- AuthAPI key in header Authorization
Path parameters
The resource's ID, as returned in its id field
Request body
Letters, numbers, dashes and underscores. Unique per business regardless of case.
inactive turns the code off at once and checkout rejects it; active turns it back on. Leaves redeem_by and the code's products unchanged.
Amount off in the currency's smallest unit (cents), for a fixed discount.
Three-letter currency code. Required when discount_type is fixed or minimum_amount is set.
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.
When the code stops being usable. Must be after starts_at and in the future whenever it is set. To end a code now, set status to inactive.
How many live orders can use the code, across all contacts. Test purchases don't count. Can be lowered later, or set later on a code created without one; raising it past the number set at creation answers 422, so create a new code for more uses.
Smallest order subtotal, in cents before the discount, that can use the code. Requires currency; an order in another currency can't use the code. null removes it.
Each contact can use the code on one live order.
Only contacts with no earlier live paid order from this business can use the code. Free orders and test purchases don't count as earlier orders.
Response
Discount updated
expired once redeem_by has passed on an active code. inactive means it was turned off.
The prices (price_...) the code works on. Empty means every price.
Changes
- warning
added the new
expiredenum value to thestatusresponse property for the response status
- warning
- breaking
added the pattern
^[a-zA-Z0-9_-]+$to the request propertycode - warning
the
amount_offrequest property's max was set to99999999.00
9 more changes in this revision
- breaking