Skip to content
Saleor
Esc
↑↓navigate↵open⌘Jpreview

Schema: Saleor 3.23.43Download SDLUpgrade guides

On this page

PromoCodeRejectionReason Enum

Enum PromoCodeRejectionReason in Saleor’s Discounts API. Explore its schema, type relationships, descriptions, and compatibility notes.

The specific reason why a promo code cannot be applied. A code that has not been proven usable yet is only ever reported as NOT_FOUND, EXPIRED or USAGE_LIMIT_REACHED, so that a rejected code cannot be told apart from one that does not exist. The reason never depends on the caller’s permissions.

enum PromoCodeRejectionReason {
  NOT_FOUND
  EXPIRED
  USAGE_LIMIT_REACHED
  NOT_APPLICABLE
  MIN_SPENT_NOT_REACHED
  MIN_QUANTITY_NOT_REACHED
  CUSTOMER_EMAIL_REQUIRED
  SHIPPING_NOT_REQUIRED
  DELIVERY_METHOD_NOT_SET
  NO_ELIGIBLE_PRODUCTS
  NO_LONGER_AVAILABLE
}

Values

NOT_FOUND

NOT_FOUND

No promo code matches the given code. Also reported in place of a reason that may not be disclosed, so this value does not prove that no voucher or gift card exists with that code.

EXPIRED

EXPIRED

The voucher’s end date, or the gift card’s expiry date, is in the past.

USAGE_LIMIT_REACHED

USAGE_LIMIT_REACHED

The voucher’s total usage limit, summed over all of its codes, is exhausted, or a single-use code was already redeemed.

NOT_APPLICABLE

NOT_APPLICABLE

The promo code exists but cannot be used here. Reported when the reason is specific to the code’s configuration rather than to something the customer can change: a voucher limited to staff, to other countries, to another channel or to one use per customer, or a gift card restricted to another customer.

MIN_SPENT_NOT_REACHED

MIN_SPENT_NOT_REACHED

The order value is below the voucher’s minimum. Populates the minSpent field.

MIN_QUANTITY_NOT_REACHED

MIN_QUANTITY_NOT_REACHED

The order contains fewer items than the voucher’s minimum. Populates the minCheckoutItemsQuantity field.

CUSTOMER_EMAIL_REQUIRED

CUSTOMER_EMAIL_REQUIRED

The voucher is limited to one use per customer, so a customer email must be set on the checkout before it can be applied.

SHIPPING_NOT_REQUIRED

SHIPPING_NOT_REQUIRED

The voucher applies to shipping, but nothing in the order requires shipping.

DELIVERY_METHOD_NOT_SET

DELIVERY_METHOD_NOT_SET

The voucher applies to shipping, but no delivery method is selected yet. Selecting one may make the voucher applicable.

NO_ELIGIBLE_PRODUCTS

NO_ELIGIBLE_PRODUCTS

The voucher applies to specific products, collections or categories, and none of the ordered lines match.

NO_LONGER_AVAILABLE

NO_LONGER_AVAILABLE

The promo code was applicable when it was added to the checkout, but is no longer available.

Used by


Schema: Saleor 3.23.43. Download SDL.

Was this page helpful?