Skip to main content

mobileApplyCartChanges

Requires a customer (portal or buyer app) session.

Apply several cart writes (adds, absolute-quantity updates, removes) in one call and one save — the bulk order confirm. All-or-nothing: if any line is refused, the cart is left unchanged.

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 MobileApplyCartChanges($input: MobileApplyCartChangesInput!) {
mobileApplyCartChanges(input: $input) {
id
addressId
directions
itemCount
subtotal
updatedAt
items {
id
productName
acceptAlternativeIfUnavailable
addedAt
blurhash
conversionFactor
}
}
}

Variables:

{
"input": {
"adds": [
{
"productId": "id",
"productName": "string",
"quantity": 0,
"unitPrice": 0,
"variantId": "id"
}
],
"removes": [
{
"itemId": "id"
}
],
"updates": [
{
"itemId": "id",
"quantity": 0
}
]
}
}

Response:

{
"data": {
"mobileApplyCartChanges": {
"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
}
]
}
}
}
mobileApplyCartChanges(
input: MobileApplyCartChangesInput!
): MobileCart!

Arguments​

mobileApplyCartChanges.input ● MobileApplyCartChangesInput! non-null input​

The details of the mobile apply cart changes 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).