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
      • Carts
      • Checkouts
          • GETGet Checkout
          • PUTUpdate Customer Messages
            • PUTUpdate Line Item
            • DELDelete Line Item
      • Consent
      • Customers
      • Subscriptions
      • Form Fields
      • Orders
      • Pickup Options
  • GraphQL
    • Overview
  • MCP
    • Overview
Dev Portal
LogoLogo
RESTStorefrontCheckoutsCart Items

Update Line Item

PUT
https://your_store.example.com/api/storefront/checkouts/:checkoutId/carts/:cartId/items/:itemId
PUT
/api/storefront/checkouts/:checkoutId/carts/:cartId/items/:itemId
$curl -X PUT https://your_store.example.com/api/storefront/checkouts/checkoutId/carts/cartId/items/itemId \
> -H "Accept: application/json" \
> -H "Content-Type: application/json" \
> -d '{}'
200Response
1{
2 "value": {
3 "billingAddress": {
4 "address1": "123 Main Street",
5 "address2": "",
6 "city": "Austin",
7 "company": "",
8 "country": "United States",
9 "countryCode": "US",
10 "customFields": [
11 {
12 "fieldId": "field_25",
13 "fieldValue": "Leave in backyard"
14 }
15 ],
16 "email": "janedoe@example.com",
17 "firstName": "Jane",
18 "id": "5ba11e4a10fb5",
19 "lastName": "Doe",
20 "phone": "1234567890",
21 "postalCode": "78751",
22 "stateOrProvince": "Texas",
23 "stateOrProvinceCode": "TX"
24 },
25 "cart": {
26 "baseAmount": 119.93,
27 "cartAmount": 112.93,
28 "createdTime": "2018-09-18T15:48:26+00:00",
29 "coupons": [
30 {
31 "id": 1,
32 "code": "S2549JM0Y",
33 "displayName": "$5.00 off the order total",
34 "couponType": "per_total_discount",
35 "discountedAmount": 5
36 }
37 ],
38 "currency": {
39 "name": "US Dollars",
40 "code": "USD",
41 "symbol": "$",
42 "decimalPlaces": 2
43 },
44 "customerId": 11,
45 "discountAmount": 0,
46 "discounts": [
47 {
48 "id": 1,
49 "discountedAmount": 2.59
50 },
51 {
52 "id": 2,
53 "discountedAmount": 1.06
54 },
55 {
56 "id": 3,
57 "discountedAmount": 2.12
58 },
59 {
60 "id": 4,
61 "discountedAmount": 0.8
62 },
63 {
64 "id": 5,
65 "discountedAmount": 0.43
66 }
67 ],
68 "email": "janedoe@example.com",
69 "id": "b6fbd994-61a8-4f25-9167-6ec10489c448",
70 "isTaxIncluded": false,
71 "lineItems": {
72 "physicalItems": [
73 {
74 "addedByPromotion": false,
75 "brand": "OFS",
76 "categoryNames": [
77 "Essentials",
78 "Just arrived"
79 ],
80 "comparisonPrice": 0,
81 "couponAmount": 0,
82 "discountAmount": 2,
83 "discounts": [
84 {
85 "id": 1,
86 "discountedAmount": 0.59
87 },
88 {
89 "id": 2,
90 "discountedAmount": 2
91 }
92 ],
93 "extendedComparisonPrice": 0,
94 "extendedListPrice": 15.99,
95 "extendedSalePrice": 13.99,
96 "giftWrapping": {},
97 "id": "69791a88-85c9-4c19-8042-e537621e8a55",
98 "imageUrl": "https://cdn8.bigcommerce.com/s-id30h7ohwf/products/184/images/445/naturalcanvascart2_1024x1024__92347__29648.1534344533.330.500.jpg?c=2",
99 "isShippingRequired": true,
100 "isTaxable": true,
101 "listPrice": 15.99,
102 "name": "Canvas Laundry Cart",
103 "options": [
104 {
105 "name": "Color",
106 "nameId": 1,
107 "value": "Red",
108 "valueId": "2"
109 }
110 ],
111 "originalPrice": 17.99,
112 "productId": 184,
113 "parentId": "",
114 "quantity": 1,
115 "variantId": 364,
116 "salePrice": 13.99,
117 "sku": "SMA-RED",
118 "url": "https://{store_domain}/all/canvas-laundry-cart/"
119 },
120 {
121 "addedByPromotion": false,
122 "brand": "OFS",
123 "categoryNames": [
124 "Essentials",
125 "Just arrived"
126 ],
127 "comparisonPrice": 0,
128 "extendedComparisonPrice": 0,
129 "extendedListPrice": 25,
130 "extendedSalePrice": 25,
131 "couponAmount": 0,
132 "discountAmount": 0,
133 "discounts": [
134 {
135 "id": 1,
136 "discountedAmount": 1.06
137 }
138 ],
139 "id": "ba2c619d-e6b4-48c2-8809-d88e424ed450",
140 "imageUrl": "https://cdn8.bigcommerce.com/s-id30h7ohwf/products/170/images/411/measuringsquares2_1024x1024__07108__95421.1534344522.330.500.jpg?c=2",
141 "isShippingRequired": true,
142 "isTaxable": true,
143 "listPrice": 25,
144 "name": "Ceramic Measuring Spoons",
145 "originalPrice": 25,
146 "parentId": "",
147 "productId": 170,
148 "quantity": 1,
149 "salePrice": 25,
150 "sku": "",
151 "url": "https://{store_domain}/all/ceramic-measuring-spoons/",
152 "variantId": 341,
153 "options": [
154 {
155 "name": "Color",
156 "nameId": 1,
157 "value": "Red",
158 "valueId": "2"
159 }
160 ],
161 "giftWrapping": {}
162 },
163 {
164 "addedByPromotion": false,
165 "brand": "OFS",
166 "categoryNames": [
167 "Essentials",
168 "Just arrived"
169 ],
170 "comparisonPrice": 0,
171 "couponAmount": 0,
172 "discountAmount": 0,
173 "discounts": [
174 {
175 "id": 1,
176 "discountedAmount": 2.12
177 }
178 ],
179 "extendedComparisonPrice": 0,
180 "extendedListPrice": 49.99,
181 "extendedSalePrice": 49.99,
182 "giftWrapping": {},
183 "id": "c72d6651-978d-45e5-881b-c2bb5f7ff1d5",
184 "imageUrl": "https://cdn8.bigcommerce.com/s-id30h7ohwf/products/158/images/382/foglinenbeigestripetowel1b_1024x1024__83011__60806.1534344511.330.500.jpg?c=2",
185 "isShippingRequired": true,
186 "isTaxable": true,
187 "listPrice": 49.99,
188 "name": "Chambray Towel",
189 "options": [
190 {
191 "name": "Color",
192 "nameId": 1,
193 "value": "Red",
194 "valueId": "2"
195 }
196 ],
197 "originalPrice": 49.99,
198 "parentId": "",
199 "productId": 158,
200 "salePrice": 49.99,
201 "sku": "SKU-A0C8A203",
202 "quantity": 1,
203 "url": "https://{store_domain}/all/chambray-towel/",
204 "variantId": 376
205 }
206 ],
207 "digitalItems": [
208 {
209 "addedByPromotion": false,
210 "brand": "OFS",
211 "categoryNames": [
212 "Essentials",
213 "Just arrived"
214 ],
215 "comparisonPrice": 0,
216 "couponAmount": 0,
217 "discountAmount": 0,
218 "discounts": [
219 {
220 "id": 1,
221 "discountedAmount": 0.8
222 }
223 ],
224 "extendedComparisonPrice": 0,
225 "extendedListPrice": 18.95,
226 "extendedSalePrice": 18.95,
227 "id": "6477a4a1-02cf-4287-8bf2-fd043bdd5234",
228 "imageUrl": "https://cdn8.bigcommerce.com/s-id30h7ohwf/products/189/images/465/gather_1024x1024__17195__82620.1534344540.330.500.jpg?c=2",
229 "isShippingRequired": false,
230 "isTaxable": true,
231 "listPrice": 18.95,
232 "name": "Gather Journal Issue 7 - Digital",
233 "options": [
234 {
235 "name": "Color",
236 "nameId": 1,
237 "value": "Red",
238 "valueId": "2"
239 }
240 ],
241 "originalPrice": 18.95,
242 "parentId": "",
243 "productId": 189,
244 "quantity": 1,
245 "salePrice": 18.95,
246 "type": "digital",
247 "variantId": 360,
248 "url": "https://{store_domain}/all/gather-journal-issue-7/"
249 }
250 ],
251 "giftCertificates": [
252 {
253 "amount": 10,
254 "id": "871f1f56-4c88-43c3-a6e5-0a647d83d6ac",
255 "message": "Thank you!",
256 "name": "$10.00 Gift Certificate",
257 "recipient": {
258 "name": "John Doe",
259 "email": "johndoe@example.com"
260 },
261 "sender": {
262 "name": "Jane Doe",
263 "email": "janedoe@example.com"
264 },
265 "taxable": false,
266 "theme": "Celebration",
267 "type": "giftCertificate"
268 }
269 ],
270 "customItems": []
271 },
272 "locale": "en",
273 "updatedTime": "2018-09-18T16:59:45+00:00",
274 "version": 1
275 },
276 "channelId": 1,
277 "createdTime": "2018-09-18T15:48:26+00:00",
278 "consignments": [
279 {
280 "address": {
281 "address1": "123 Main Street",
282 "address2": "",
283 "city": "Austin",
284 "company": "",
285 "country": "United States",
286 "countryCode": "US",
287 "customFields": [
288 {
289 "fieldId": "field_25",
290 "fieldValue": "Leave in backyard"
291 }
292 ],
293 "email": "janedoe@example.com",
294 "firstName": "Jane",
295 "lastName": "Doe",
296 "phone": "1234567890",
297 "postalCode": "78751",
298 "stateOrProvince": "Texas",
299 "stateOrProvinceCode": "TX"
300 },
301 "availableShippingOptions": [
302 {
303 "additionalDescription": "Fragile items",
304 "cost": 8,
305 "description": "Ship by Weight",
306 "id": "d09e05c0-3788-44df-a1bb-b6d3afdf6841",
307 "imageUrl": "",
308 "transitTime": "",
309 "type": "shipping_byweight"
310 }
311 ],
312 "couponDiscounts": [],
313 "discounts": [],
314 "handlingCost": 0,
315 "id": "5ba121929619b",
316 "lineItemIds": [
317 "69791a88-85c9-4c19-8042-e537621e8a55",
318 "ba2c619d-e6b4-48c2-8809-d88e424ed450",
319 "c72d6651-978d-45e5-881b-c2bb5f7ff1d5"
320 ],
321 "selectedShippingOption": {
322 "additionalDescription": "Fragile items",
323 "id": "bb3c818f-17ce-46fe-9475-65933095da0d",
324 "type": "shipping_upsready",
325 "description": "UPS® (UPS Next Day Air®)",
326 "imageUrl": "",
327 "cost": 69.94,
328 "transitTime": "1 business day"
329 },
330 "shippingCost": 69.94,
331 "shippingCostBeforeDiscount": 69.94,
332 "comparisonShippingCost": 64.94
333 }
334 ],
335 "coupons": [
336 {
337 "code": "S2549JM0Y",
338 "couponType": 2,
339 "discountedAmount": 5,
340 "displayName": "$5.00 off the order total",
341 "id": 1
342 }
343 ],
344 "fees": [
345 {
346 "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
347 "type": "custom_fee",
348 "name": "AAINS",
349 "displayName": "Package Protection Insurance",
350 "cost": 12.02,
351 "source": "AA",
352 "taxClassId": 12
353 }
354 ],
355 "customer": {
356 "addresses": [
357 {}
358 ],
359 "customerGroup": {
360 "id": 1,
361 "name": "Wholesale customers"
362 },
363 "email": "string",
364 "firstName": "string",
365 "fullName": "string",
366 "id": 1,
367 "isGuest": false,
368 "lastName": "string",
369 "shouldEncourageSignIn": false,
370 "storeCredit": 1
371 },
372 "customerMessage": "Thank you, BigCommerce",
373 "giftCertificates": [
374 {
375 "balance": 4,
376 "code": "1234ABC",
377 "purchaseDate": "string",
378 "remaining": 2,
379 "used": 5
380 }
381 ],
382 "giftWrappingCostTotal": 0,
383 "grandTotal": 211.49,
384 "handlingCostTotal": 0,
385 "id": "b6fbd994-61a8-4f25-9167-6ec10489c448",
386 "isStoreCreditApplied": false,
387 "orderId": null,
388 "outstandingBalance": 0,
389 "payments": [
390 {}
391 ],
392 "promotions": [],
393 "shippingCostBeforeDiscount": 69.94,
394 "comparisonShippingCost": 64.94,
395 "shippingCostTotal": 69.94,
396 "shouldExecuteSpamCheck": false,
397 "subtotal": 117.93,
398 "taxTotal": 28.62,
399 "taxes": [
400 {
401 "name": "Store Tax",
402 "amount": 28.62
403 }
404 ],
405 "updatedTime": "2018-09-18T16:59:45+00:00",
406 "version": 1
407 }
408}
Updates a *Checkout Line Item*. Updates an existing, single line item in the cart. 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](/developer/api-reference/rest/storefront/carts/cart-items/add-cart-line-item) endpoint or the [GraphQL Storefront API](/developer/docs/storefront/guides/graphql-storefront-api/overview). > #### Notes > * Substitute your storefront domain for `yourstore.example.com`. > * The Send a Test Request feature is not currently supported for this endpoint. > * Please note that this API endpoint is not concurrent safe, meaning multiple simultaneous requests could result in unexpected and inconsistent results. > * This endpoint requires using Stencil CLI, a local session, and a CSRF token to work.
Was this page helpful?
Previous

