1. The Stockout Death Spiral Explained
Almost every growing e-commerce brand has experienced this paradox: your single best-selling SKU sells out mid-month, yet your reorder spreadsheet tells you to order fewer units next time than you ordered last time.
The culprit is censored demand. When Shopify marks a variant as sold out
(available ≤ 0), shoppers cannot purchase it, so daily sales drop to zero. A naive
forecasting tool divides total units sold over the lookback window by total calendar days:
If a bestseller sells 10 units per day for 18 days and then spends 12 days out of stock, it logs
180 units sold in 30 days. Naive math calculates 180 ÷ 30 = 6.0 units/day — a 40%
underestimate. When you reorder based on 6.0 units/day, the next shipment runs out even earlier
in the month, pushing next month's naive average down to 4.5 units/day. Over three cycles,
your highest-margin product starves for stock while slow movers accumulate surplus capital.
2. In-Stock Velocity & Safe Clamping Formulas
Stockout-adjusted forecasting removes out-of-stock days from the denominator — and adds two statistical guardrails so edge cases (such as a SKU that was only in stock for 1 day during a flash drop) never blow up your purchase order.
15 units/day (450/month!),
which would cause a massive overbuy. With a 5-day floor and 4× uplift cap, velocity is safely
clamped to min(15 ÷ 5, 0.5 × 4) = 2.0 units/day until genuine multi-day sales history
accumulates.
3. Numeric Comparison Across 4 Real Store Scenarios
The table below compares naive 30-day velocity, unclamped in-stock velocity, and StockPilot's clamped velocity (5-day floor, 4× uplift cap) across four real Shopify merchandising cases with a 30-day lookback and 30-day reorder lead + buffer window:
| SKU Scenario (30-Day Window) | Units Sold / OOS Days | Naive Velocity | Unclamped Adjusted | Clamped Velocity | 30d Stock Delta vs. Naive |
|---|---|---|---|---|---|
| Steady In-Stock Core SKU | 300 units / 0 OOS | 10.0 / day | 10.0 / day | 10.0 / day | 0 units (exact match) |
| Mid-Month Bestseller Stockout | 180 units / 10 OOS | 6.0 / day | 9.0 / day | 9.0 / day | +90 units protected |
| Severe Supplier Delay Stockout | 140 units / 20 OOS | 4.67 / day | 14.0 / day | 14.0 / day | +280 units protected |
| 1-Day Restock Spike (Edge Case) | 15 units / 29 OOS | 0.50 / day | 15.0 / day (overbuy!) | 2.00 / day (4× cap) | Prevents 390-unit overbuy |
4. Why Daily Stock Snapshots Beat Order-Date Guessing
Shopify's Admin API stores historical order timestamps, but it does not expose a native daily historical inventory ledger per variant and location. Some apps try to guess stockouts by scanning for gaps between orders. That heuristic breaks immediately on medium-velocity SKUs (where 3 days with zero orders can simply be normal variance, not a stockout) and fails completely on multi-location setups where Store A is sold out while Warehouse B still has stock.
Running an automated daily inventory snapshot per SKU (and per location on Multi-Location plans)
records ground-truth availability each day. Every day where available ≤ 0 increments
the verified out-of-stock day counter for that lookback window, giving your purchasing team
auditable numbers instead of guesswork.
5. Combining Stockout Adjustment with Seasonality & Safety Stock
Stockout-adjusted velocity tells you true recent demand under normal stock availability. Two additional levers handle forward-looking risk:
-
Seasonality Multiplier: Apply a multiplier such as
1.3×to1.8×60 days ahead of Q4 / Black Friday Cyber Monday (BFCM) — or0.8×for post-holiday cool-down — without altering your historical baseline. -
Safety Stock Days: Buffer against real-world supplier variance (customs
inspections, port congestion, factory QA rework). A practical starting rule for Shopify brands is
30%–50% of supplier lead time(for example, 7–10 safety days on a 21-day lead time, or 14–21 safety days on a 45-day ocean shipment). - Overstock Detection (>90 Days Cover): Flagging slow-moving SKUs above 90 days of cover helps finance teams discount or bundle trapped inventory to fund fast-turning bestseller POs.
6. Forecast Calibration Checklist
- Enable automated daily stockout snapshot tracking so out-of-stock days are logged per SKU and location.
- Set accurate per-supplier lead times and vendor MOQ / case-pack quantities before running your first forecast.
- Use a 30-day lookback for high-velocity DTC staples and a 60-day window for slower-turning or seasonal items (matching Shopify's standard
read_orders60-day order history scope). - Keep small-sample clamping active (5-day minimum in-stock denominator and 4× uplift cap) to protect cash against brief restock spikes.
- Review revenue-at-risk estimates on CRITICAL SKUs first so limited working capital always funds your highest-margin bestsellers.
7. Frequently Asked Questions
Why does standard 30-day average daily sales under-order Shopify bestsellers?
Standard 30-day velocity divides units sold by all 30 calendar days even when a variant was out of stock and unbuyable for part of the month. Dividing by 30 instead of actual in-stock days suppresses apparent demand and causes progressively smaller reorders.
What happens if a SKU was only in stock for 1 or 2 days during a 30-day window?
Without clamping, a brief restock burst can extrapolate into a massive over-order. StockPilot enforces a minimum effective in-stock denominator floor (default 5 days) and a maximum velocity uplift cap (default 4× raw velocity) to prevent small-sample explosions.
How should I choose between 30-day and 60-day lookback windows?
Shopify's standard read_orders scope provides the last 60 days of order
history, so StockPilot supports 7-, 14-, 30-, and 60-day lookback windows. Use 30 days for
fast-moving consumer goods and active paid-ad campaigns, 60 days for balanced apparel,
homeware, or slower-turning SKUs that need the full 60-day baseline, and 7- to 14-day
windows when measuring short promotional surges.
Stop Under-Ordering Your Shopify Bestsellers
Try StockPilot's stockout-adjusted velocity engine, landed-cost calculator, and 1-click vendor POs free for 14 days — flat US$39/mo with zero GMV tax.