Skip to Content

cartCreate

Creates a new cart for customers to add products and proceed to checkout.

Authentication

Public Access: Accessible with the public API key

Mutation Structure

mutation { cartCreate(input: CartInput!) { cart { id createdAt updatedAt } userErrors { field message } } }

Input Arguments

ArgumentTypeRequiredDescription
inputCartInputYesThe input object containing cart creation details such as line items and attributes

Return Type

CartCreatePayload - The payload returned by the cartCreate mutation, containing the newly created cart and any validation errors that occurred during creation.

Example

mutation { cartCreate(input: { lines: [ { quantity: 1 merchandiseId: "12345" } ] }) { cart { id createdAt updatedAt } userErrors { field message } } }