Interface MyCartAddDiscountCodeAction

All Superinterfaces:
MyCartUpdateAction, ResourceUpdateAction<MyCartUpdateAction>

public interface MyCartAddDiscountCodeAction extends MyCartUpdateAction

Adds a DiscountCode to the Cart to activate the related CartDiscounts. 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

     MyCartAddDiscountCodeAction myCartAddDiscountCodeAction = MyCartAddDiscountCodeAction.builder()
             .code("{code}")
             .build()