# cartLinesUpdate Updates merchandise lines in an existing cart ## Authentication > **Public Access**: Accessible with the public API key ## Mutation Structure ```graphql mutation { cartLinesUpdate(id: String!, lines: [CartLinesUpdateInput!]!) { cart { # Cart fields } userErrors { # UserError fields } } } ``` ## Input Arguments | Argument | Type | Required | Description | |----------|------|----------|-------------| | id | String | Yes | The ID of the cart to update lines in | | lines | [CartLinesUpdateInput!] | Yes | A list of merchandise lines to update in the cart | ## Return Type [CartLinesUpdatePayload](/reference/storefront/v1/objects/cart-lines-update-payload) - Payload returned by the cartLinesUpdate mutation. Contains an optional updated cart object and a required list of user errors that occurred during the update operation. ## Example ```graphql mutation { cartLinesUpdate( id: "eyJhbGciOiJIUzI1NiJ9..." lines: [ { id: "cartLine123" quantity: 2 } ] ) { cart { id lines { edges { node { id quantity } } } } userErrors { field message } } } ``` ## Related Types - [CartLinesUpdatePayload](/reference/storefront/v1/objects/cart-lines-update-payload) - [CartLinesUpdateInput](/reference/storefront/v1/inputs/cart-lines-update-input)