commercetools icon

commercetools

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

Actions671

Discount Code → Create DiscountCode

AI-generated

Summary

Create a new discount code in commercetools with specified properties including key, name, description, code, associated cart discounts, cart predicate, status, application limits, and groups.

Inputs

  • Key (required) — Unique identifier for the discount code.
  • Name (required) — Localized name of the discount code as a JSON object (e.g., {"en": ""}).
  • Description (required) — Localized description of the discount code as a JSON object.
  • Code (required) — The actual discount code string customers enter.
  • Cart Discounts (required) — An array of references to cart discounts linked to this discount code.
  • Cart Predicate (required) — A string predicate defining conditions under which the discount code applies to the cart.
  • Is Active (required) — Boolean indicating whether the discount code is active and usable.
  • Max Applications (required) — Maximum number of times the discount code can be applied overall (0 means unlimited).
  • Max Applications Per Customer (required) — Maximum number of times an individual customer can apply the discount code (0 means unlimited).
  • Groups (required) — An array of group strings to which this discount code belongs.

Output shape

a JSON object representing the created DiscountCode resource as returned by the commercetools API

The output includes all details of the newly created discount code, reflecting the input properties and any default or computed fields set by commercetools.

Links

Discussion