Update Cart
Use the updateCart
mutation to delete a cart, and all items associated to it.
Mutation
updateCart(input: UpdateCartInput!): Cart!
Arguments | Type |
---|---|
input | UpdateCartInput! |
The updateCart
mutation will always return the updated Cart
.
UpdateCartInput!
Argument | Type | Description |
---|---|---|
id | ID! | The id of the Cart you want to update. |
currency | CurrencyInput | Update the cart currency. |
email | String | Update the email associated with the cart. |
notes | String | Let customer save notes for the cart. |
metadata | Json | Custom metadata object for the cart. |
If no cart item exists with the id
provided, an error will be returned.
Example
mutation {
updateCart(
input: {
id: "ck5r8d5b500003f5o2aif0v2b"
currency: { code: USD }
email: "[email protected]"
notes: "These are my order notes"
metadata: {
subscribeToUpdates: "[email protected]"
referredBy: "@notrab"
acceptsMarketing: true
}
}
) {
id
currency {
code
}
email
notes
metadata
}
}
{
"data": {
"updateCart": {
"id": "ck5r8d5b500003f5o2aif0v2b",
"currency": {
"code": "USD"
},
"email": "[email protected]",
"notes": "These are my order notes",
"metadata": {
"subscribeToUpdates": "[email protected]"
"referredBy": "@notrab"
"acceptsMarketing": true
}
}
}
}