Returned when the Cart contains a Discount Code with a DiscountCodeState other than MatchesCart.

The error is returned as a failed response to:

- [Create Cart](ctp:api:endpoint:/{projectKey}/carts:POST) and [Create Cart in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/carts:POST) requests and [Add DiscountCode](ctp:api:type:CartAddDiscountCodeAction) update action on Carts.
- [Create Cart](ctp:api:endpoint:/{projectKey}/me/carts:POST) and [Create Cart in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/me/carts:POST) requests and [Add DiscountCode](ctp:api:type:MyCartAddDiscountCodeAction) update action on My Carts.
- [Create Cart in BusinessUnit](ctp:api:endpoint:/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/carts:POST) request on Associate Carts.
- [Create Order from Cart](ctp:api:endpoint:/{projectKey}/orders:POST) and [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/orders:POST) requests on Orders.
- [Create Order from Cart](ctp:api:endpoint:/{projectKey}/me/orders:POST) and [Create Order in Store from Cart](ctp:api:endpoint:/{projectKey}/in-store/me/orders:POST) requests on My Orders.
- [Add DiscountCode](ctp:api:type:StagedOrderAddDiscountCodeAction) update action on Order Edits.
- [Create Order from Cart in BusinessUnit](ctp:api:endpoint:/{projectKey}/as-associate/{associateId}/in-business-unit/key={businessUnitKey}/orders:POST) request on Associate Orders.
interface DiscountCodeNonApplicableError {
    code: "DiscountCodeNonApplicable";
    discountCode?: string;
    discountCodeId?: string;
    message: string;
    reason?: string;
    validFrom?: string;
    validityCheckTime?: string;
    validUntil?: string;
    [key: string]: any;
}

Indexable

  • [key: string]: any

Properties

code: "DiscountCodeNonApplicable"
discountCode?: string

Discount Code passed to the Cart.

discountCodeId?: string

Unique identifier of the Discount Code.

message: string

"The discountCode $discountCodeId cannot be applied to the cart."

reason?: string

"DoesNotExist" or "TimeRangeNonApplicable"

validFrom?: string

Date and time (UTC) from which the Discount Code is valid.

validityCheckTime?: string

Date and time (UTC) the Discount Code validity check was last performed.

validUntil?: string

Date and time (UTC) until which the Discount Code is valid.