commercetools icon

commercetools

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

Actions671

Product-discount → Create ProductDiscount

AI-generated

Summary

Create a new product discount in the commercetools platform by specifying required details such as a unique key, localized name and description, predicate for applicability, sort order, active status, and value type with optional monetary values.

Inputs

  • Key (required) — Unique identifier for the product discount.
  • Name (required) — Localized name of the product discount as a JSON object, e.g., {"en": "Discount Name"}.
  • Description (required) — Localized description of the product discount as a JSON object, e.g., {"en": "Description text"}.
  • Value › Type — Type of discount value applied (such as amount, relative).
  • Value › Money — Array specifying monetary values applicable for the discount, if relevant.
  • Predicate (required) — A string predicate defining which products or conditions the discount applies to.
  • Sort Order (required) — A string defining the priority order of this discount relative to others.
  • Is Active (required) — Boolean flag indicating if the discount is currently active.

Output shape

a single record

Returns the created product discount object as JSON on success.

Examples

Example 1: Create a product discount for 10% off all products in category 'Shoes' active immediately with a specific sort order.

Set Key to a unique value, Name and Description as localized JSON, Predicate to filter products, Sort Order as desired string, Is Active true, and Value Type to 'relative' with appropriate Value Money.

Links

Discussion