Demand forecasting for Shopify merchants: a complete beginner's guide
What a demand forecast is, what data you need from Shopify, how to clean it, and how to turn a weekly forecast into a purchase order — with every number worked through.
Stokrio Team · · 7 min read
Most Shopify brands start forecasting the same way: someone opens last month's sales report, eyeballs the best-sellers and rounds up. That works with twenty products and one supplier. It stops working when you have hundreds of variants, suppliers with different lead times and a Q4 that looks nothing like March.
This guide covers the fundamentals in the order you actually need them. No statistics degree required — just a spreadsheet and some patience with your data.
Key takeaways
- A forecast is a rate of demand per period for one product, over a horizon that matches how far ahead you have to buy.
- Clean the history before you model it. Stockouts, wholesale orders, bundles and refunds distort it more than any choice of model.
- Start with a moving average or simple exponential smoothing. Add trend and seasonality only when the data shows them.
- A forecast is not an order. You turn it into one by covering lead time plus the gap until your next order, then subtracting stock you already have.
- Measure accuracy every month, or you'll never know whether your method is helping.
What a forecast actually is
A demand forecast answers one narrow question: how many units of this product will customers want in each future period? Three parts of that sentence matter.
- This product. Forecast at the level you buy. If you order a t-shirt by size, you need size-level demand, not a total for the style.
- Want, not sold. Sales are demand you could fulfil. If you were out of stock, sales understate demand. We'll come back to this.
- Each future period. Weekly buckets suit most Shopify brands: daily data is too noisy to model, monthly is too coarse to catch a sell-out early.
The horizon — how far ahead you forecast — should be at least your supplier lead time plus the time until you next place an order. If a supplier takes six weeks and you order every two weeks, anything you decide today has to last eight weeks. Forecasting beyond that is useful for budgeting, but it's not what drives today's purchase order.
The data you need
From Shopify you need line-item sales by variant, by day. The orders export gives you this. You also want, if you can get it:
- Daily stock levels, so you know which days a product was available to buy.
- Open purchase orders, so you know what's already on its way.
- Supplier lead times, ideally measured from when you sent each order to when it arrived, not the number on the supplier's website.
Daily stock history is the one most brands are missing. Shopify shows you today's inventory, not last Tuesday's. If you don't have it, start recording it now — a nightly snapshot of available quantity per variant is enough. In six months you'll be glad you did.
Clean the history first
Bad inputs beat good models every time. Before forecasting anything, work through this list:
- Stockout days. A day with zero stock and zero sales tells you nothing about demand. Treat it as missing, not as zero. Our guide to stockout-adjusted velocity works through the arithmetic.
- Wholesale and one-off orders. A single 200-unit order from a retailer is not a signal that consumer demand tripled. Forecast it separately or remove it.
- Bundles and kits. If you sell a gift set containing three products, each sale of the set is demand for each component. Explode bundles into components before you add up units.
- Refunds and cancellations. Cancelled orders never shipped. Remove them. Returns are a judgement call — for most brands, gross units sold is the better demand signal.
- Promotions. A 40% off weekend shows you what happens during a sale, not what normal weeks look like. Flag promotional periods so you can exclude or adjust them.
Your first forecast: a moving average
Take one variant — a scented candle — with these weekly sales over the last eight weeks, all of them fully in stock:
| Week | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|---|---|---|---|---|---|---|---|---|
| Units | 40 | 44 | 38 | 42 | 46 | 50 | 48 | 52 |
The eight weeks add up to 360 units, so the eight-week average is:
360 ÷ 8 = 45 units per weekThe last four weeks add up to 46 + 50 + 48 + 52 = 196, an average of 49 per week. The first four add up to 40 + 44 + 38 + 42 = 164, an average of 41. That gap is the first thing a moving average can't tell you: demand is rising, by roughly 8 units per week every four weeks, or about 2 units per week per week.
A long window gives you a stable number that lags behind change. A short window keeps up, but jumps around. There's no universally right window; it depends on how noisy the product is.
Exponential smoothing: a better default
Simple exponential smoothing (SES) is a weighted average where recent weeks count more. Each week you update the level:
new level = α × this week's sales + (1 − α) × previous levelWith α = 0.3 and the level started at week 1's sales of 40:
| Week | Sales | Level after the week |
|---|---|---|
| 1 | 40 | 40.0 |
| 2 | 44 | 0.3 × 44 + 0.7 × 40.0 = 41.2 |
| 3 | 38 | 0.3 × 38 + 0.7 × 41.2 = 40.2 |
| 4 | 42 | 0.3 × 42 + 0.7 × 40.2 = 40.8 |
| 5 | 46 | 0.3 × 46 + 0.7 × 40.8 = 42.3 |
| 6 | 50 | 0.3 × 50 + 0.7 × 42.3 = 44.6 |
| 7 | 48 | 0.3 × 48 + 0.7 × 44.6 = 45.6 |
| 8 | 52 | 0.3 × 52 + 0.7 × 45.6 = 47.6 |
(Each row uses the unrounded level from the row above.) The SES forecast for every future week is 47.6. It reacts faster than the eight-week average of 45, but it still sits well below the latest week of 52, because SES assumes there's no trend. When there is one, it will always lag.
That's what trend methods fix. Holt's method adds a second smoothed number — the slope — and projects it forward. A damped trend lets that slope fade over the horizon, which is usually safer: growth rarely continues in a straight line forever, and over-projecting a trend is an expensive way to end up with excess stock.
Seasonality is the third layer. If the candle sells three times as much in November as in May, no amount of trend fitting will capture that. We cover it in our guide to seasonal demand forecasting.
Choosing a method without guessing
You don't need to pick one method for your whole catalogue. The robust approach is to let each product's own history decide:
- Hold back the last few weeks of history.
- Forecast those weeks with each candidate method, using only data from before them.
- Compare the errors, and repeat from several different starting points.
- Keep the method with the lowest error — and if two are close, keep the simpler one.
This is called backtesting, and it stops you choosing a clever model that just happened to fit the past. It also gives you an accuracy number per product, which is worth having on its own. If you'd rather not run it in a spreadsheet, Stokrio's demand forecasting backtests a set of models — exponential smoothing, damped trend, Holt-Winters, seasonal profiles and intermittent-demand methods — on each product's history and keeps the most accurate one.
Products that sell a unit here and there need different treatment altogether; see forecasting slow and lumpy sellers.
From forecast to purchase order
Suppose you've settled on a forecast of 49 units per week for the candle — the recent four-week average, a reasonable compromise between the lagging SES level and an undamped trend. The supplier lead time is 6 weeks and you place orders every 2 weeks, so this order must cover 8 weeks:
demand to cover = 49 × 8 = 392 unitsYou hold one week of demand as safety stock, 49 units, to absorb forecast error and late deliveries:
target stock = 392 + 49 = 441 unitsYou have 180 units on hand and 100 on an open purchase order:
order quantity = 441 − (180 + 100) = 161 unitsThen apply your supplier's constraints. If the candle comes in cartons of 24, round 161 up to 168 (7 cartons). If the minimum order is 200, you either order 200 or wait two weeks and combine it with the next order.
One week of safety stock is a rule of thumb. A more rigorous safety stock uses the forecast error and the variability of the lead time; our guide to safety stock and reorder points shows the formula. Stokrio's replenishment does this calculation per product and rounds to MOQs and case packs.
Measure, then improve
Once a month, compare what you forecast with what sold. Two numbers will tell you most of what you need:
- WAPE — total absolute error divided by total actual sales. Lower is better.
- Bias — total forecast minus total actual, divided by total actual. Positive means you're consistently forecasting too high; negative, too low.
Bias is the one to fix first. Random error averages out; bias quietly builds excess stock or causes repeated stockouts. Our guide to measuring forecast accuracy covers both with worked numbers, and explains why the popular MAPE metric misleads.
A sensible first month
If you're starting from nothing, here's a realistic plan:
- Export 12 months of orders and build a weekly units table per variant.
- Start recording daily stock levels.
- Flag stockouts, wholesale orders and promotions.
- Forecast your top 20% of products by revenue with exponential smoothing; use a simple 8-week average for the rest.
- Turn the forecasts into order quantities with the lead-time-plus-review-period calculation above.
- Next month, measure WAPE and bias for each product and adjust.
You'll learn more from one month of measured forecasts than from any amount of reading about models.