Validation
How cart validation works in Omnium — ensuring carts are valid before they become orders.
Introduction
Validation in Omnium ensures that a cart meets all business requirements before it can be converted into an order. When a cart is validated, Omnium runs all configured validators and collects any errors or warnings. If validation fails, the cart cannot proceed to order creation until the issues are resolved.
Validators are executed automatically when:
- The cart is modified in the Omnium UI
- The cart is opened in the Omnium UI
- The cart is modified via the API
Validation can also be triggered manually via the Cart Validate endpoint, and can be configured to only run manually by enabling the IsCartValidatedManually setting in Cart Configuration.
Each validator returns a ValidationResult that can contain:
- Validation errors — block the cart from becoming an order
- Validation warnings — displayed to the user but do not block order creation
Omnium ships with a set of built-in validators covering common scenarios such as inventory checks, payment validation, and product availability. You can also implement custom validators using webhooks. See Cart Configuration for details on how to add and configure validators.
