Skip to content

cartUpdate

Mutationin Cart

Update cart with various actions

Arguments

ArgumentTypeDescription
idID!
versionString
actions[CartUpdateAction!]!

Returns

CartUpdateResponse!

FieldTypeDescription
cartCartCart information after update
cartErrors[CartUpdateError!]Error details if update failed

Example

mutation CartUpdate($id: ID!, $version: String, $actions: [CartUpdateAction!]!) {
cartUpdate(id: $id, version: $version, actions: $actions) {
cart {
id
version
createdAt
lastModifiedAt
currency
customerEmail
isGuest
totalQuantity
deliveryRemarks
vatNumber
purchaseOrderNumber
deliverySplit
requestedDeliveryDate
earliestCompleteDeliveryDate
name
defaultName
status
}
cartErrors {
__typename
... on ValidationError {
message
}
... on CartError {
message
code
}
}
}
}

The query selects the return type's fields two levels deep; pick the ones you need. The response shows its shape with placeholder values.

Served by

@evolve-framework/commercetoolsResolved
@evolve-framework/medusaResolved
@evolve-framework/sfccResolved

Used by

The storefront packages that send it, in these GraphQL documents: