Checkouts
Add Discount to Checkout
POST /stores/{store_hash}/v3/checkouts/{checkoutId}/discounts
Request
Adds a discount to an existing checkout.
Use this endpoint to apply the following discounts:
- Apply a manual discount to a cart. In this case, you can distribute the discount between each line item in the cart based on the item value.
- Apply a manual discount against a specific line item.
- Apply a manual discount at the item-level with a cart-level discount.
Notes:
- When you call this API, you clear out all existing discounts applied to line items, including product and order-based discounts.
- You cannot apply a manual discount to a specific line item if you have already applied a coupon or automatic promotion to it.
Required Fields:
discounted_amount
at the cart-level or at the item-level
Authentication
- X-Auth-Token in headerrequired
Parameters
- store_hash in path - string
- checkoutId in path - stringrequired
ID of the checkout; the same as the cart ID.
- Accept in header with default of application/json - stringrequired
The MIME type of the response body.
- Content-Type in header with default of application/json - stringrequired
The MIME type of the request body.
Body
object | application/json
cartobject
example
Response
Body
object | application/json
dataobject
metaobject
Response metadata.
example
Did you find what you were looking for?