Interface CartAddDiscountCodeAction

All Superinterfaces:
CartUpdateAction, ResourceUpdateAction<CartUpdateAction>

public interface CartAddDiscountCodeAction extends CartUpdateAction

Adds a DiscountCode to the Cart to activate the related Cart Discounts. If the related Cart Discounts are inactive or invalid, or belong to a different Store than the Cart, a DiscountCodeNonApplicableError is returned.

A Discount Code can be added only if no DirectDiscount has been applied to the Cart. For frozen Carts, the DiscountCodeState must be DoesNotMatchCart when adding a Discount Code.

The maximum number of Discount Codes in a Cart is restricted by a limit.

Specific Error Code: MatchingPriceNotFound


Example to create an instance using the builder pattern

     CartAddDiscountCodeAction cartAddDiscountCodeAction = CartAddDiscountCodeAction.builder()
             .code("{code}")
             .build()