Anchor to section titled 'undefined'

checkoutLineItemsRemove
mutation
deprecated

Requires unauthenticated_write_checkouts access scope.

Removes line items from an existing checkout. The Storefront GraphQL Checkout API is deprecated and will be removed in a future version. Please see https://shopify.dev/changelog/deprecation-of-checkout-apis for more information.


Anchor to checkoutId
checkoutId
required

The checkout on which to remove line items.

Anchor to lineItemIds
lineItemIds
required

Line item ids to remove.

The input must not contain more than 250 values.


Was this section helpful?

The updated checkout object.

The list of errors that occurred from executing the mutation.

The list of errors that occurred from executing the mutation. Use checkoutUserErrors instead.


Was this section helpful?
Hide code
Mutation reference
Copy
mutation checkoutLineItemsRemove($checkoutId: ID!, $lineItemIds: [ID!]!) {
  checkoutLineItemsRemove(checkoutId: $checkoutId, lineItemIds: $lineItemIds) {
    checkout {
      # Checkout fields
    }
    checkoutUserErrors {
      # CheckoutUserError fields
    }
    userErrors {
      field
      message
    }
  }
}
Hide code
Input
Copy
{
  "checkoutId": "gid://shopify/<objectName>/10079785100",
  "lineItemIds": [
    "gid://shopify/<objectName>/10079785100"
  ]
}