Add Discount to Checkout

Adds or replaces manual discounts on an existing checkout. Each request sets the checkout's complete manual-discount state. The request is not additive: manual discounts from an earlier request that you omit from the new payload are removed. This endpoint does not remove coupons or automatic promotions. Use the request body to apply: * An order-level manual discount with `cart.discounts[].discounted_amount`. BigCommerce distributes the discount across line items based on each item's value. * An item-level manual discount with `cart.line_items[].id` and `cart.line_items[].discounted_amount`. * Order-level and item-level manual discounts together by including both arrays in the same request. Manual discounts interact with coupons and automatic promotions as follows: | Manual discount level | Coupon or automatic promotion level | Behavior | | --- | --- | --- | | Order | Order or item | The discounts stack. The result is fully additive and does not depend on which discount is applied first. | | Item | Order or item | The discounts are mutually exclusive, and the first-applied discount remains. A conflicting manual-discount request is rejected, a coupon request returns a `422` response, and an automatic promotion does not apply. | If an item-level manual discount is already applied, adding a coupon returns a `422` response with the message "Coupon `{coupon_code}` cannot be applied in combination with item level manual discount." An eligible automatic promotion does not apply while an item-level manual discount exists. The required field is `discounted_amount` at the order level, item level, or both. To prevent lost updates from concurrent requests, include the optional `version` field in the request payload. If the provided version does not match the server's cart version, the API returns a conflict error.

Authentication

X-Auth-Tokenstring
### OAuth scopes | UI Name | Permission | Parameter | |:--------|:-----------|:----------| | Checkouts | modify | `store_checkouts` | | Checkouts | read-only | `store_checkouts_read_only` | | Checkout Content | modify | `store_checkout_content` | | Checkout Content | read-only | `store_checkout_content_read_only` | ### Authentication header | Header | Argument | Description | |:-------|:---------|:------------| | `X-Auth-Token` | `access_token` | For more about API accounts that generate `access_token`s, see our [Guide to API Accounts](/developer/docs/overview/api-fundamentals/api-accounts#api-accounts). | ### Further reading For example requests and more information about authenticating BigCommerce APIs, see [Authentication and Example Requests](/developer/docs/overview/api-fundamentals/api-accounts#x-auth-token-header-example-requests). For more about BigCommerce OAuth scopes, see our [Guide to API Accounts](/developer/docs/overview/api-fundamentals/api-accounts#oauth-scopes). For a list of API status codes, see [API Status Codes](/developer/api-reference/rest/overview#rest-http-status-codes).

Path parameters

checkoutIdstringRequired

ID of the checkout; the same as the cart ID.

store_hashstringRequired
Permanent ID of the BigCommerce store.

Headers

AcceptstringRequiredDefaults to application/json
The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the response body.

Request

This endpoint expects an object.
cartobjectOptional

The complete manual-discount state to apply to the checkout.

Response

dataobjectOptional
metaobjectOptional
Response metadata.

Errors

409
Conflict Error