A8gent
All articles

Industry

Reorder Point Automation: Beyond Low Stock Alerts

Almost every guide on this subject tells you to set a low stock alert at some round number and move on. That number is the whole problem. A reorder point is a calculation involving your supplier's lead time, the variability of your demand and a service level you choose deliberately - and once you write it down, the automation is trivial.

A8gentAutomation practiceAugust 5, 202613 min read
Contents
  1. The Problem With Round Numbers
  2. The Reorder Point, Properly
  3. Getting the Data: Shopify and the Rate Limit
  4. A Worked Example, With All the Arithmetic Shown
  5. Where This Model Breaks, and What to Do About It
  6. Building and Operating It
  7. FAQ

The Problem With Round Numbers

Nearly every store starts the same way. Somebody sets a low stock alert on each product at 10 units, or 20, or whatever felt right the afternoon they set it up. Then one of two things happens, usually both.

On the fast movers, the alert fires far too late. A product selling 12 units a day trips a 10-unit alert with less than a day of cover left, against a supplier who needs three weeks. The alert is technically working and the product is already lost.

On the slow movers, the alert fires far too early and keeps firing, so people learn to ignore it. Within a month the alerts are noise, which is worse than having none, because now nobody looks at the ones that matter.

The failure is not the alerting mechanism. It is that a single number applied across products with different velocities and different suppliers cannot be right for more than a handful of them. And crucially, the correct number is not a preference - it is a calculation, and once you can compute it, automating the alert is the easy part.

So this article spends most of its length on the arithmetic and comparatively little on the plumbing. That ratio is deliberate, and it is the opposite of most content on this topic. For where this sits among a retailer's other automation candidates, see AI automation for ecommerce and retail, and for the broader picture AI agents for inventory management.

The Reorder Point, Properly

The reorder point is the stock level at which you place an order such that the new stock arrives before you run out. It has two parts.

Part one: demand during lead time. If a product sells an average of D units per day and the supplier takes an average of L days from order to shelf, you will consume D x L units while waiting. If you reorder at exactly that level you arrive at zero on the day the delivery lands - assuming everything is average, which nothing ever is.

Part two: safety stock. The buffer that absorbs the days demand runs hot and the weeks the supplier runs late. This is the part the round-number approach omits entirely, and it is where the actual decision lives.

The standard formulation, accounting for variability in both demand and lead time:

Reorder point = (D x L) + safety stock
Safety stock = z x sqrt( (L x sigma_D squared) + (D squared x sigma_L squared) )

Where D is average daily demand, L is average lead time in days, sigma_D is the standard deviation of daily demand, sigma_L is the standard deviation of lead time in days, and z is the service factor for your chosen service level.

The z-values are the standard normal quantiles. Computed directly rather than quoted from memory:

Service levelz
90%1.282
95%1.645
97.5%1.960
98%2.054
99%2.326

Three things follow that are worth internalising, because they change purchasing behaviour more than any software will.

Service level is a spending decision, not a quality target. Going from 95 percent to 99 percent multiplies safety stock by 2.326 / 1.645 = 1.41. That is 41 percent more capital tied up in that product, permanently, to reduce stockout probability by four percentage points. For a hero product that is obviously worth it. For an item that sells twice a month it is absurd, and yet a store-wide setting applies the same number to both.

Lead time variability is usually the dominant term. Look at the formula: demand variance is multiplied by L, but demand is squared against lead time variance. For any product with meaningful daily sales, an unpredictable supplier drives the buffer far harder than volatile customers do. The practical implication is uncomfortable and correct - the cheapest way to reduce your inventory investment is often to get a more reliable supplier, not a better algorithm. Very few inventory tools will tell you that, because it is not a feature they can sell.

You need to measure sigma_L, which almost nobody does. Stores track what they ordered and what they paid. Very few record when the purchase order went out and when the goods were actually available to sell. Without that history you cannot compute the term that matters most. If you take one action from this article before any automation, start timestamping purchase orders and receipts.

Getting the Data: Shopify and the Rate Limit

The inputs are sales history per variant, current stock per location, and your own purchase order history. The first two come from the platform.

