Create a CartDiscount resource via POST /carts/discounts with a CartDiscountDraft specifying name, cartPredicate (DSL expression), value (relative or absolute), target, and isActive.
To support code-based redemption, create a DiscountCode via POST /discount-codes referencing the CartDiscount ID and providing a code string.
Apply a discount code to a cart via the addDiscountCode cart update action, providing the code string; commercetools validates and resolves the applicable CartDiscount.
Read cart.discountCodes to verify the applied code and its state (MatchesCart, DoesNotMatchCart, MaxApplicationReached, etc.).
Remove a discount code from a cart using the removeDiscountCode update action with the discountCode reference.
Consult current commercetools discount predicate DSL reference for supported cart attributes, custom fields, and logical operators available in cartPredicate expressions.
Known gotchas
CartDiscount requires a cartPredicate; an empty predicate ('1=1') matches all carts, which may be unintentional—always validate predicates in a staging environment before activating.
Discount code maximum application counts and per-customer limits are enforced by commercetools at the time of addDiscountCode; these constraints are set on the DiscountCode resource, not the CartDiscount.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp