DEV Community

AppVerix
AppVerix

Posted on

Restock planning on Shopify: knowing what to reorder before you run out

Running out of a best-seller rarely happens suddenly. The signal is in your sales and stock data weeks earlier; it just isn't shown anywhere by default. In this post I'll walk through the simple math behind reorder planning (days of stock left, stockout date, order-by date), how to do it in a spreadsheet, and where a tool helps. Disclosure: I'm on the AppVerix team and we make a Shopify app for this, mentioned once near the end.

1. What a stockout actually costs

When a product sells out, the obvious loss is the orders you can't take while it's gone. But there are quieter costs too:

  • Shoppers who leave and don't come back. Someone who lands on a "Sold out" page may buy the same thing elsewhere, and that store now has their email.
  • Lost momentum. A product that was selling steadily stops generating sales, reviews and repeat purchases. Ads pointed at it waste budget or have to be paused, and marketplace or search ranking that depends on recent sales can slip.
  • Rush costs. Reordering in a panic often means paying for faster shipping, accepting worse supplier terms, or buying more than you need "just in case".

I won't put a number on these, because it depends entirely on your store. The point is that a stockout is almost always more expensive than ordering a little earlier, and ordering earlier only takes a bit of arithmetic.

2. Days of stock left

The core number is days of stock left:

days of stock left = units on hand / average units sold per day
Enter fullscreen mode Exit fullscreen mode

Worked example (made-up numbers): you have 120 units of a blue T-shirt, size M. Over the last 30 days you sold 90 units of that variant, so the average is 90 / 30 = 3 units per day.

120 / 3 = 40 days of stock left
Enter fullscreen mode Exit fullscreen mode

Two details matter here:

  • Calculate per variant, not per product. "Blue T-shirt" might have 400 units in total, but if size M has 12 left and size XXL has 200, the product total hides the problem. Sizes and colours sell at very different speeds.
  • Calculate per location if you ship from more than one. If a warehouse in one region is empty, stock sitting in another location may not help, or may cost more to ship. Each location has its own on-hand count and its own sales rate.

Pick a sales window that fits your business. 30 days reacts quickly to change; 60 or 90 days smooths out noise. If you had a big promotion or a stockout inside the window, those days will distort the average, so consider excluding them.

3. Stockout date and order-by date

Once you know days left, the stockout date is just:

stockout date = today + days of stock left
Enter fullscreen mode Exit fullscreen mode

But the date that matters is when you must place the order. That depends on your supplier's lead time: the days between sending a purchase order and having the stock on your shelf, ready to sell.

order-by date = stockout date - supplier lead time
Enter fullscreen mode Exit fullscreen mode

Continuing the example (still made-up numbers): today is 2 November, you have 40 days of stock, so you run out around 12 December. Your supplier takes 21 days from order to delivery.

order-by date = 12 December - 21 days = 21 November
Enter fullscreen mode Exit fullscreen mode

Most people add a safety buffer for slow shipping or a sales spike, for example 7 days, which moves the order-by date to 14 November.

How much to order? A simple approach is to cover the lead time plus the period until your next planned order:

reorder quantity ≈ daily sales × (lead time + days until next order + buffer) - units on hand at arrival
Enter fullscreen mode Exit fullscreen mode

With 3 units/day, a 21-day lead time, orders every 30 days and a 7-day buffer, that's about 3 × 58 = 174 units of coverage, minus whatever you expect to still have when the delivery arrives.

4. Doing it in a spreadsheet

You can do all of this with Shopify's built-in exports and a spreadsheet:

  1. Export inventory (Products → Inventory → Export) to get on-hand quantities per variant and location.
  2. Export sales by variant for your chosen window from Analytics reports, or export orders and sum line items per SKU.
  3. Join them by SKU with VLOOKUP or XLOOKUP.
  4. Add the formulas:
    • Daily sales: =units_sold / 30
    • Days left: =IFERROR(on_hand / daily_sales, "no sales")
    • Stockout date: =TODAY() + days_left
    • Order-by date: =stockout_date - lead_time - buffer
  5. Sort by order-by date so the most urgent items are at the top, and highlight anything with a date in the past.

This works well for a small catalogue. The limits show up as you grow:

  • It's a snapshot. The moment you close the sheet it starts going stale, and you have to remember to redo the export.
  • Multi-location stock makes the joins messier.
  • Lead times live somewhere else, often in someone's head or in old emails with suppliers.
  • Turning the list into purchase orders, and updating inventory when deliveries arrive, is all manual.

If your catalogue is small and you check it weekly, the spreadsheet may be all you need.

5. Automating it

This is the one place I'll mention what we built. Disclosure again: I'm on the AppVerix team. We made AppVerix Restock ("Know what to reorder, how much, and when.") because we wanted this math without the weekly export. According to its listing, it reads sales and stock per location and shows days of stock left, the stockout date and the order-by date for every variant, with the math shown. It also suggests reorder quantities based on sales speed and lead time, and builds purchase orders grouped by supplier. Plans start at $49/month with a 14-day free trial. The spreadsheet method above works fine without it.

6. Checklist

  • [ ] Calculate days of stock left per variant, not per product.
  • [ ] Split by location if you ship from more than one.
  • [ ] Choose a sales window (30/60/90 days) and exclude promo spikes and sold-out days.
  • [ ] Record a lead time for every supplier, and update it when deliveries run late.
  • [ ] Add a safety buffer to the order-by date.
  • [ ] Sort by order-by date, not by stock quantity.
  • [ ] Review the list on a fixed schedule, such as every Monday.
  • [ ] After each delivery, check whether the lead time you assumed was right.

Reorder planning isn't complicated: it's division, subtraction and a calendar. The hard part is doing it consistently, before the "Sold out" badge shows up. If you have questions about edge cases (bundles, seasonal products, pre-orders), leave a comment and I'll answer them.

Top comments (0)