Create Discount
Discounts
Create Discount
Create a new discount code
POST
Create Discount
Create Discount
Creates a new discount code in the store. Requires thewrite_discounts scope.
Request
Body Parameters
Unique discount code. A discount with an existing code is rejected.
Discount type. One of
percentage, fixed_amount, free_shipping,
buy_x_get_y.Discount value. For
percentage, enter 20 for 20%. For fixed_amount,
enter the amount in the store’s currency (e.g. 20 for 20.00). Ignored for
free_shipping.Minimum order total required for the discount to apply.
Maximum number of times the discount can be used across all customers.
Defaults to
0 (unlimited) when omitted.When
true, limits the discount to one use per customer.Array of product IDs the discount is restricted to. Omit to apply the
discount store-wide.
Start date (ISO 8601). Omit for no start constraint.
End date (ISO 8601). Omit for no expiration.
The merchant dashboard supports additional discount capabilities —
minimum quantity, buy-X-get-Y quantities and free-item rewards, and
new-customer eligibility. These are configured through the merchant
surface and are not part of the OAuth App-API create body; any extra
fields sent here are ignored.
Response
The created discount is returned underdata.discount in the standard
response envelope.
Errors
| Status | state | Message |
|---|---|---|
400 | error | code is required (missing code) |
400 | error | Discount with this code already exists |
400 | error | Validation error (invalid type, negative value, etc.) |
401 | error | Invalid or missing access token |
403 | error | App is missing the write_discounts scope |