# cartLinesAdd Adds merchandise lines to an existing cart ## Authentication > **Public Access**: Accessible with the public API key ## Mutation Structure ```graphql mutation { cartLinesAdd(id: String!, lines: [CartLineInput!]!) { cart { # Cart fields } userErrors { # UserError fields } } } ``` ## Input Arguments | Argument | Type | Required | Description | |----------|------|----------|-------------| | id | String! | Yes | The ID of the cart to add lines to | | lines | [CartLineInput!]! | Yes | The input for adding lines to the cart | ## Return Type [CartLinesAddPayload](/reference/storefront/v1/objects/cart-lines-add-payload) - Payload returned by the cartLinesAdd mutation. Returns an updated cart object and a list of user errors if any occurred during the operation. ## Example ```graphql mutation { cartLinesAdd( id: "eyJhbGciOiJIUzI1NiJ9..." lines: [ { merchandiseId: "12345" quantity: 2 } ] ) { cart { id lines { nodes { id quantity } } } userErrors { field message } } } ``` ## Related Types - [CartLinesAddPayload](/reference/storefront/v1/objects/cart-lines-add-payload) - [CartLineInput](/reference/storefront/v1/inputs/cart-line-input)