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
| Argument | Type | Required | Description |
|---|---|---|---|
| id | String! | Yes | The ID of the cart to add lines to |
| lines | [CartLineInput!]! | Yes | The input for adding lines to the cart |
Return Type
CartLinesAddPayload - Payload returned by the cartLinesAdd mutation. Returns an updated cart object and a list of user errors if any occurred during the operation.
Example
mutation {
cartLinesAdd(
id: "eyJhbGciOiJIUzI1NiJ9..."
lines: [
{
merchandiseId: "12345"
quantity: 2
}
]
) {
cart {
id
lines {
nodes {
id
quantity
}
}
}
userErrors {
field
message
}
}
}