> For the complete documentation index, see [llms.txt](https://docs.liquidcommerce.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.liquidcommerce.cloud/events-and-errors/checkout-events.md). Agents can also search and read this documentation through its [MCP server](https://docs.liquidcommerce.cloud/~gitbook/mcp).

# Checkout Events

Checkout events indicate various checkout states and conditions. The system maintains fault tolerance by returning events instead of failing operations.

### Event Structure

```typescript
interface ICheckoutEvents {
  type: CHECKOUT_EVENT_ENUM;
  message: string;
  items?: Array<Partial<ICheckoutItem>>;
}
```

### Event Enum

{% code collapsedlinecount="10" %}

```typescript
enum CHECKOUT_EVENT_ENUM {
  ERROR_PROCESSING_GIFT_CARDS = 'ErrorProcessingGiftCards',
  INVALID_GIFT_CARD_CODE = 'InvalidGiftCardCodes',
  INVALID_GIFT_CARD_PARTNER = 'InvalidGiftCardPartner',
  INACTIVE_GIFT_CARD = 'InactiveGiftCard',
  GIFT_CARD_ALREADY_IN_USE = 'GiftCardAlreadyInUse',
  GIFT_CARD_EXPIRED = 'GiftCardExpired',
  GIFT_CARD_BALANCE_DEPLETED = 'GiftCardBalanceDepleted',
  RETAILER_ONDEMAND_HOURS_NOT_AVAILABLE = 'RetailerOnDemandHoursNotAvailable',
  ITEM_QTY_CHANGE = 'ItemQuantityChange',
  MAX_QUANTITY_PER_ORDER_EXCEEDED = 'MaxQuantityPerOrderExceeded',
  PRESALE_EXPIRED = 'PresaleExpired',
  PRESALE_LIMIT_EXCEEDED = 'PresaleLimitExceeded',
  PRESALE_NOT_FOUND = 'PresaleNotFound',
  PRESALE_MIXED_CART = 'PresaleMixedCart',
  PRESALE_ALREADY_IN_CART = 'PresaleAlreadyInCart',
  PRESALE_EXCLUDED_FROM_DISCOUNT = 'PresaleExcludedFromDiscount',
  RETAILER_DOES_NOT_ALLOW_PROMOS = 'RetailerDoesNotAllowPromos',
  RETAILERS_DO_NOT_ALLOW_PROMOS = 'RetailersDoNotAllowPromos',
  RETAILER_DOES_NOT_ALLOW_GIFT_CARDS = 'RetailerDoesNotAllowGiftCards',
  RETAILERS_DO_NOT_ALLOW_GIFT_CARDS = 'RetailersDoNotAllowGiftCards',
}
```

{% endcode %}

### Event Types

#### Checkout Modification Events

* `ItemQuantityChange`: Item quantity reduced from ${originalQuantity} to ${stock} due to limited stock availability

#### Validation Events

* `MaxQuantityPerOrderExceeded:` The maximum quantity per order for this item is ${maxPresaleQuantity}. Quantity has been adjusted accordingly. || Quantity adjusted from ${originalQuantity} to ${quantity} due to presale availability
* `RetailerOnDemandHoursNotAvailable:` The following cart item(s) have been removed due to retailer hours of operation restrictions
* `PresaleExpired:` Presale reservation has expired || This presale has ended
* `PresaleLimitExceeded:` Presale fully reserved || Only ${n} units remaining for presale
* `PresaleNotFound:` Presale configuration not found!
* `PresaleMixedCart:` Presale items cannot be mixed with regular items
* `PresaleAlreadyInCart:` Only one presale can be in the cart. Items of another presale were removed.

#### Promo and Gift Cart Event Cases

* `ErrorProcessingGiftCards:`  There's been an error processing your gift card(s)
* `InvalidGiftCardCodes:`  The gift card code(s) you entered is invalid
* `InvalidGiftCardPartner:`  This gift card cannot be used with this merchant
* `InactiveGiftCard:` This gift card is currently inactive
* `GiftCardAlreadyInUse:`  This gift card has already been used
* `GiftCardExpired:`  This gift card has expired
* `GiftCardBalanceDepleted:`  This gift card has no remaining balance
* `RetailerDoesNotAllowPromos:` This retailer does not accept promo codes || None of the selected retailers accept promo codes || ${retailerNames} does not accept promo codes || Promo code applied. Note: ${retailerNames} does not accept promo codes || Promo code applied to eligible items only. The following retailers do not accept promo codes: ${retailerNames}
* `RetailersDoNotAllowPromos:`  Selected retailers do not accept promo codes || None of the selected retailers accept promo codes || ${retailerNames} does not accept promo codes || Promo code applied. Note: ${retailerNames} does not accept promo codes || Promo code applied to eligible items only. The following retailers do not accept promo codes: ${retailerNames}
* `RetailerDoesNotAllowGiftCards:`  Gift card applied. Note: ${retailerNames} does not accept gift cards || Gift card applied to eligible retailers only. The following retailers do not accept gift cards: ${retailerNames}
* `RetailersDoNotAllowGiftCards:`  ${retailerNames} does not accept gift cards || None of the selected retailers accept gift cards
* `PresaleExcludedFromDiscount:` This coupon does not apply to pre-order items.
