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 to CREATED 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

CodeMessage
OR0026Access denied - The user does not have permission to validate the order
F-E-030Access denied - The user does not have access to the order or lacks the required role

📦 Order Existence

CodeMessage
OR0001Commercial order not found
OR0002Logistic order not found

🔄 Status Constraints

CodeMessage
OR0020Cannot update the order to CREATED - current status is already beyond CREATED
OR0033The commercial order has already been validated

🏷️ Delivery & Billing Information

CodeMessage
OR0014Shipping address is missing
OR0015Billing address is missing
OR0016Shipping type is missing

📏 Order Content Validation

Code

Message

OR0028

Invalid order - reasons may include:

  • Inactive offer (inventory or price) / supplier / product /variant
  • Invalid quantity
  • Insufficient stock
  • Quantity constraints (min, max, pack size mismatch)

💳 Payment Eligibility

CodeMessage
OR0023No payment provider configured and non-payment orders are not allowed
OR0001Invalid payment option (e.g. BANK_WIRE_ON_DUE_DATE) for this customer account

❗ Other Errors

CodeMessage
OR0022Cannot initialize order - the cart contains no items
OR0005Failed 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