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
  • GraphQL
    • Overview
      • Playground
      • Explorer
          • MUTcreateCart
          • MUTdeleteCart
          • MUTaddCartLineItems
          • MUTupdateCartLineItem
          • MUTdeleteCartLineItem
          • MUTupdateCartCurrency
          • MUTassignCartToCustomer
          • MUTunassignCartFromCustomer
          • MUTcreateCartMetafield
          • MUTupdateCartMetafield
          • MUTdeleteCartMetafield
          • MUTcreateCartRedirectUrls
          • MUTcreateCheckout
          • MUTupdateCheckout
          • MUTaddCheckoutBillingAddress
          • MUTupdateCheckoutBillingAddress
          • MUTupdateCheckoutCustomerMessage
          • MUTselectCheckoutShippingOption
          • MUTapplyCheckoutCoupon
          • MUTunapplyCheckoutCoupon
          • MUTapplyCheckoutGiftCertificate
          • MUTunapplyCheckoutGiftCertificate
          • MUTapplyCheckoutSpamProtection
          • MUTaddCheckoutShippingConsignments
          • MUTupdateCheckoutShippingConsignment
          • MUTdeleteCheckoutConsignment
          • MUTcompleteCheckout
          • MUTlogin
          • MUTlogout
          • MUTcreateWishlist
          • MUTaddWishlistItems
          • MUTdeleteWishlistItems
          • MUTupdateWishlist
          • MUTdeleteWishlists
          • MUTloginWithCustomerLoginJwt
          • MUTsubmitContactUs
          • MUTgenerateSessionSyncJwt
          • MUTvalidateSessionSyncJwt
          • MUTproductViewedEvent
          • MUTpageViewedEvent
          • MUTvisitStartedEvent
          • MUTsearchProductEvent
          • MUTpreviewGiftCertificate
          • MUTregisterCompany
          • MUTaddProductReview
          • MUTchangePassword
          • MUTrequestResetPassword
          • MUTresetPassword
          • MUTregisterCustomer
          • MUTupdateCustomer
          • MUTaddCustomerAddress
          • MUTupdateCustomerAddress
          • MUTdeleteCustomerAddress
          • MUTpayment
          • MUTsubscribe
          • MUTunsubscribe
  • MCP
    • Overview
Dev Portal
LogoLogo
GraphQLStorefrontMutations

updateCartLineItem

Example Query
1mutation ExampleMutation($input: UpdateCartLineItemInput) {
2 updateCartLineItem(input: $input) {
3 cart {
4 id
5 entityId
6 currencyCode
7 displayCurrencyCode
8 isTaxIncluded
9 baseAmount
10 baseAmountInDisplayCurrency
11 discountedAmount
12 discountedAmountInDisplayCurrency
13 amount
14 }
15 }
16}
Variables
1{
2 "input": {
3 "cartEntityId": "example",
4 "lineItemEntityId": "example",
5 "data": {
6 "lineItem": {
7 "quantity": 0,
8 "productEntityId": 0,
9 "variantEntityId": 0,
10 "sku": "example",
11 "selectedOptions": {
12 "checkboxes": [
13 {
14 "optionEntityId": null,
15 "optionValueEntityId": null
16 }
17 ],
18 "dateFields": [
19 {
20 "optionEntityId": null,
21 "date": null
22 }
23 ],
24 "multiLineTextFields": [
25 {
26 "optionEntityId": null,
27 "text": null
28 }
29 ],
30 "multipleChoices": [
31 {
32 "optionEntityId": null,
33 "optionValueEntityId": null
34 }
35 ],
36 "numberFields": [
37 {
38 "optionEntityId": null,
39 "number": null
40 }
41 ],
42 "textFields": [
43 {
44 "optionEntityId": null,
45 "text": null
46 }
47 ]
48 }
49 },
50 "giftCertificate": {
51 "name": "example",
52 "theme": "BIRTHDAY",
53 "amount": "BigDecimal",
54 "quantity": 0,
55 "sender": {
56 "name": "example",
57 "email": "example"
58 },
59 "recipient": {
60 "name": "example",
61 "email": "example"
62 },
63 "message": "example"
64 }
65 },
66 "version": 0
67 }
68}
Example response
1{
2 "data": {
3 "updateCartLineItem": {
4 "cart": {
5 "id": "example",
6 "entityId": "example",
7 "currencyCode": "example",
8 "displayCurrencyCode": "example",
9 "isTaxIncluded": true,
10 "baseAmount": {
11 "currencyCode": null,
12 "value": null,
13 "formatted": null,
14 "formattedV2": null
15 },
16 "baseAmountInDisplayCurrency": {
17 "currencyCode": null,
18 "value": null,
19 "formatted": null,
20 "formattedV2": null
21 },
22 "discountedAmount": {
23 "currencyCode": null,
24 "value": null,
25 "formatted": null,
26 "formattedV2": null
27 },
28 "discountedAmountInDisplayCurrency": {
29 "currencyCode": null,
30 "value": null,
31 "formatted": null,
32 "formattedV2": null
33 },
34 "amount": {
35 "currencyCode": null,
36 "value": null,
37 "formatted": null,
38 "formattedV2": null
39 }
40 }
41 }
42 }
43}
Updates line item in the cart.
Was this page helpful?
Previous

addCartLineItems

Next

deleteCartLineItem

Built with

Arguments

inputUpdateCartLineItemInputRequired
Update cart line item input object

Returns

an optional UpdateCartLineItemResult
cartCart
The Cart that is updated as a result of mutation.