commercetools icon

commercetools

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

Actions671

Discount Code → Delete DiscountCode by Key

AI-generated

Summary

Delete a discount code in commercetools by specifying its unique key and current version number.

Inputs

  • Discount Code Key (required) — The unique key of the discount code to delete.
  • Version (required) — The current version of the discount code for concurrency control, must be provided to delete.

Output shape

A JSON object representing the deleted discount code response from the commercetools API.

The operation performs an HTTP DELETE request with the required version query parameter. If the deletion is successful, the deleted discount code's details are returned. Errors will be thrown for invalid keys or version mismatches.

Examples

Example 1: Delete a discount code named 'SUMMER21' at version 3

Set 'Discount Code Key' to 'SUMMER21' and 'Version' to 3. The node requests deletion of the discount code with key 'SUMMER21' if it is currently at version 3.

Links

Discussion