Shopify's GraphQL Admin API is metered in points, not requests, and the limits are published by plan:

  • Standard: 100 points/second
  • Advanced Shopify: 200 points/second
  • Shopify Plus: 1000 points/second
  • Shopify for enterprise (Commerce Components): 2000 points/second

The mechanism is a leaky bucket, which Shopify's documentation explains as: "Each app has access to a bucket. It can hold, say, 60 'marbles'. Each API request tosses [some number] of marbles into the bucket. Each second, a marble is removed from the bucket (if there are any)." There is also a hard per-query ceiling: "A single query may not exceed a cost of 1,000 points, regardless of plan limits." Exceeding resource limits produces "a 429 Too Many Requests response, and a message that a throttle has been applied."

Three consequences for this build:

  • You cannot fix throttling by splitting one huge query into one slightly less huge query. The per-query 1,000-point ceiling is absolute, so a catalogue-wide pull must be paginated by design, not as an optimisation.
  • Cost is a function of what you request, not of how many calls you make, so requesting fewer fields per node buys you more nodes per query. Ask for what the calculation needs and nothing else.
  • Handle 429 properly with backoff rather than a fixed sleep, and make the sweep resumable so a throttle partway through does not mean starting again. See rate limit, retry and backoff and idempotency.

Note that Shopify's rate limit documentation we read details the GraphQL Admin API; it did not give us REST figures on that page, so if you are building against REST, check the specific limits for that surface rather than assuming these numbers transfer.

Cadence. Run the calculation nightly, or even weekly for a small catalogue. This is emphatically not a real-time problem: a reorder point moves as demand and lead times drift over weeks, and recalculating every hour buys nothing while multiplying your API consumption. Resist the instinct toward webhooks here - see polling vs webhook.

If you are not on Shopify, or you run a physical store on a POS with no useful API, a weekly CSV export into a spreadsheet is entirely adequate. The formula does not care where the numbers came from. Do not let integration ambition delay a calculation you could be doing on Monday.

A Worked Example, With All the Arithmetic Shown

A single product, worked end to end. Substitute your own figures.

Inputs, measured from your own history:

  • Average daily demand, D = 14 units
  • Standard deviation of daily demand, sigma_D = 5 units
  • Average supplier lead time, L = 18 days
  • Standard deviation of lead time, sigma_L = 4 days
  • Target service level = 97.5 percent, so z = 1.960

Step 1 - demand during lead time: D x L = 14 x 18 = 252 units.

Step 2 - the demand variability term: L x sigma_D squared = 18 x 25 = 450.

Step 3 - the lead time variability term: D squared x sigma_L squared = 196 x 16 = 3,136.

Pause here, because this is the lesson. The lead time term is seven times larger than the demand term. Almost all of this product's safety stock exists because the supplier is unreliable, not because customers are unpredictable.

Step 4 - safety stock: sqrt(450 + 3,136) = sqrt(3,586) = 59.9, times z of 1.960 = 117.4, round up to 118 units.

Step 5 - reorder point: 252 + 118 = 370 units.

Compare that with the low stock alert of 20 units this product probably has set on it today. The alert would fire when there was less than a day and a half of cover remaining against an 18-day lead time. The product would be out of stock for roughly two and a half weeks, every single time it turned over.

Now the supplier lever, quantified. Suppose you negotiate consistency and sigma_L falls from 4 days to 1. Step 3 becomes 196 x 1 = 196. Safety stock becomes 1.960 x sqrt(450 + 196) = 1.960 x 25.4 = 49.8, round to 50 units. You have removed 68 units of permanently held stock - a 58 percent reduction in safety stock - by changing nothing except supplier reliability. At a cost price of, say, $9 per unit that is $612 of working capital released on one product. Across a catalogue, this is usually the largest single inventory saving available to a small retailer, and no software vendor will surface it for you.

And the service level lever. Keeping sigma_L at 4 but dropping this product to a 90 percent service level: z becomes 1.282, safety stock becomes 1.282 x 59.9 = 76.8, round to 77 units - 41 fewer than at 97.5 percent. Whether that is wise depends entirely on whether this is a hero product or a long-tail one, which is exactly why the setting belongs per product.

