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

deleteCartLineItem

Example Query
1mutation ExampleMutation($input: DeleteCartLineItemInput) {
2 deleteCartLineItem(input: $input) {
3 deletedLineItemEntityId
4 cart {
5 id
6 entityId
7 currencyCode
8 displayCurrencyCode
9 isTaxIncluded
10 baseAmount
11 baseAmountInDisplayCurrency
12 discountedAmount
13 discountedAmountInDisplayCurrency
14 amount
15 }
16 deletedCartEntityId
17 }
18}
Variables
1{
2 "input": {
3 "cartEntityId": "example",
4 "lineItemEntityId": "example",
5 "version": 0
6 }
7}
Example response
1{
2 "data": {
3 "deleteCartLineItem": {
4 "deletedLineItemEntityId": "example",
5 "cart": {
6 "id": "example",
7 "entityId": "example",
8 "currencyCode": "example",
9 "displayCurrencyCode": "example",
10 "isTaxIncluded": true,
11 "baseAmount": {
12 "currencyCode": null,
13 "value": null,
14 "formatted": null,
15 "formattedV2": null
16 },
17 "baseAmountInDisplayCurrency": {
18 "currencyCode": null,
19 "value": null,
20 "formatted": null,
21 "formattedV2": null
22 },
23 "discountedAmount": {
24 "currencyCode": null,
25 "value": null,
26 "formatted": null,
27 "formattedV2": null
28 },
29 "discountedAmountInDisplayCurrency": {
30 "currencyCode": null,
31 "value": null,
32 "formatted": null,
33 "formattedV2": null
34 },
35 "amount": {
36 "currencyCode": null,
37 "value": null,
38 "formatted": null,
39 "formattedV2": null
40 }
41 },
42 "deletedCartEntityId": "example"
43 }
44 }
45}
Delete line item in the cart. Removing the last line item in the Cart deletes the Cart.
Was this page helpful?
Previous

updateCartLineItem

Next

updateCartCurrency

Built with

Arguments

inputDeleteCartLineItemInputRequired
Delete cart line item input object

Returns

an optional DeleteCartLineItemResult
deletedLineItemEntityIdString
The ID of the line item that is deleted as a result of mutation.
cartCart
The Cart that is updated as a result of mutation.
deletedCartEntityIdString
The ID of the Cart if it is deleted as a result of mutation.