Skip to content

Multiple carts GraphQL

Served by MultipleCartModule on commercetools and MultipleCartModule on medusa.

Each operation has its own page with its arguments, an example and the engines that serve it. The types link to their fields on the multiple carts types page.

Operations

OperationDescriptionServed by
cartCreateNamedMutationCreate a cart under a name and switch to it, which is what a new-cart dialog does.commercetoolsmedusa
cartDeleteMutationDelete a cart.commercetoolsmedusa
cartRenameMutationRename a cartcommercetoolsmedusa
cartSetCurrentMutationChoose which of the caller's carts is the current one, as returned by the cart query.commercetoolsmedusa

Types

TypeDescription
CartCreateNamedErrorUnionError union for creating a named cart
CartCreateNamedResponseObjectResponse for creating a named cart
CartDeleteErrorUnionError union for cart delete
CartDeleteResponseObjectResponse for deleting a cart
CartRenameErrorUnionError union for cart rename
CartRenameResponseObjectResponse for renaming a cart
CartResultObjectPaginated result containing carts
CartSetCurrentErrorUnionError union for cart set current
CartSetCurrentResponseObjectResponse for choosing the current cart
CartStatusTypeEnumWhether a cart is in use

Fields on other types

This domain adds these fields to types that another domain defines.

BusinessUnit

FieldTypeDescription
cartsCartResult!Every cart in this business unit the caller is allowed to see, which includes colleagues' carts where their role permits it, most recently touched first. Active carts only unless status asks for archived ones too.Arguments: page, pageSize, status

Cart

FieldTypeDescription
nameStringBuyer-given name, to tell one cart from another. Null until a cart is named.
defaultNameStringWhat to call the cart while it has no name: its first product, then a plus and the number of further products, such as "Accuboormachine + 2". Language-neutral, so a storefront needs no wording for it. Given whether or not the cart is named; null for an empty cart, where a storefront shows its own label.
previewImages[ProductImage!]!Images of the cart's first products, one per line in the order they were added and none repeated, so a cart list shows what each cart holds. Add-ons are left out, as is a line without an image. At most 10, whatever the limit asks for; empty for an empty cart.Arguments: limit
ownerCustomerThe person whose cart this is. Null for a guest cart, which belongs to a session rather than to anyone.
statusCartStatusType!Whether the cart is in use or archived. A cart nobody has touched for 60 days, or the period the service configures, is archived: it leaves the unit's cart list unless that is asked for. The caller's current cart is never archived, so choosing one with cartSetCurrent makes it read ACTIVE.