Skip to main content

Create Forecast Configuration

POST 

/api/inventory-forecasting/configurations

Creates a new forecast configuration.

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: sales_history, target_quantity, fill_backorders)
  • target_stock_days (integer 0-365) — required for 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) — used by target_quantity forecast type
  • sales_history_days (integer 1-365) — used by 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
  • rounding_method (enum: round_half_up, round_up, 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

Note: When forecast_type is fill_backorders, the controller strips boolean product filters (has_moq, has_leadtime, supplier_in_stock, has_sales_history) and forces target_stock_days and sales_history_days to null.

Authentication: Requires Bearer token.

Request

Responses

Successful response