Discounts

Create discount

Creates a new discount code

post/discounts

Request

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

Headers

Idempotency-Keystring

Makes this write safe to retry: a repeat with the same key replays the first response instead of creating a second resource. Scoped to the account, remembered for 24 hours; reusing a key with a different payload is an error.

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 created

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.