cartDelete
Delete a cart. Deleting the current one promotes another, and the response says which is current afterwards.
Arguments
| Argument | Type | Description |
|---|---|---|
id | ID! | |
version | String |
Returns
| Field | Type | Description |
|---|---|---|
currentCart | Cart | The cart that is current now the delete has happened. Deleting the current cart promotes another one, and this says which, so a client is never left pointing at a deleted cart nor has to refetch to find out where it is. Null when the caller has no cart left. |
cartErrors | [CartDeleteError!] | Error details if the cart could not be deleted |
Example
mutation CartDelete($id: ID!, $version: String) { cartDelete(id: $id, version: $version) { currentCart { 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 } } }}{ "id": "id-1", "version": "Example"}{ "data": { "cartDelete": { "currentCart": { "id": "id-1", "version": "Example", "createdAt": "2026-10-01T09:30:00Z", "lastModifiedAt": "2026-10-01T09:30:00Z", "currency": "EUR", "customerEmail": "jane@example.com", "isGuest": true, "totalQuantity": 1, "deliveryRemarks": "Example", "vatNumber": "Example", "purchaseOrderNumber": "Example", "deliverySplit": "COMPLETE", "requestedDeliveryDate": "2026-10-01", "earliestCompleteDeliveryDate": "2026-10-01", "name": "Example", "defaultName": "Example", "status": "ACTIVE" }, "cartErrors": [ { "__typename": "ValidationError", "message": "Example" } ] } }}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/commercetools | Resolved |
| @evolve-framework/medusa | Resolved |
Used by
The storefront packages that send it, in these GraphQL documents:
- @evolve-storefront/feature-cart:
CartDelete

