Add discount code
POST
/ store/ v1/ carts/ {cart_id}/ discount-codes- Idempotency-Key supported
Apply a discount code. Unknown codes are refused; codes that don't apply yet stay on the cart with the reason in discount_codes.
Path parameters
cart_idstringrequiredThe cart's ID, like
cart_01k8qs5s….
Headers
X-Cart-TokenstringrequiredThe cart's token
Idempotency-KeystringSend the same key to retry safely: the first answer is replayed for 24 hours.
shop-api-versionYYYY-MMThe version to answer in. Without it, your app’s pinned version, else the newest.
Body
codestringrequired
Returns
200 The updated cart.
Errors
- 404
not_foundNo such cart. - 409A payment is in progress, or the cart is completed.
- 422
validation_failedInvalid code, or too many codes. - 429
rate_limitedToo many wrong codes from this cart or address: try again later.