What the build is worth. The honest framing is avoided stockouts plus released capital, and both need your own numbers. If this product stocks out three times a year for 17 days each at 14 units a day, that is 3 x 17 x 14 = 714 lost unit sales. At a contribution of, say, $11 per unit, that is $7,854 a year on one product - though you should discount it for customers who wait or substitute rather than disappear, which many will. Across a catalogue of even a few dozen meaningful products, the case for getting this right is not close. Against a build cost of a few thousand dollars - see automation build cost and AI automation cost - numbers like the ones in this example would pay it back within weeks. Our ROI of AI agents piece covers making that case defensible, and payback period the framing.

Where This Model Breaks, and What to Do About It

The formula assumes roughly normally distributed demand and independent variation. Real retail violates that constantly, and pretending otherwise is how people lose faith in the whole approach. Know the exceptions.

Seasonal products. A twelve-month average demand for a product that sells almost entirely in November is meaningless. Either compute D from a comparable prior period rather than a trailing window, or exclude seasonal lines from automated reorder points and plan them by hand. Do the second one first - it is honest and it works.

New products. No history, so no D and no sigma_D. They need a judgement-based initial buy and a much shorter review cycle. Exclude them from the automation until they have enough history to be meaningful, and be explicit about what "enough" means.

Promotions and marketing spikes. A product that ran a paid campaign last month has a demand history that is not predictive. Either flag promotional periods and exclude them from the demand calculation, or accept that the model over-orders after every promotion. The first is better and requires that somebody records promotions somewhere the calculation can read - a small discipline with a large payoff.

Intermittent demand. Products selling a handful of units a month are not normally distributed in any useful sense, and the formula will produce nonsense. For long-tail items, a simpler rule - order a fixed quantity when stock hits a small threshold - is more honest than a false precision.

Minimum order quantities and case packs. The formula says reorder at 370; the supplier sells in cases of 144. Real order quantities are constrained by MOQ, case size, price breaks and freight thresholds, and the reorder point is a separate question from the reorder quantity. Compute the point properly, then round the quantity to what you can actually buy.

Correlated failures. If several products share a supplier, a single supplier problem takes all of them out simultaneously and independent safety stock calculations understate that risk. Worth knowing when your top ten products come from one importer.

The general point: automate the calculation for the products it fits, and exclude the rest explicitly. A system that is right for 70 percent of the catalogue and honest about the other 30 is far more useful than one that pretends to cover everything. Our when not to use an AI agent piece makes the same argument generally.

Building and Operating It

Build order. First, start recording purchase order dates and receipt dates so you can ever compute sigma_L - do this today, it is free and it is the input you cannot backfill. Second, pull sales history and current stock on a schedule and compute D and sigma_D per variant. Third, compute reorder points with a default service level and review them against a buyer's intuition; where the buyer disagrees strongly, the buyer is usually detecting something the data does not contain, so investigate rather than override. Fourth, set service levels per product class. Fifth, alert. Sixth - and only much later - consider drafting purchase orders.

Alert design decides whether this gets used. A daily email listing every product below its reorder point is a report, and reports get ignored. Better: a single grouped alert, sorted by urgency measured in days of cover remaining rather than units, grouped by supplier so one purchase order covers several lines, and suppressed for any product with an open purchase order already placed. That last suppression is the difference between a tool people use and one they mute in a fortnight.

Do not let it place orders yet. The temptation once the numbers look right is to auto-generate and send purchase orders. Wait a full seasonal cycle. The failure mode of an automated ordering system is not a missing order, it is a large wrong one - a decimal place, a stale lead time, a supplier who changed case sizes - and it arrives on a pallet with an invoice attached. Human approval on the order is cheap insurance. See human-in-the-loop.

Recalculate the inputs on a slow cycle. D, sigma_D, L and sigma_L should be recomputed monthly or quarterly from a trailing window, not continuously. Continuous recalculation makes reorder points jitter, which erodes buyer confidence for no benefit.

Measure: stockout days per product, fill rate against the service level you actually chose (if you set 97.5 percent and observe 88, your inputs are wrong somewhere - usually sigma_L), inventory value held, and the number of alerts acted on versus ignored. That last one is your usability metric and the leading indicator of abandonment.