Update Checkout Billing Address

Next

Delete Line Item

Built with

Updates a Checkout Line Item. Updates an existing, single line item in the cart.

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 or the GraphQL Storefront API.

Notes

  • Substitute your storefront domain for yourstore.example.com.
  • The Send a Test Request feature is not currently supported for this endpoint.
  • Please note that this API endpoint is not concurrent safe, meaning multiple simultaneous requests could result in unexpected and inconsistent results.
  • This endpoint requires using Stencil CLI, a local session, and a CSRF token to work.

Path parameters

checkoutIdstringRequiredformat: "uuid"
The ID of the subject checkout. Identical to the cart ID.
cartIdstringRequiredformat: "uuid"
The ID of the cart associated with this checkout. Identical to the checkout ID.
itemIdstringRequired
The ID of an item being purchased.

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.

Request

This endpoint expects an object.
lineItemobjectOptional
giftCertificateobjectOptional

Response

billingAddressobject
cartobject

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

channelIdinteger
Channel ID.
consignmentslist of objects
couponslist of objects
Coupons applied at the checkout level.
feeslist of objects
Fees applied at the checkout level.
createdTimestring
Time when the cart was created.
customerobject
Customer details.
customerMessagestring

Shopperʼs message provided as details for the order to be created from this cart

giftCertificateslist of objects

Applied gift certificate (as a payment method).

giftWrappingCostTotaldouble
Gift wrapping cost for all items, including or excluding tax.
grandTotaldouble
The total payable amount, before applying any store credit or gift certificate.
handlingCostTotaldouble
Handling cost for all consignments including or excluding tax.
idstringformat: "uuid"
isStoreCreditAppliedboolean

true value indicates StoreCredit has been applied.

orderIdstring or null
outstandingBalancedouble

grandTotal subtract the store-credit amount

paymentslist of objects
promotionslist of objects
shippingCostBeforeDiscountdouble
Total shipping cost for the checkout before discounts are applied.
comparisonShippingCostdouble
Total shipping cost for the checkout after automatic promotions are applied.
shippingCostTotaldouble
Shipping cost before any discounts are applied.
shouldExecuteSpamCheckboolean
subtotaldouble

Subtotal of the checkout before applying item-level discounts. Tax inclusive based on the store settings.

taxeslist of objects
taxTotaldouble
updatedTimestring
Time when the cart was last updated.
versioninteger
The current version of the checkout increments with each successful update. You can use it to enable optimistic concurrency control for subsequent updates.

The MIME type of the response body.