Skip to main content

updateCartItem

Requires a customer (portal or buyer app) session.

Sets the quantity of one cart line. Pass the cart revision you last saw, and an operation ID so a retry applies once.

Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.

Example:

mutation UpdateCartItem($input: UpdateCartItemInput!) {
updateCartItem(input: $input) {
id
name
itemCount
revision
subtotal
updatedAt
items {
id
createdAt
acceptAlternativeIfUnavailable
baseUnitPrice
lineTotal
notes
}
}
}

Variables:

{
"input": {
"cartItemId": "id",
"quantity": 0
}
}

Response:

{
"data": {
"updateCartItem": {
"id": "id",
"name": "string",
"itemCount": 0,
"revision": 0,
"subtotal": 0,
"updatedAt": "2025-01-15T00:00:00Z",
"items": [
{
"id": "id",
"createdAt": "2025-01-15T00:00:00Z",
"acceptAlternativeIfUnavailable": true,
"baseUnitPrice": 0,
"lineTotal": 0,
"notes": "string"
}
]
}
}
}
updateCartItem(
input: UpdateCartItemInput!
): CartType!

Arguments​

updateCartItem.input ● UpdateCartItemInput! non-null input​

The cart line, its new quantity above zero, the expected cart revision and the operation ID.

Type​

CartType object​

The customer's cart.