Skip to content

cartSetCurrent

Mutationin Multiple carts

Choose which of the caller's carts is the current one, as returned by the cart query. Modifies no cart. An archived cart it chooses reads ACTIVE while it is the current one, and the buyer's next change keeps it so.

Arguments

ArgumentTypeDescription
idID!

Returns

CartSetCurrentResponse!

FieldTypeDescription
cartCartThe cart that is now current. Write this into the cart query.
cartErrors[CartSetCurrentError!]Error details if the cart could not be made current

Example

mutation CartSetCurrent($id: ID!) {
cartSetCurrent(id: $id) {
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

Used by

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