Skip to Content

cartLinesRemove

Removes merchandise lines from an existing cart.

Authentication

Public Access: Accessible with the public API key

Mutation Structure

mutation { cartLinesRemove(id: String!, lineIds: [Id]!) { cart { # Cart fields } userErrors { # UserError fields } } }

Input Arguments

ArgumentTypeRequiredDescription
idString!YesThe ID of the cart to remove lines from
lineIds[Id]!YesA list of line item IDs to remove from the cart

Return Type

CartLinesRemovePayload - Payload returned by the cartLinesRemove mutation. Contains the updated cart and any errors that occurred during the operation.

Example

mutation { cartLinesRemove(id: "eyJhbGciOiJIUzI1NiJ9...", lineIds: ["gid://shopify/CartLine/1", "gid://shopify/CartLine/2"]) { cart { id lines { edges { node { id quantity } } } } userErrors { field message } } }