Skip to main content

Create Forecast Configuration

POST 

/api/inventory-forecasting/configurations

Creates a new forecast configuration.

Authorization

Any valid API token can call this endpoint — no specific scope required. Manage tokens.

Required fields:

  • name (string, max 255, unique among non-deleted configurations)
  • supplier_ids (array of integers, min 1, must exist in suppliers table)
  • forecast_type (enum: with_sales_history, target_stock_level, fill_backorders)
  • target_stock_days (integer 0-365) — required for with_sales_history. Optional for target_stock_level (allows 0 when use_min_stock_level_as_target is true) and fill_backorders (ignored)

Optional fields:

  • description (string, max 1000)
  • target_quantity (integer, min 0) — fixed target quantity used by target_stock_level forecast type
  • use_min_stock_level_as_target (boolean) — when true, target_stock_level forecasts use each product's minimum stock level as the target instead of a fixed target_quantity. Persisted on both create and update.
  • sales_history_days (integer 1-365) — used by with_sales_history forecast type
  • sales_start_date / sales_end_date (Y-m-d) — alternative date range for sales history
  • use_leadtime (boolean)
  • use_moq (boolean)
  • enforce_minimum_order_value (boolean) — enforces supplier minimum order value when generating POs
  • enforce_minimum_order_quantity (boolean) — enforces supplier minimum order quantity when generating POs
  • use_case_pack (boolean) — round order quantities to supplier case-pack multiples
  • case_pack_rounding (enum: always_round_up, always_round_down, round_nearest) — how to round to the case-pack multiple
  • ignore_min_stock_level (boolean) — skip the per-product minimum stock level constraint when computing demand
  • rounding_method (enum: round_half_up, round_half_down, always_round_up, always_round_down, no_rounding)
  • destination_warehouse_id (integer, must exist in warehouses table)
  • pricing_tier_id (integer, must exist in supplier_pricing_tiers table)
  • product_filters (array) — filter criteria applied to candidate products
  • sales_filters (array) — filter criteria applied to sales history
  • demand_modifiers (array) — adjustments to projected demand

Authentication: Requires Bearer token.

Baseline decomposition fields (persist onto the saved configuration and drive scheduled runs):

  • baseline_method (enum: flat default, recency_weighted, damped_trend) — how the daily velocity baseline is derived from sales history.
  • trend_damping_factor (number 0..1, default 0.85) — damping factor phi for damped_trend; lower = more damping.
  • trend_max_growth_pct (number >= 0, default 100) — caps how far the trend may lift the baseline above the flat mean (100 = may at most double it). When the cap binds a line reports trend_capped: true.
  • trend_half_life_days (integer >= 1, nullable, default 21) — reserved tuning for recency_weighted.
  • exclude_detected_anomalies (boolean, default false) — when true, days resolved as excluded or smoothed anomalies are dropped/replaced before the baseline is computed, de-contaminating promo spikes and stockout gaps.

These persist onto the configuration, so a schedule attached to it re-applies the same trend and anomaly-cleansing settings on every run. Baseline settings are ignored for fill_backorders.

Request

Responses

Created

Response Headers
    Content-Type