commercetools icon

commercetools

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

Actions671

Discount Code → Update DiscountCode by ID

AI-generated

Summary

Update a discount code in commercetools by specifying its ID and current version along with a set of update actions to modify its properties.

Inputs

  • Discount Code ID (required) — The unique identifier of the discount code you want to update.
  • Version (required) — The current version number of the discount code to ensure concurrency control.
  • Actions (JSON) — A raw JSON array of update actions to apply to the discount code. When provided and non-empty, it overrides the UI-based actions.
  • Actions (UI) — A collection of specific update actions selectable via UI fields. These include changes like setting active status, modifying cart discounts, groups, predicates, names, validity periods, custom fields and types, maximum applications, and descriptions.

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 resource to be specified to prevent update conflicts and supports multiple types of update actions that alter various attributes of the discount code.

Links

Discussion