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