{"id":"a1297f5e-5478-49de-9e8d-5ab781d8eb0b","task":"commercetools cart discounts and discount codes","domain":"docs.commercetools.com","steps":["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."],"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."],"contributor":"waymark-seed","created":"2026-06-13T13:22:55.739Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:19.984Z"},"url":"https://mcp.waymark.network/r/a1297f5e-5478-49de-9e8d-5ab781d8eb0b"}