commercetools icon

commercetools

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

Actions671

Product-discount → Update ProductDiscount by Key

AI-generated

Summary

Update a ProductDiscount in commercetools identified by its unique key, specifying the expected version for concurrency control, and applying one or more update actions to modify its attributes.

Inputs

  • Product-discount Key (required) — The unique key of the ProductDiscount to update.
  • Version (required) — The current version number of the ProductDiscount, used for optimistic concurrency control.
  • Actions (UI) — A collection of update actions to apply to the ProductDiscount, selectable via user interface fields (e.g., change active status, name, predicate, sort order, value, description, key, validity dates).
  • Actions (JSON) — Raw JSON array of update actions that overrides the UI-based actions when provided and non-empty.

Output shape

a single JSON object representing the updated ProductDiscount resource as returned by the commercetools API

The output returns the updated ProductDiscount object from commercetools. The operation requires the correct version number to avoid update conflicts. If the Actions (JSON) input is non-empty, it takes precedence over Actions (UI). Errors during update will throw, unless configured to continue on fail.

Examples

Example 1: Modify the active state and name of a ProductDiscount

Specify the Product-discount Key and current Version, then add 'ChangeIsActive' and 'ChangeName' actions via the UI or provide the corresponding JSON array in Actions (JSON).

Links

Discussion