Skip to navigation

Update Cart Line Item

Updates an existing, single line item in the Cart.

Notes

Currently, only updating list_price and quantity are supported. By default, overriding a product’s list_price makes it ineligible for V3 product-level promotions. In Store Settings under Promotions and Coupons in the control panel, you can change this behavior to allow promotions on overridden prices.

If the product has modifiers, omit the variant_id and instead use the option_selections array to describe both the variant and the modifier selections.

If a variant needs to be changed or updated, the product will need to be removed and re-added to the cart with the correct variants using the Add Cart Line Items endpoint.

custom_items cannot be updated via the API at this time. To update your cart, add a new updated custom item and delete the outdated one. If your cart contains only one line item, perform the add operation before the delete operation.

Deleting all line items from the cart will invalidate 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.
line_itemobjectOptional
gift_certificateslist of objectsOptional
custom_itemslist of objectsOptional
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

The requested cart.
dataobjectOptional

A cart contains a collection of items, prices, discounts, etc. It does not contain customer-related data.

metaobjectOptional
Response metadata.

Errors

409
Conflict Error