Ecommerce demand forecasting

Anticipate which products will sell, how many and when to optimise inventory and maximise revenue

9 min

Demand forecasting is the process of estimating how many products will sell in a future period. In ecommerce, an accurate forecast is the difference between having enough stock to meet demand and losing sales to stockouts, or between managing capital well and having warehouses full of unsold product.

According to IHL Group, stockouts cost global retail $1.14 trillion annually in lost sales, while overstock generates $562 billion in losses. Predictive demand models tackle both problems simultaneously.

Demand forecasting methods

Methods range from simple statistical techniques to deep learning models processing hundreds of variables. The choice depends on available data volume, SKU count and demand variability.

  • Moving average: averages demand over the last N periods. Simple but doesn’t capture trends
  • Exponential smoothing (Holt-Winters): gives more weight to recent data and captures trend and seasonality
  • ARIMA/SARIMA: statistical models capturing autocorrelation and seasonal patterns
  • Prophet (Meta): designed for data with strong seasonality and special events (Black Friday, Christmas)
  • XGBoost / LightGBM: ML models that can incorporate external variables (weather, promotions, competition)
  • Deep learning (LSTM, Transformer): for very large catalogues with complex inter-product relationships

Data needed to forecast demand

A demand forecasting model needs historical sales data at minimum. But accuracy improves significantly by incorporating additional data that explains why demand varies: promotions, pricing, seasonality, external events and web behaviour.

  • Historical sales: units sold by SKU, day and channel. Minimum 12–24 months
  • Pricing data: price history and discounts applied by product
  • Promotional calendar: campaign dates, discounts, launches
  • Seasonality: patterns by month, day of week, holidays
  • External data: weather, economic indicators, search trends (Google Trends)
  • Browsing data: products viewed, added to cart, wishlisted

Inventory optimisation with forecasting

Demand forecasting directly feeds inventory decisions: how much to buy, when to place orders and how to distribute stock across warehouses or fulfilment centres. The goal is to minimise total inventory cost (purchase cost + storage cost + stockout cost).

Advanced models calculate the optimal reorder point for each SKU: the stock level below which a replenishment order should be triggered, considering supplier lead time and demand variability. This is automated with alerts or direct integrations to the purchasing system.

Managing seasonal patterns

Seasonality is one of the biggest forecasting challenges in ecommerce. Demand peaks (Black Friday, Christmas, summer sales) can multiply sales by 3–10x compared to a normal day. A model that doesn’t capture seasonality will underestimate peak demand and overestimate during troughs.

Time series models like Prophet handle multiple seasonality well (weekly, monthly, annual). But non-recurring events (a social media viral moment, a press mention) require manual intervention or models incorporating real-time data.

  • Weekly seasonality: patterns by day (peaks on Monday, troughs on Saturday, etc.)
  • Monthly/annual seasonality: strong vs weak months by product category
  • Commercial events: Black Friday, Prime Day, sales with predictable impact
  • Non-recurring events: viral moments, media mentions, regulatory changes

Forecasting accuracy metrics

Measuring forecasting accuracy is essential for improving models and building trust with the operations team. The most used metrics compare predicted demand against actual demand.

  • MAPE (Mean Absolute Percentage Error): average percentage error. A 15% MAPE means predictions deviate 15% on average
  • WMAPE (Weighted MAPE): weighted by sales volume, giving more weight to higher-demand products
  • Bias: indicates whether the model tends to overestimate (positive) or underestimate (negative) demand
  • Fill rate: percentage of orders that can be fulfilled with available stock

Tools and platforms

Tools range from spreadsheets with simple models to specialised SaaS platforms and custom solutions built with Python or R.

  • Inventory Planner / Stockly: specialised SaaS for ecommerce forecasting with direct Shopify integration
  • Amazon Forecast: managed AWS ML service for time series
  • Google BigQuery ML: build ARIMA+ models directly in SQL on your data
  • Python (statsmodels, Prophet, scikit-learn): maximum flexibility for custom models
  • Lokad: quantitative supply chain platform with a probabilistic approach

Key Takeaways

  • Stockouts and overstock cost global retail trillions each year
  • The forecasting method should match your data volume and demand variability
  • Pricing, promotional and seasonality data significantly improve accuracy
  • Automate reorder points so forecasting translates into action
  • Measure accuracy with MAPE and bias to continuously improve models

Want to forecast demand for your ecommerce?

We build forecasting models tailored to your catalogue, data and operations so you never run short on stock or carry excess inventory.