commercetools icon

commercetools

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

Actions671

Discount Code → Update DiscountCode by Key

AI-generated

Summary

Update an existing discount code identified by its unique key in the commercetools platform using specified actions to modify its properties.

Inputs

  • Discount Code Key (required) — The unique key identifying the discount code to update.
  • Version (required) — The current version number of the discount code to handle concurrent modifications.
  • Actions (JSON) — A raw JSON array of update actions to apply, overriding the UI-configured actions when provided.
  • Actions (UI) — A user interface to specify one or more update actions such as changing cart discounts, groups, activation status, predicates, custom fields, descriptions, keys, maximum applications, names, and validity periods.

Output shape

a single JSON object representing the updated discount code resource returned by the commercetools API

The operation requires the correct version of the discount code for update concurrency. The response contains the discount code after applying the actions. Errors during update will throw or return error details if 'Continue On Fail' is enabled.

Links

Discussion