Offers
Create a discount
With a code, shoppers type it at checkout. Without one, it is an automatic discount the store applies by itself. Like the Discounts page.
Body
- namestring
1–80 characters
- codestring or null
Stored in capitals. null makes it an automatic discount.
- discountDiscountValue
percent: value is a percentage up to 90 ("10", "12.5"). fixed: value is an amount in the store's currency ("500.00").
2 child fields
- typestringRequired
One of
percent,fixed - valuestringRequired
- applies_tostring
One of
store,collection,product - product_idsarray of strings
up to 500 items
- collection_idsarray of strings
up to 100 items
- starts_atstring or null
ISO 8601 date-time, UTC
- ends_atstring or null
ISO 8601 date-time, UTC
- usage_limitinteger or null
Total uses across all shoppers.
min 1
- per_customer_limitinteger or null
min 1
- statusstring
One of
active,paused
Returns
201 Created · The new discount. Discount
- idstring
starts with dsc_
- objectstring
always "discount"
- namestring
- codestring or null
- kindstring
One of
code,automatic - discountDiscountValue
percent: value is a percentage up to 90 ("10", "12.5"). fixed: value is an amount in the store's currency ("500.00").
2 child fields
- typestringRequired
One of
percent,fixed - valuestringRequired
- applies_tostring
One of
store,collection,product - product_idsarray of strings
- collection_idsarray of strings
- starts_atstring or null
ISO 8601 date-time, UTC
- ends_atstring or null
ISO 8601 date-time, UTC
- usage_limitinteger or null
- per_customer_limitinteger or null
- times_usedinteger
- statusstring
One of
active,paused - statestring
One of
active,scheduled,expired,used_up,paused - created_atstring
ISO 8601 date-time, UTC
- updated_atstring
ISO 8601 date-time, UTC
- livemodeboolean
Errors
Every error has the same shape. This endpoint can answer with:
