Adds a DiscountCode to the Cart to activate the related Cart Discounts. Adding a Discount Code is only possible if no DirectDiscount has been applied to the Cart. Discount Codes can be added to frozen Carts, but their DiscountCodeState is then DoesNotMatchCart.

The maximum number of Discount Codes in a Cart is restricted by a [limit](/../api/limits#carts).

Specific Error Code: [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError)
interface CartAddDiscountCodeAction {
    action: "addDiscountCode";
    code: string;
}

Properties

Properties

action: "addDiscountCode"
code: string

code of a DiscountCode.

Generated using TypeDoc