You are reading the documentation for SDK v2, which is no longer the latest version. Switch to current
ApplyCartCouponParams
Parameters for applying a discount code to cart.
export interface ApplyCartCouponParams {
cartId: ApiUpdateCartParams["id"];
cartVersion: ApiUpdateCartParams["version"];
coupon: AddCartDiscountCode["code"];
validateDuplicates?: AddCartDiscountCode["validateDuplicates"];
versionFallback?: ApiUpdateCartParams["versionFallback"];
}Properties
| Name | Required | Type | Description |
|---|---|---|---|
cartId | Required | ApiUpdateCartParams["id"] | ID of the cart to apply a discount code to. |
cartVersion | Required | ApiUpdateCartParams["version"] | Version of the cart to apply a discount code to. |
coupon | Required | AddCartDiscountCode["code"] | Discount code to apply to cart. |
validateDuplicates | Optional | AddCartDiscountCode["validateDuplicates"] | When set to true, commercetools will respond with an error when adding the same discount code to the same cart twice. |
versionFallback | Optional | ApiUpdateCartParams["versionFallback"] | Flag enabling request retry in case of a ConcurrentModification error. |