Promotion Coupon Validator

Validates promotion coupon codes and removes invalid ones from the cart.

Overview

The Promotion Coupon Validator checks that all coupon codes applied to the cart are still valid. Invalid coupon codes are automatically removed from the cart, and a validation error is returned to notify the user.

Identifier

PropertyValue
Connector IDpromotionCouponValidator
Validation TypeDiscount

Behavior

  1. Skips validation entirely for replacement orders (carts tagged with the replacement order tag)
  2. If the cart has no coupon codes, validation passes
  3. Validates each coupon code against the promotion coupon service
  4. Collects all invalid coupon codes
  5. If any invalid codes are found:
    • Removes them from the cart
    • Marks the cart entity as updated
    • Returns a validation error

Error messages

ConditionTranslation Key
Invalid coupon codes foundCouponCodeValidatorErrorMessage

Configuration

No additional properties required.

{
  "name": "promotionCouponValidator",
  "implementations": ["IValidator"],
  "disableStandardErrorPolicy": false
}

On this page