Update Cart Line Item
Updates an existing, single line item in the Cart.
Notes
Send one of line_item, custom_item, or gift_certificate in the request body, matching the type of the line item you’re updating. Use line_item for physical and digital products.
A line_item update requires quantity and either product_id or variant_id. You can also update the following fields:
list_price: Overrides the item’s price. By default, overriding a product’slist_pricemakes 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.name: Overrides the item’s name.weightanddimensions: Override the item’s shipping weight and dimensions.product_options: Changes the item’s variant and modifier selections. Sendproduct_idwith it; a request with onlyvariant_idreturns a422error. The line item keeps its ID. Sending a differentvariant_id, or sendingoption_selections, doesn’t change the item’s options.gift_wrapping: Adds or replaces the item’s gift wrapping. Set it tonullto remove gift wrapping.
A custom_item update requires sku, name, quantity, and list_price. A gift_certificate update requires name, theme, amount, quantity, sender, and recipient.
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
OAuth scopes
Authentication header
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
Headers
The MIME type of the response body.
Query parameters
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
Updates a physical or digital product line item. Send product_id, variant_id, or both.
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
A cart contains a collection of items, prices, discounts, etc. It does not contain customer-related data.