Inventory Intelligence
Build Forecast
Build a replenishment forecast for one or more suppliers and return recommended order quantities per supplier, with a full per-line breakdown of how each number was derived.
Build Forecast (Single Supplier)
Build a forecast for a single supplier. If the product count is large the request is queued as a background job and the response returns a job_id for polling; otherwise the result is returned synchronously.
Get Job Status
Poll the status of a background forecast job dispatched by build-single.
Get Sales History
Get aggregated sales history for products grouped by time period.
List Sales Orders Behind a Forecast Cell
Get individual sales orders for a product (drill-down view). Used when clicking into a product's sales period in the forecast UI.
Create Purchase Orders from Forecast
Create purchase orders from forecast results. Creates a ForecastScheduleRun to track the creation.
Recalculate Costs
Recalculate supplier product costs using a different pricing tier. Used when the user switches pricing tier in the forecast UI.
Get Supplier Summary
Get a summary of suppliers with product counts. Used for lazy-loading supplier tabs in the forecast UI before running the full forecast.
List Forecast Run Lines
List the stored per-line breakdown for a forecast run, paginated. Each line captures the recommended quantity, confidence tier and drivers, and the inventory/sales snapshots that fed the calculation.
Persist Forecast Run Lines
Build a forecast from the supplied configuration and store its per-line breakdown against an existing forecast run. The work runs in the background; the response returns immediately with a job reference to poll for progress.
Get Forecast Run Line
Get the stored forecast run line for a single product within a run, including the full confidence drivers and the inventory and sales snapshots taken at build time.
Get My Default Configuration
Get the current user's default forecast configuration, if one has been set.
Clear My Default Configuration
Unset the current user's default configuration. Subsequent visits to demand planning load with a blank slate.
Set as My Default Configuration
Mark this configuration as the current user's default. The default is loaded automatically in the demand-planning UI on page load.
List Schedules
List all forecast schedules (non-paginated).
Create Schedule
Create a new forecast schedule.
Get Schedule
Get a single forecast schedule with full details.
Update Schedule
Update a forecast schedule. All fields are optional; merges with existing data.
Delete Schedule
Delete a forecast schedule.
Toggle Schedule
Toggle a schedule's enabled/disabled status.
Run Schedule Now
Manually trigger a forecast schedule immediately.
Get Schedule Runs
Get paginated run history for a specific schedule.
Get Schedule Activity Log
Get the Spatie activity log for a specific schedule showing all changes.
Get Schedule Limits
Get supplier run limits status. Shows how many runs are scheduled for each supplier on a given date.
Get Schedule Statistics
Get aggregate statistics for all forecast schedules.
Get Schedule Timeline
Get upcoming schedule runs for a date range.
Get Today's Schedules
Get schedules that run on the given day of the week.
List All Runs
Get all forecast runs across all schedules (both manual and scheduled), paginated. Loads the schedule, triggering user, and linked purchase orders.
Get Recent Runs
Get recent runs (not paginated). Useful for dashboard widgets.
Get Run Details
Get full details for a single forecast run.
Create Manual Run
Create and persist a manual (ad-hoc) forecast run record. Called when users run forecasts manually from the UI.
Link Purchase Orders to Run
Link purchase orders to an existing manual forecast run. Can only be used for manual runs.
Re-run Forecast from Previous Run
Re-run a forecast using the configuration from a previous run.
Export Forecast
Build a forecast and export the results to a file. Returns a download URL/filename.
Download Export File
Download an exported forecast file. The filename is returned from the POST /export endpoint.
Detect Demand Anomalies
Detect one-off demand anomalies (spikes, drops, and stockout gaps) in the daily sales history of one or more products. Runs synchronously, persists each flagged point, and returns them.
List Demand Anomalies
List a product's detected demand anomalies, most recent first, optionally scoped to a single resolution status.
Resolve Demand Anomaly
Record a decision for a single demand anomaly so future forecasts treat the point correctly.
Bulk Resolve Demand Anomalies
Apply the same resolution decision to many demand anomalies at once - the fast path after Detect Demand Anomalies. Unknown IDs are skipped; the response reports how many were actually updated.
List Promo Windows
List all promo windows, including any realised lift (measured_lift_pct) and post-promo dip (post_promo_dip_pct) already measured for each. Use a window's id as the promo_window_id of a promo_lift demand modifier to re-apply its lift on a build.
Create Promo Window
Create a promo window - a named date range, optionally scoped to an order tag, a set of products, and sales channels. A promo window is the anchor for measuring a promotion's demand lift and later re-applying it.
Suggest Promo Windows
Suggest candidate promo windows for a product by clustering its detected upward demand spikes into contiguous date ranges, so a promotion can be confirmed instead of typed by hand.
Get Promo Window
Get a single promo window by ID.
Update Promo Window
Update a promo window. A full representation is expected, mirroring create.
Delete Promo Window
Delete a promo window.
Measure Promo Lift
Measure the realised demand lift during a promo window and the dip in the days after it, for one product. The result is persisted onto the window and returned alongside suggested forward demand modifiers for next year's occurrence.
List Forecast Accuracy
List a product's forecast-accuracy history across runs, paginated. Each entry compares a run's projected demand against the actual quantity sold in the evaluation window.
Evaluate Forecast Accuracy
Backtest a completed forecast run by comparing its projected demand against actual sales, and store the resulting accuracy metrics per product. The work runs in the background; the response returns immediately with a job reference to poll for progress.
Get Run Forecast Accuracy
Get all forecast-accuracy metrics computed for a single forecast run - one entry per evaluated product.
Get Measured Lead Time Coverage Summary
Coverage counts and averages for the measured (purchase-order-derived) lead times available across a forecast scope. Answers, for the selected suppliers and optional destination warehouse, how many supplier-products have a measured lead time versus fall back to the configured value.
List Measured Lead Time Coverage Products
Paginated per-product breakdown of configured versus measured lead time for a forecast scope, including which value would drive the forecast when measured lead times are enabled.
List Measured Lead Time Contributing Purchase Orders
The closed purchase orders a supplier-product's measured lead time is derived from: the same closed-PO population (last 12 months, with submitted, received and estimated delivery dates present) that the measured average is computed over. Each row shows the submitted-to-received span and whether it landed on or before its estimated delivery date.
Get Inventory Aging Report
Paginated inventory aging report.
Get Inventory Aging Metrics
Summary metrics for the aging report: total inventory value at cost, value-weighted average age, product counts (total, slow-moving 180+, dead stock 365+), value at risk (181+ days), and per-bracket value/quantity/percentage breakdowns.
Get Inventory Aging Distribution
Per-bracket distribution for the value-at-risk funnel: quantity, value, percentage of total value and a display color per age bracket. Always returns all six brackets (zeroed when empty).
Get Inventory Aging Trend
Aged-value trend series from nightly snapshots: per-bracket inventory value and quantity per snapshot date, for charting whether aged value is shrinking over time.
Export Inventory Aging to CSV
Stream the aging report as a CSV download. `view=product_summary` exports enriched product rows (including aged value, holding cost, suggested action and recorded action state); the default view exports raw FIFO layer detail.
List Sales Channels (Aging Report Filter Values)
Sales channels that have had sales in the last 90 days — the option list for the sold-on / no-sales-on / not-listed-on channel filters.
Record Product Aging Action
Create or update the aging action state for a product. One state per product:
Clear Product Aging Action
Remove a product's recorded aging action state, returning it to needs-action.
Bulk Record Product Aging Actions
Record the same aging action state for up to 50 products in one call. Field rules match the single-product endpoint (`action_type` required for in_progress, `resolution` required for resolved, `snooze_until` only for accepted).
Generate AI Aging Suggestions
Start a background process that scores aged products with AI and caches a recommended next action on each. Returns a tracked job id you can poll for completion; when the job finishes, the aging report shows the AI-scored suggestions in place of the rule-based ones. If AI is disabled or unavailable for the account, the job completes immediately and rows keep their rule-based suggestions.