mobileUpdateCartItem
Requires a customer (portal or buyer app) session.
Set quantity for a cart item; quantity 0 removes the line.
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:
- GraphQL
- cURL
mutation MobileUpdateCartItem($input: MobileUpdateCartItemInput!) {
mobileUpdateCartItem(input: $input) {
id
addressId
directions
itemCount
subtotal
updatedAt
items {
id
productName
acceptAlternativeIfUnavailable
addedAt
blurhash
conversionFactor
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation MobileUpdateCartItem($input: MobileUpdateCartItemInput!) {\n mobileUpdateCartItem(input: $input) {\n id\n addressId\n directions\n itemCount\n subtotal\n updatedAt\n items {\n id\n productName\n acceptAlternativeIfUnavailable\n addedAt\n blurhash\n conversionFactor\n }\n }\n}",
"variables": {
"input": {
"itemId": "id",
"quantity": 0
}
}
}
EOF
Variables:
{
"input": {
"itemId": "id",
"quantity": 0
}
}
Response:
{
"data": {
"mobileUpdateCartItem": {
"id": "id",
"addressId": "id",
"directions": "string",
"itemCount": 0,
"subtotal": 0,
"updatedAt": "2025-01-15T00:00:00Z",
"items": [
{
"id": "id",
"productName": "string",
"acceptAlternativeIfUnavailable": true,
"addedAt": "2025-01-15T00:00:00Z",
"blurhash": "string",
"conversionFactor": 0
}
]
}
}
}
mobileUpdateCartItem(
input: MobileUpdateCartItemInput!
): MobileCart!
Arguments
mobileUpdateCartItem.input ● MobileUpdateCartItemInput! non-null input
The details of the mobile update cart item request.
Type
MobileCart object
One shared cart per buyer (not per delivery address — the address is chosen at placeOrder). The same cart the customer portal reads and writes (one per branch in branch mode).