Order Validation Rules
Every transition from a draft state (DRAFT
, DRAFT_ON_HOLD
) to a confirmed state (CREATED
) — especially when initiating a payment — is subject to strict order validation rules. These checks are essential to prevent inconsistent or invalid orders from reaching suppliers or payment providers.
🧩 Scope
Validation is enforced in the following situations:
- When calling PAY-101 (Initiate payment)
- When explicitly updating an order from
DRAFT
toCREATED
via ORDER-212 or ORDER-220 - When verifying order readiness before starting a Bank Transfer payment process
Only Checkout V2/V3 orders are eligible for validation. Legacy orders in Checkout V1 are not eligible for this validation layer.
The frontend must be prepared to handle multiple simultaneous validation errors and display them clearly by order line.
⚙️ Validation Logic
✅ If validation is successful:
- The order transitions to
CREATED
- Payment-related workflows (Bank Transfer, Credit Card, etc.) are allowed to proceed
- Logistic order pricing and status updates are triggered where applicable
❌ If validation fails:
- An error response is returned immediately
- The frontend must display detailed line-level feedback to the customer
- No payment can be initiated and the order remains unchanged
🛑 Validation Errors
🔐 Authentication & Authorization
Code | Message |
---|---|
OR0026 | Access denied - The user does not have permission to validate the order |
F-E-030 | Access denied - The user does not have access to the order or lacks the required role |
📦 Order Existence
Code | Message |
---|---|
OR0001 | Commercial order not found |
OR0002 | Logistic order not found |
🔄 Status Constraints
Code | Message |
---|---|
OR0020 | Cannot update the order to CREATED - current status is already beyond CREATED |
OR0033 | The commercial order has already been validated |
🏷️ Delivery & Billing Information
Code | Message |
---|---|
OR0014 | Shipping address is missing |
OR0015 | Billing address is missing |
OR0016 | Shipping type is missing |
📏 Order Content Validation
Code | Message |
---|---|
| Invalid order - reasons may include:
|
💳 Payment Eligibility
Code | Message |
---|---|
OR0023 | No payment provider configured and non-payment orders are not allowed |
OR0001 | Invalid payment option (e.g. BANK_WIRE_ON_DUE_DATE ) for this customer account |
❗ Other Errors
Code | Message |
---|---|
OR0022 | Cannot initialize order - the cart contains no items |
OR0005 | Failed to calculate logistic item prices |
🔁 Post-Validation Workflows
If the validation is successful:
- Payment processing or logistic confirmation may continue
If the validation fails:
- No downstream action (payment/logistics) is triggered
- The user is required to correct the issues and resubmit
Updated 4 months ago