Skip to navigation

Delete Cart Line Item

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 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.

Path parameters

cartIdstringRequiredformat: "UUID"
The identifier of a specific cart.
itemIdstringRequiredformat: "number"
The ID of the line item.
store_hashstringRequired
Permanent ID of the BigCommerce store.

Headers

AcceptstringRequiredDefaults to application/json

The MIME type 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.
  • line_items.physical_items.stock_position: Returns backorder and stock availability details for physical items.
  • line_items.digital_items.stock_position: Returns backorder and stock availability details for digital items. Since digital products cannot be backordered, backorder values are always zero.
  • promotions.banners: Returns a list of eligible banners.

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.

idstringOptionalformat: "UUID"
Cart ID, provided after creating a cart with a POST request.
customer_idintegerOptional
ID of the customer to which the cart belongs.
channel_idintegerOptional
The channel ID. If no channel is specified, defaults to 1.
emailstringOptional

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

currencyobjectOptional
The currency. This is the same for both the cart and its subsequent checkout.
tax_includedbooleanOptional
base_amountdoubleOptional

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

discount_amountdoubleOptional

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

manual_discount_amountdoubleOptional
The entered value represents the order level manual discount.
cart_amountdoubleOptional

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

couponslist of objectsOptional
discountslist of objectsOptional
line_itemsobjectOptional

GET

created_timestringOptionalformat: "ISO-8601"
Time when the cart was created.
updated_timestringOptionalformat: "ISO-8601"
Time when the cart was last updated.
localestringOptionalformat: "ISO-639"

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

promotionsobjectOptional

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

versionintegerOptional
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