Inventory Validator
Validates that all products in the cart have sufficient stock across the relevant warehouses.
Overview
The Inventory Validator is the primary inventory validation mechanism. It checks that each line item in the cart has enough available stock across the relevant warehouses. It supports warehouse resolution from store configuration, shipment-level warehouse assignments, assortment filtering, and configurable order type restrictions.
Identifier
| Property | Value |
|---|---|
| Connector ID | inventoryValidator |
| Validation Type | Inventory |
| Validation Scope | LineItem |
Behavior
- Checks if inventory validation is enabled for the cart's order type (see Configuration below)
- If the cart has no line items, returns a "Cart is empty" error
- Resolves the relevant warehouses:
- Uses the cart's store and its configured available warehouses
- Includes warehouses referenced in shipments
- Falls back to all warehouses if no store is set
- Fetches product data and inventory data in parallel
- For each line item:
- Skips virtual products, backorder products, and products in the "service" catalog
- Skips products where the category has
IsInventoryValidationDisabledset totrue - Skips non-promotion products if
IsInventoryValidationDisabledForNonPromotionsis enabled - Filters inventory by assortment (product
StoreIds) unless the order type is inIgnoredOrderTypesForAssortmentInventoryValidator - Calculates available quantity:
Quantity - ReservedQuantity + CalculatedQuantity(negative values treated as zero) - If a shipment has a specific warehouse assigned, only checks that warehouse
- Tracks cumulative demand per SKU across multiple line items with the same product
- Returns a validation error for each line item where the requested quantity exceeds available stock
Error messages
| Condition | Translation Key |
|---|---|
| Cart has no line items | CartIsEmpty |
| Insufficient stock for SKU | InventoryValidatorErrorMessage |
Configuration
The Inventory Validator supports optional configuration properties in the connector settings.
| Property | Type | Description |
|---|---|---|
OrderTypes | string | Comma-separated list of order types to validate. If empty, all order types are validated. |
Tenant settings
The following settings from InventoryManagement in tenant settings also affect this validator:
| Setting | Type | Description |
|---|---|---|
IsInventoryValidationDisabledForNonPromotions | bool | When enabled, skips inventory validation for products that are not part of a promotion |
IgnoredOrderTypesForAssortmentInventoryValidator | list | Order types that should skip assortment-based inventory filtering |
