Create Purchase Orders from Forecast
POST/api/inventory-forecasting/purchase-orders
Create purchase orders from forecast results. Creates a ForecastScheduleRun to track the creation.
Authentication: Requires Bearer token.
approval_status: draft (default) or approved — if approved, auto-approves the PO after creation.
submit_to_supplier: if true, submits the PO to the supplier after creation.
fore cast_config is optional but recommended for tracking — stores a snapshot of the config used.
Also syncs backorder coverage for all new PO lines.
Returns 422 if no valid orders provided.
Supplier minimum enforcement: when forecast_config.enforce_minimum_order_value or forecast_config.enforce_minimum_order_quantity is true and the order totals fall below the supplier's minimum_purchase_order or minimum_purchase_order_quantity, the request is rejected with 422 unless minimums_acknowledged is true on that order.
Request
Responses
- 200
Successful response