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
              • POSTAdd Cart Line Items
              • PUTUpdate Cart Line Item
              • DELDelete Cart Line Item
        • Channels
        • Checkouts
        • 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
RESTAdminManagementCartsItems

Delete Cart Line Item

DELETE
https://api.bigcommerce.com/stores/:store_hash/v3/carts/:cartId/items/:itemId
DELETE
/stores/:store_hash/v3/carts/:cartId/items/:itemId
$curl -X DELETE https://api.bigcommerce.com/stores/store_hash/v3/carts/cartId/items/itemId \
> -H "Accept: application/json" \
> -H "X-Auth-Token: <apiKey>" \
> -H "Content-Type: application/json" \
> -d '{}'
1{
2 "data": {
3 "id": "bc218c65-7a32-4ab7-8082-68730c074d02",
4 "customer_id": 11,
5 "email": "",
6 "currency": {
7 "code": "USD"
8 },
9 "tax_included": false,
10 "base_amount": 189.75,
11 "discount_amount": 0,
12 "cart_amount": 212.81,
13 "coupons": [],
14 "line_items": {
15 "physical_items": [
16 {
17 "id": "6e193ce6-f327-4dcc-b75e-72cf6738525e",
18 "parent_id": {},
19 "variant_id": 362,
20 "product_id": 191,
21 "sku": "",
22 "name": "Openhouse No. 3",
23 "url": "http://id30h7ohwf.mybigcommerce.com/all/openhouse-no-3/",
24 "quantity": 5,
25 "taxable": true,
26 "image_url": "https://cdn8.bigcommerce.com/s-id30h7ohwf/products/191/images/475/openhousevol3_1024x1024__59692__16355.1534344544.330.500.jpg?c=2",
27 "discounts": [],
28 "coupons": [],
29 "discount_amount": 0,
30 "coupon_amount": 0,
31 "original_price": 27.95,
32 "list_price": 27.95,
33 "sale_price": 27.95,
34 "extended_list_price": 139.75,
35 "extended_sale_price": 139.75,
36 "is_require_shipping": true,
37 "options": [
38 {
39 "name": "Add a $5 Donation",
40 "nameId": 82,
41 "value": "No",
42 "valueId": 186
43 }
44 ]
45 }
46 ],
47 "digital_items": [],
48 "custom_items": [
49 {
50 "extended_list_price": 5.99,
51 "id": "78239b69-1952-4c35-9d58-ea30158b4e39",
52 "list_price": 5.99,
53 "name": "Rope Toy",
54 "quantity": 1,
55 "sku": "ROPE-TOY"
56 }
57 ],
58 "gift_certificates": [
59 {
60 "id": "6e38bbc2-8873-472c-a452-8bd4aaea5d3a",
61 "name": "Happy Birthday",
62 "theme": "Birthday",
63 "amount": 50,
64 "quantity": 1,
65 "taxable": false,
66 "sender": {
67 "name": "Jane Does",
68 "email": "janedoe@example.com"
69 },
70 "recipient": {
71 "name": "Jane Does",
72 "email": "janedoe@example.com"
73 },
74 "message": "Happy Birthday Jane!"
75 }
76 ]
77 },
78 "created_time": "2018-09-17T14:27:39.000Z",
79 "updated_time": "2018-09-17T14:53:40.000Z",
80 "meta": {}
81 }
82}
Deletes a *Cart* line item. **Notes** Removing the last `line_item` in the *Cart* deletes the *Cart*. 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

Update Cart Line Item

Next

List Cart Metafields

Built with

Deletes a Cart line item.

Notes

Removing the last line_item in the Cart deletes the Cart.

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 | |:--------|:-----------|:----------| |Carts|modify|`store_cart`| |Carts |read-only|`store_cart_read_only`| |Information & Settings | modify | `store_v2_information`| |Information & Settings | read-only| `store_v2_information`| ### 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

cartIdstringRequiredformat: "UUID"
The identifier of a specific cart.
itemIdstringRequiredformat: "number"
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.

Query parameters

includelist of enumsOptional
* `redirect_urls`: Create a direct link to a cart. This can be used for the /POST request for carts. * `line_items.physical_items.options`: The cart returns an abbreviated result. Use this to return physical items product options. To return the extended cart object, use in a /POST request. * `line_items.digital_items.options`: The cart returns an abbreviated result. Use this to return digital items product options. To return the extended cart object, use in a /POST request. * `promotions.banners`: Returns a list of eligible banners.
Allowed values:

Request

This endpoint expects an object.
versionintegerOptional

The cart version that you expect to apply the updates. If the provided version doesn’t match the current cart version, you will receive a conflict error. This field is optional; if not provided, optimistic concurrency control will not apply.

Response

NOTE: Discounted line items are re-evaluated on cart actions and may be automatically added back to your cart with a new line item ID to satisfy promotional requirements.

idstringformat: "UUID"
Cart ID, provided after creating a cart with a POST request.
customer_idinteger
ID of the customer to which the cart belongs.
channel_idinteger
The channel ID. If no channel is specified, defaults to 1.
emailstring

The cart’s email. This is the same email that is used in the billing address.

currencyobject
The currency. This is the same for both the cart and its subsequent checkout.
tax_includedboolean
base_amountdouble

Sum of cart line-item amounts before cart-level discounts, coupons, or taxes.

discount_amountdouble

Order-based discounted amount only - Excludes coupon discounts and product-based discounts.

manual_discount_amountdouble
The entered value represents the order level manual discount.
cart_amountdouble

Sum of cart line-item amounts minus cart-level discounts and coupons. This amount includes taxes (where applicable).

couponslist of objects
discountslist of objects
line_itemsobject

GET

created_timestringformat: "ISO-8601"
Time when the cart was created.
updated_timestringformat: "ISO-8601"
Time when the cart was last updated.
localestringformat: "ISO-639"

Locale of the cart. Accepts strings of format xx or xx-YY. Uses the ISO-639 standard format.

promotionsobject

This is available only when “include=promotions.banners” is presented in the URL.

versioninteger
The current version of the cart increments with each successful update. You can use it to enable optimistic concurrency control for subsequent updates.

Errors

409
Conflict Error

OAuth scopes

UI NamePermissionParameter
Cartsmodifystore_cart
Cartsread-onlystore_cart_read_only
Information & Settingsmodifystore_v2_information
Information & Settingsread-onlystore_v2_information

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.

The MIME type of the response body.

  • redirect_urls: Create a direct link to a cart. This can be used for the /POST request for carts.
  • line_items.physical_items.options: The cart returns an abbreviated result. Use this to return physical items product options. To return the extended cart object, use in a /POST request.
  • line_items.digital_items.options: The cart returns an abbreviated result. Use this to return digital items product options. To return the extended cart object, use in a /POST request.
  • promotions.banners: Returns a list of eligible banners.