Skip to Content

cartLinesAdd

Adds merchandise lines to an existing cart.

Authentication

Public Access: Accessible with the public API key

Mutation Structure

mutation { cartLinesAdd(id: String!, lines: [CartLineInput]!) { cart { # Cart fields } userErrors { # UserError fields } } }

Input Arguments

ArgumentTypeRequiredDescription
idString!YesThe ID of the cart to add lines to
lines[CartLineInput]!YesThe input for adding lines to the cart

Return Type

CartLinesAddPayload - Payload returned by the cartLinesAdd mutation. Contains an optional updated cart object and a required list of user errors that may have occurred during the operation.

Example

mutation { cartLinesAdd( id: "eyJhbGciOiJIUzI1NiJ9..." lines: [ { merchandiseId: "12345" quantity: 2 } ] ) { cart { id lines { edges { node { id quantity } } } } userErrors { field message } } }