--- title: cartLinesAdd - Storefront API description: Adds a merchandise line to the cart. api_version: 2025-10 api_name: storefront type: mutation api_type: graphql source_url: html: https://shopify.dev/docs/api/storefront/latest/mutations/cartLinesAdd md: https://shopify.dev/docs/api/storefront/latest/mutations/cartLinesAdd.md --- # cart​Lines​Add mutation Adds a merchandise line to the cart. ## Arguments * cart​Id [ID!](https://shopify.dev/docs/api/storefront/latest/scalars/ID) required The ID of the cart. * lines [\[Cart​Line​Input!\]!](https://shopify.dev/docs/api/storefront/latest/input-objects/CartLineInput) required A list of merchandise lines to add to the cart. The input must not contain more than `250` values. *** ## Cart​Lines​Add​Payload returns * cart [Cart](https://shopify.dev/docs/api/storefront/latest/objects/Cart) The updated cart. * user​Errors [\[Cart​User​Error!\]!](https://shopify.dev/docs/api/storefront/latest/objects/CartUserError) non-null The list of errors that occurred from executing the mutation. * warnings [\[Cart​Warning!\]!](https://shopify.dev/docs/api/storefront/latest/objects/CartWarning) non-null A list of warnings that occurred during the mutation. *** ## Examples * ### cartLinesAdd reference ## Mutation Reference ```graphql mutation cartLinesAdd($cartId: ID!, $lines: [CartLineInput!]!) { cartLinesAdd(cartId: $cartId, lines: $lines) { cart { # Cart fields } userErrors { field message } warnings { # CartWarning fields } } } ``` ## Input ```json { "cartId": "gid://shopify//10079785100", "lines": [ { "attributes": [ { "key": "", "value": "" } ], "quantity": 1, "merchandiseId": "gid://shopify//10079785100", "sellingPlanId": "gid://shopify//10079785100", "parent": { "lineId": "gid://shopify//10079785100", "merchandiseId": "gid://shopify//10079785100" } } ] } ```