Inventory ATP Validator

Validates inventory availability using Available-to-Promise (ATP) data, including future delivery dates.

Overview

The Inventory ATP Validator checks product availability using Available-to-Promise (ATP) data, which accounts for projected future inventory changes. This validator is particularly useful when orders have a requested delivery date, as it can validate availability at that future point in time.

Identifier

PropertyValue
Connector IDinventoryAtpValidator
Validation TypeGeneral

Behavior

  1. If the cart's order type is PreOrder, validation is skipped (always passes)
  2. If the cart has no line items, returns a "Cart is empty" error
  3. Resolves the relevant warehouses:
    • Uses the warehouse from the first shipment's WarehouseCode or PickUpWarehouseCode if set
    • Falls back to the cart's store and its available warehouses
    • Falls back to all warehouses if no store is set
  4. Fetches product data and inventory data
  5. For each line item:
    • Skips virtual products and products in the "service" catalog
    • Calculates current availability: Quantity - ReservedQuantity + CalculatedQuantity
    • If a RequestedDeliveryDate is set on the cart, also calculates ATP availability by summing ATP entries with dates before the requested delivery date
    • If the requested quantity exceeds current availability, checks against ATP availability
    • Returns a validation error if both current and ATP availability are insufficient
  6. Returns one validation error per SKU that fails the check
  7. Without a requestedDeliveryDate on the order, ATP is never consulted — not even for a line item already reserved against an incoming purchase order (isAwaitingPurchaseOrder: true) — so such lines need current physical stock or a covering requestedDeliveryDate to pass

Data validated

DataSourceField(s)
Requested quantityThe line itemquantity
Current availabilityThe inventory item for the SKU in each resolved warehouseinventory, reservedInventory, calculatedInventory
Incoming stock (only when requestedDeliveryDate is set)The ATP entries on the same inventory itematp[].date, atp[].availableQuantity
Requested delivery dateThe orderrequestedDeliveryDate
Warehouse(s) to checkThe first shipment, else the store's available warehouses, else all warehouseswarehouseCode, pickUpWarehouseCode

Error messages

ConditionTranslation KeyError Code
Cart has no line itemsCartIsEmptyCartIsEmpty
Insufficient stock for SKUInventoryValidatorErrorMessageInsufficientInventory

Configuration

No additional properties required.

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

On this page