For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Dev Portal
DocsAPI ReferenceLearnCommunityChangelog
DocsAPI ReferenceLearnCommunityChangelog
    • About Our APIs
  • REST
    • Overview
      • Overview
        • Abandoned Carts
        • Carts
        • Channels
        • Checkouts
            • GETGet Checkout
            • PUTUpdate Customer Messages
              • POSTAdd Discount to Checkout
        • Currencies
        • Customer Segmentation
        • Geography
        • Infrastructure Hosting
        • Inventory
        • Orders
        • Order Operations
        • Pickup
        • Pickup Methods
        • Pickup Options
        • Pricing
        • Price Lists
        • Promotions
        • Promotion Settings
        • Redirects
        • Scripts
        • Settings
        • Shipping
        • Sites
        • Subscribers
        • System Logs
        • Tax
        • Wishlists
      • Payments
  • GraphQL
    • Overview
  • MCP
    • Overview
Dev Portal
LogoLogo
RESTAdminManagementCheckoutsDiscounts

Add Discount to Checkout

POST
https://api.bigcommerce.com/stores/:store_hash/v3/checkouts/:checkoutId/discounts
POST
/stores/:store_hash/v3/checkouts/:checkoutId/discounts
$curl -X POST https://api.bigcommerce.com/stores/store_hash/v3/checkouts/checkoutId/discounts \
> -H "Accept: application/json" \
> -H "X-Auth-Token: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{
> "cart": {
> "discounts": [
> {
> "discounted_amount": 10
> }
> ]
> },
> "version": 1
>}'
1{
2 "data": {
3 "id": "306d57d7-124e-4112-82cd-35e060c0d4d9",
4 "cart": {
5 "id": "306d57d7-124e-4112-82cd-35e060c0d4d9",
6 "customer_id": 11,
7 "email": "janedoe@example.com",
8 "currency": {
9 "code": "USD"
10 },
11 "tax_included": false,
12 "base_amount": 31.95,
13 "channel_id": 1,
14 "discount_amount": 0,
15 "cart_amount_inc_tax": 33.23,
16 "cart_amount_ex_tax": 31.95,
17 "coupons": [],
18 "discounts": [
19 {
20 "id": "8edef915-8e8e-4ebd-bece-31fbb1191a7e",
21 "discounted_amount": 13.6
22 }
23 ],
24 "line_items": {
25 "physical_items": [
26 {
27 "quantity": 1,
28 "id": "8edef915-8e8e-4ebd-bece-31fbb1191a7e",
29 "variant_id": 359,
30 "product_id": 188,
31 "sku": "DUST1",
32 "name": "Hello",
33 "url": "https://{store_hash}/all/dustpan-brush/",
34 "is_taxable": true,
35 "image_url": "https://cdn11.bigcommerce.com/s-{store_hash}/products/188/images/460/dustpan1_1024x1024_1024x1024__43447__69128.1534344539.330.500.jpg?c=2",
36 "discounts": [
37 {
38 "id": 18,
39 "discounted_amount": 13.6
40 },
41 {
42 "id": 49,
43 "discounted_amount": 2.4
44 },
45 {
46 "id": "manual-discount",
47 "discounted_amount": 10
48 }
49 ],
50 "discount_amount": 0,
51 "coupon_amount": 0,
52 "original_price": 35.95,
53 "list_price": 31.95,
54 "sale_price": 33.23,
55 "extended_list_price": 31.95,
56 "extended_sale_price": 33.23,
57 "comparison_price": 33.23,
58 "extended_comparison_price": 33.23,
59 "is_require_shipping": true,
60 "is_mutable": true,
61 "parent_id": 123,
62 "gift_wrapping": {},
63 "coupons": []
64 }
65 ],
66 "digital_items": [],
67 "gift_certificates": [],
68 "custom_items": []
69 },
70 "created_time": "2019-08-05T15:38:14+00:00",
71 "updated_time": "2019-08-05T15:41:28+00:00",
72 "manual_discount_amount": 10
73 },
74 "billing_address": {},
75 "consignments": [],
76 "taxes": [
77 {
78 "name": "Tax",
79 "amount": 1.28
80 }
81 ],
82 "coupons": [],
83 "fees": [],
84 "order_id": null,
85 "shipping_cost_total_inc_tax": 0,
86 "shipping_cost_total_ex_tax": 0,
87 "handling_cost_total_inc_tax": 0,
88 "handling_cost_total_ex_tax": 0,
89 "tax_total": 1.28,
90 "subtotal_inc_tax": 33.23,
91 "subtotal_ex_tax": 31.95,
92 "grand_total": 33.23,
93 "created_time": "2019-08-05T15:38:14+00:00",
94 "updated_time": "2019-08-05T15:41:28+00:00",
95 "customer_message": "",
96 "staff_note": " "
97 },
98 "meta": {}
99}
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.
Was this page helpful?
Previous

Delete Checkout Coupon

Next

Add Order Level Fees to Checkout

Built with

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-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 of the response body.

Request

This endpoint expects an object.
cartobjectOptional

Response

dataobject
metaobject
Response metadata.

Errors

409
Conflict Error

OAuth scopes

UI NamePermissionParameter
Checkoutsmodifystore_checkouts
Checkoutsread-onlystore_checkouts_read_only
Checkout Contentmodifystore_checkout_content
Checkout Contentread-onlystore_checkout_content_read_only

Authentication header

HeaderArgumentDescription
X-Auth-Tokenaccess_tokenFor more about API accounts that generate access_tokens, see our Guide to API Accounts.

Further reading

For example requests and more information about authenticating BigCommerce APIs, see Authentication and Example Requests.

For more about BigCommerce OAuth scopes, see our Guide to API Accounts.

For a list of API status codes, see API Status Codes.