# cartCreate Creates a new cart ## Authentication > **Public Access**: Accessible with the public API key ## Mutation Structure ```graphql mutation { cartCreate(input: CartInput!) { cart { # Cart fields } userErrors { # UserError fields } } } ``` ## Input Arguments | Argument | Type | Required | Description | |----------|------|----------|-------------| | input | [CartInput](/reference/storefront/v1/inputs/cart-input) | Yes | The input for creating the cart | ## Return Type [CartCreatePayload](/reference/storefront/v1/objects/cart-create-payload) - Payload returned by the cartCreate mutation. Contains the created cart object and any user errors that occurred during cart creation. ## Example ```graphql mutation { cartCreate(input: { lines: [ { merchandiseId: "12345" quantity: 1 } ] }) { cart { id lines { nodes { id quantity merchandise { id } } } checkoutUrl } userErrors { field message } } } ``` ## Related Types - [CartCreatePayload](/reference/storefront/v1/objects/cart-create-payload) - [CartInput](/reference/storefront/v1/inputs/cart-input)