Cart Validators
Reference for all built-in cart validators in Omnium.
Overview
Omnium provides the following built-in cart validators. Each validator implements the IValidator<IOrder> interface and is registered as a connector. To enable a validator, add it to the Connectors section in tenant settings with the IValidator implementation.
| Validator | Connector ID | Description |
|---|---|---|
| Active Products | activeProductsValidator | Ensures all products in the cart are active |
| Credit Limit | creditLimitValidator | Validates customer credit availability |
| Discount | discountValidator | Validates discount configuration |
| Inactive Customer | inactiveCustomerValidator | Blocks checkout for inactive customers |
| Inventory | inventoryValidator | Validates stock availability across warehouses |
| Inventory ATP | inventoryAtpValidator | Validates availability using Available-to-Promise data |
| Null Price | nullPriceValidator | Ensures all line items have a non-zero price |
| Payments | paymentsValidator | Validates that payment amounts match the order total |
| Pricat ID | priCatIdValidator | Validates Pricat IDs on pre-orders |
| Promotion Coupon | promotionCouponValidator | Validates and removes invalid coupon codes |
| Recalculate Cart Prices | recalculateCartPricesValidator | Recalculates line item prices from current product data |
| Required Fields | RequiredFieldsValidator | Ensures required order fields are populated |
| Sales Limitation | salesLimitationValidator | Enforces product sales restrictions per customer and market |
| Shipment | shipmentValidator | Ensures at least one shipment is selected |
| Webhook | webhookValidator | Delegates cart validation to an external HTTP endpoint |
Connector configuration
To enable a built-in validator, add it to the connectors array in tenant settings:
Some validators accept additional configuration via the properties array. Refer to each validator's page for details.
Restricting a validator to order types
A validator can be limited to specific order types with the enabledForOrderTypes and disabledForOrderTypes arrays on its connector entry. The values are order type names as configured for the tenant (for example Online, Pos, B2B).
- When both fields are omitted or empty, the validator runs for all order types.
disabledForOrderTypesskips the validator for the listed order types, and overridesenabledForOrderTypes.- When
enabledForOrderTypesis set, the validator runs only for the listed order types. A cart without an order type does not run these validators. - Matching is case-insensitive.
The restriction always applies — a validator outside the cart's order type is skipped even when requested by name in the validators array on Validate or Checkout.