commercetools icon

commercetools

Interact with the commercetools API. Operations are auto-generated from the official Postman collection.

Actions671

Cart → Delete Cart by Key

AI-generated

Summary

Delete a commercetools cart identified by its unique key and expected version number, removing it permanently from the project.

Inputs

  • Cart Key (required) — The unique key of the cart to delete.
  • Version (required) — The expected current version of the cart to ensure concurrency control during deletion.

Output shape

a single JSON object

Returns the deleted cart object as JSON if successful; throws an error if the cart does not exist or if the version is mismatched, causing the deletion to fail.

Examples

Example 1: Delete a cart by specifying its unique key and version

Set 'Cart Key' to the cart's key and 'Version' to its current version number to delete the cart.

Links

Discussion