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.

ValidatorConnector IDDescription
Active ProductsactiveProductsValidatorEnsures all products in the cart are active
Credit LimitcreditLimitValidatorValidates customer credit availability
DiscountdiscountValidatorValidates discount configuration
Inactive CustomerinactiveCustomerValidatorBlocks checkout for inactive customers
InventoryinventoryValidatorValidates stock availability across warehouses
Inventory ATPinventoryAtpValidatorValidates availability using Available-to-Promise data
Null PricenullPriceValidatorEnsures all line items have a non-zero price
PaymentspaymentsValidatorValidates that payment amounts match the order total
Pricat IDpriCatIdValidatorValidates Pricat IDs on pre-orders
Promotion CouponpromotionCouponValidatorValidates and removes invalid coupon codes
Recalculate Cart PricesrecalculateCartPricesValidatorRecalculates line item prices from current product data
Required FieldsRequiredFieldsValidatorEnsures required order fields are populated
Sales LimitationsalesLimitationValidatorEnforces product sales restrictions per customer and market
ShipmentshipmentValidatorEnsures at least one shipment is selected
WebhookwebhookValidatorDelegates cart validation to an external HTTP endpoint

Connector configuration

To enable a built-in validator, add it to the connectors array in tenant settings:

{
  "name": "inventoryValidator",
  "implementations": ["IValidator"],
  "disableStandardErrorPolicy": false
}

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).

{
  "name": "creditLimitValidator",
  "implementations": ["IValidator"],
  "enabledForOrderTypes": ["B2B"],
  "disabledForOrderTypes": ["Pos"]
}
  • When both fields are omitted or empty, the validator runs for all order types.
  • disabledForOrderTypes skips the validator for the listed order types, and overrides enabledForOrderTypes.
  • When enabledForOrderTypes is 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.

On this page