Removes one or more merchandise lines from the cart.


Anchor to cartId
cartId
required

The ID of the cart.

The merchandise line IDs to remove.

The input must not contain more than 250 values.


Was this section helpful?

The updated cart.

The list of errors that occurred from executing the mutation.

A list of warnings that occurred during the mutation.


Was this section helpful?
Hide code
Mutation reference
Copy
mutation cartLinesRemove($cartId: ID!, $lineIds: [ID!]!) {
  cartLinesRemove(cartId: $cartId, lineIds: $lineIds) {
    cart {
      # Cart fields
    }
    userErrors {
      field
      message
    }
    warnings {
      # CartWarning fields
    }
  }
}
Hide code
Input
Copy
{
  "cartId": "gid://shopify/<objectName>/10079785100",
  "lineIds": [
    "gid://shopify/<objectName>/10079785100"
  ]
}