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 a product has modifiers, omit the variant_id and instead use the option_selections array to describe both the variant and the modifier selections.
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-Token in header
Parameters
store_hash in path - string
cartId in path - string
required
The identifier of a specific cart.
Accept in header with default of application/json - string
Content-Type in header with default of application/json - string
required
include in query - array
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.
Optionally, provide a value to override the product name.
gift_wrappingobject
gift_certificatesarray[object]
custom_itemsarray[object]
versioninteger
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.
Example: 1
Example 1
JSONcURLNode.jsPHPJava
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
›
⌄
⌄
⌄
⌄
⌄
⌄
⌄
⌄
⌄
{
"line_items": [
{
"quantity": 2,
"product_id": 77,
"list_price": 12.5,
"option_selections": [
{
"option_id": 8,
"option_value": "Yes"
}
]
}
],
"gift_certificates": [
{
"name": "Happy Birthday",
"theme": "birthday.html",
"amount": 50,
"quantity": 1,
"sender": {
"name": "Jane Does",
"email": "janedoe@example.com"
},
"recipient": {
"name": "Jane Does",
"email": "janedoe@example.com"
},
"message": "Happy Birthday Jane!"
Example 2: Custom Item
JSONcURLNode.jsPHPJava
99
1
2
3
4
5
6
7
8
9
10
›
⌄
⌄
⌄
{
"custom_items": [
{
"sku": "abc-123",
"name": "Custom Product",
"quantity": 1,
"list_price": 10
}
]
}
Response
201
Body
object | application/json
dataobject
A cart contains a collection of items, prices, discounts, etc. It does not contain customer-related data.
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-Token in headerAuthentication details
Parameters
store_hash in path - string
Accept in header with default of application/json - string
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.
Content-Type in header with default of application/json - string
required
Body
object | application/json
line_item
One of:Item with variantItem with modifier
quantitynumber
product_idnumber
list_pricenumber
Optional price override.
variant_idnumber
Variant ID. Exists only in Catalog V3.
namestring
Optionally, provide a value to override the product name.
gift_wrappingobject
gift_certificatesarray[object]
custom_itemsarray[object]
versioninteger
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.
Example: 1
example
JSONcURLNode.jsPHPJava
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
›
⌄
⌄
⌄
⌄
⌄
⌄
⌄
⌄
⌄
{
"line_item": {
"quantity": 0,
"product_id": 0,
"list_price": 0,
"variant_id": 0,
"name": "string",
"gift_wrapping": {
"wrap_together": true,
"wrap_details": [
{
"id": 0,
"message": "Happy Birthday"
}
]
}
},
"gift_certificates": [
{
"name": "string",
"theme": "birthday.html",
"amount": 1,
"quantity": 1,
"sender": {
"name": "string",
"email": "string"
},
"recipient": {
"name": "string",
"email": "string"
Response
200409
Body
object | application/json
dataobject
A cart contains a collection of items, prices, discounts, etc. It does not contain customer-related data.
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-Token in headerAuthentication details
Parameters
store_hash in path - string
Accept in header with default of application/json - string
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.
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.
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.
Body
object | application/json
A cart contains a collection of items, prices, discounts, etc. It does not contain customer-related data.
idstring
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_amountnumber
Sum of cart line-item amounts before cart-level discounts, coupons, or taxes.
discount_amountnumber
Order-based discounted amount only - Excludes coupon discounts and product-based discounts.
manual_discount_amountnumber
The entered value represents the order level manual discount.
cart_amountnumber
Sum of cart line-item amounts minus cart-level discounts and coupons. This amount includes taxes (where applicable).
couponsarray[object]
discountsarray[object]
line_itemsobject
GET
created_timestring
Time when the cart was created.
updated_timestring
Time when the cart was last updated.
localestring
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.