Watch for the silent stop. A scheduled job that fails produces no alerts, and no alerts looks exactly like a well-stocked catalogue right up until three products go out at once. Alert on zero output, not only on errors - the same trap as every scheduled automation in this series. See observability and error handling.

If you want a second opinion on whether this is the right first build for your store, the free automation audit works through the alternatives, and automation services explains how we scope it. The customer-facing side of stock problems - what happens when something is out anyway - is covered in out-of-stock order handling, and broader store automation in AI agents for ecommerce automation.

FAQ

What is wrong with a simple low stock alert?
It applies one number to products with completely different velocities and suppliers, so it is wrong for nearly all of them. A product selling 12 units a day trips a 10-unit alert with a day of cover left against a three-week supplier - the alert fires correctly and the stockout is already unavoidable. Meanwhile slow movers trip constantly and train everyone to ignore alerts. The reorder point needs to be calculated per product from demand, lead time and their variability.
What is the actual reorder point formula?
Reorder point = (average daily demand x average lead time in days) + safety stock, where safety stock = z x sqrt((L x sigma_D squared) + (D squared x sigma_L squared)). D is average daily demand, L is average lead time, sigma_D and sigma_L are the standard deviations of daily demand and of lead time, and z is the service factor. For a 95 percent service level z is 1.645; for 97.5 percent it is 1.960; for 99 percent it is 2.326.
Which matters more - demand variability or supplier reliability?
Usually supplier reliability, and the formula shows why: demand variance is multiplied by lead time, but average demand is squared against lead time variance. In the worked example in this article, the lead time term is seven times larger than the demand term. Reducing lead time variability from 4 days to 1 cut required safety stock by 58 percent on that product. The cheapest way to release inventory capital is often a more consistent supplier rather than better software.
Should every product have the same service level?
No, and a store-wide setting is one of the most expensive defaults in retail. Moving from 95 to 99 percent multiplies safety stock by about 1.41 - forty-one percent more capital permanently tied up for four percentage points of coverage. That is clearly worth it on a hero product and clearly absurd on something selling twice a month. Set service levels by product class, and be explicit that you are choosing to stock out on the long tail sometimes.
What are Shopify's API limits for pulling this data?
The GraphQL Admin API is metered in points per second by plan: 100 for Standard, 200 for Advanced Shopify, 1000 for Plus and 2000 for enterprise, using a leaky bucket where each request adds points and points drain over time. There is also a hard ceiling that "A single query may not exceed a cost of 1,000 points, regardless of plan limits," so catalogue-wide pulls must be paginated by design. Exceeding resource limits returns a 429 Too Many Requests with a throttle message.
How often should the calculation run?
Nightly is plenty, and weekly is fine for a small catalogue - this is not a real-time problem. Reorder points move as demand and lead times drift over weeks, so recalculating hourly buys nothing and multiplies API consumption. Recompute the underlying inputs even more slowly, monthly or quarterly, because continuously updating them makes reorder points jitter and erodes the buyer's confidence in the system for no benefit.
Should the automation place purchase orders itself?
Not until the numbers have been right for a full seasonal cycle. The failure mode of automated ordering is not a missed order, it is a large wrong one arriving on a pallet with an invoice attached - caused by a stale lead time, a changed case size or a decimal place. Human approval on the order is cheap insurance against an expensive, physical, non-reversible mistake. Automate the calculation and the alert first; the ordering can wait.
Which products should be excluded from this?
Strongly seasonal lines, whose annual average demand is meaningless; new products with no history; anything whose recent demand was driven by a promotion, unless you flag and exclude those periods; and intermittent long-tail items selling a few units a month, where the normal-distribution assumption produces false precision. For those, a simple fixed threshold and a manual review is more honest. A system that covers 70 percent of the catalogue well and says so beats one that pretends to cover everything.

If this resonated

Module 02 is the long version of this post.

Eval set, refusal pattern, kill switch. Build it in a weekend.

All postsLast verified 2026-08-05

Done for you

Want this built for your business?

Tell us the workflow. We scope, build, and ship the agent with guardrails and the numbers to prove it worked. The scoping call is free.

Free scoping call. You own the code.

Request a scoping call