Add Discount to Checkout

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 To prevent lost updates due to concurrent requests overriding changes made by others, it is recommended to enable optimistic concurrency control by including the `version` field in the request payload. If the provided version does not match the version on the server, a conflict error will be returned, which the client can handle accordingly.

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-accounts#api-accounts). | ### Further reading For example requests and more information about authenticating BigCommerce APIs, see [Authentication and Example Requests](/developer/docs/overview/api-accounts#x-auth-token-header-example-requests). For more about BigCommerce OAuth scopes, see our [Guide to API Accounts](/developer/docs/overview/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.

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

Response

dataobject
metaobject
Response metadata.

Errors

409
Conflict Error