Back to blog

How I Used AI to Forecast a Full Year of Inventory From Shopify

Every growing ecommerce brand hits the same wall. Your ops person needs to order inventory for the back half of the year, and they need numbers. Not "we'll probably grow." Actual per-product projections, month by month, so they know how much to make and when.

Guess too low and you stock out during your biggest season. Guess too high and you've got cash frozen in a warehouse full of product that won't move until spring. For one of the brands I run marketing for, I needed to hand our ops guy a real forecast for the rest of the year, broken out by every product, every day.

So I gave the whole job to my AI coworker.

Slack message asking Viktor to rebuild sales history and forecast the rest of the year

You Can't Forecast on a Foundation You Don't Trust

Before projecting anything forward, I wanted a clean history to build on. We had this year's daily sales by product, but not last year's in the same shape. You can't spot seasonality with one year of data. You need at least two, lined up the same way, or the whole forecast is a guess wearing a lab coat.

Viktor pulled roughly a year and a half of order history straight from Shopify and rebuilt it into a single daily breakout by product. The important detail is that it used one consistent method for both years: net items sold (orders minus refunds), same timezone, same product mapping. That's what makes a year-over-year comparison actually mean something instead of comparing two slightly different definitions.

The Honest Part: It Wasn't One Click

Pulling that much order history is not a tidy operation. The Shopify auth token kept timing out about once an hour, partway through the pull. A lesser setup would have failed and started over from zero every time.

Instead of brute-forcing it, Viktor re-architected the pull to run month by month, with a fresh token and automatic retry on each chunk, so a timeout never lost progress. It kept me posted the whole way through as it worked through the backlog. This is the part people don't see in the "AI does your work" demos. The interesting work is in handling the thing that breaks halfway through.

Viktor re-architecting a large Shopify pull around auth token timeouts

It Checked Its Own Work, and Caught a Bug in Mine

Once the rebuild was done, Viktor reconciled its numbers against our existing live report to prove the method was sound. Almost every product column matched within one to two percent.

The columns that didn't match were the interesting ones. Digging into one of them, Viktor found that our live report had a bug: one product's formula had quietly stopped counting its main variants a few weeks earlier, so that product had been under-reporting itself the whole time. It fixed the formula in the actual working sheet so it stays correct going forward.

Viktor reconciling the rebuilt data and finding a bug in the live report

I asked for a forecast and got a data audit for free. That's the kind of thing that pays for itself.

The Forecast Method

With a trusted two-year history, here's how Viktor built the projection for every remaining day of the year:

  • Anchor to the revenue plan. We already had a top-line revenue projection that baked in our growth and the November and December ramp. Start there so the forecast agrees with the number the business is already planning around.
  • Convert revenue to units using real recent average order value, so the top-line dollars turn into actual quantities to manufacture.
  • Split across products by current mix, so each product gets its fair share of the total based on how it's actually selling now.
  • Spread each month across days using last year's daily pattern, so Black Friday and Cyber Monday spikes land on the right dates instead of smearing evenly across the month. That timing is everything for inventory. You need the stock in the building before the spike, not during it.
Viktor explaining the inventory forecast method with seasonality and BFCM

Every forecasted row got highlighted yellow, so the handoff from real data to projection is obvious at a glance. Nobody looking at the sheet can mistake an estimate for a fact.

Illustrative chart of daily units sold, rebuilt history in blue then forecast in orange with a Black Friday spike

The chart above is illustrative, not the client's real volume, but it shows the structure: solid history, then a projection that carries the seasonality forward and puts a real spike on the holiday weekend instead of a flat line. That's the difference between a forecast someone can order against and a spreadsheet full of averages.

What I'd Tell You

If you need to forecast inventory for a growing brand, the order of operations matters more than any fancy model:

  • Rebuild a clean, consistent history first. Two years minimum, same definitions across both, or you can't trust your own seasonality.
  • Reconcile against a source you already trust before you project anything. It validates your method and, often, catches errors in the report you've been relying on.
  • Forecast top-down and bottom-up at once. Anchor the total to your revenue plan, then distribute it by product mix and daily seasonality.
  • Respect the calendar. A holiday spike on the wrong day is a stockout. Use last year's daily shape, not a monthly average.
  • Mark estimates clearly. The person ordering product needs to know instantly where fact ends and projection begins.

The whole thing, rebuild plus forecast plus a bug fix, happened in one afternoon of back-and-forth in Slack. The AI I use is Viktor, an AI coworker that lives right in Slack alongside the team. It's the same one I use for rebuilding my website and producing commercial assets. If you want to try it, you can get $100 in free credits plus $50 off your first purchase here.

For more real examples with screenshots: my full Viktor review.