Key takeaways
- Drafts POs, never sends. Purchase orders are financial commitments. They wait for a human.
- Forecast per SKU per location. Daily. With confidence ranges.
- Viral spike detection. Pings a human, does not draft larger orders unprompted.
- New SKUs are flagged. The agent will not forecast without thirty days of sell-through.
- Supplier directory is yours. The agent does not invent vendors or freight modes.
What this agent does
A Shopify store with five hundred SKUs is impossible to manage inventory for by hand. Every Monday morning the operations person scrolls through the inventory tab, identifies SKUs running low, looks up the supplier, drafts a PO, and emails it. The work takes between two and four hours and is the single most common cause of preventable stock-outs because some SKU always falls off the list. Stock-outs cost revenue twice: once at the lost sale and once at the SEO downgrade Shopify applies to out-of-stock listings.
The agent does the scroll, the look-up, and the drafting. Every morning at a time you set, it reads the current inventory levels for every SKU at every location, compares them to the forecasted daily sell-through, computes a stock-out date per SKU, and ranks SKUs by urgency. For any SKU whose forecast stock-out date is less than supplier lead time plus a safety buffer, the agent drafts a purchase order to the configured supplier. The draft sits in a queue. The operator opens the queue, reviews each draft, edits if needed, and sends. The two-to-four-hour Monday meeting becomes a fifteen-minute review.
What the agent does not do: send purchase orders, commit money, change item prices, change inventory levels in Shopify, contact customers, or cancel orders. The single financial action, sending the PO, stays human. The reason is the same one detailed in how to add a human approval step to an agent. Money out the door deserves a human signature.
Sources of truth
Shopify, plus a supplier directory you maintain.
- Shopify Admin API. Per-SKU per-location inventory levels, sell-through history, active product status.
- Shopify Orders API. The past ninety days of orders with line items. Used to build sell-through.
- Shopify Marketing API. Active promotions and discount codes. Used to weight forecasts; a promotion lifts expected sell-through.
- Shopify Fulfillment API. Pending fulfillments that have not yet decremented inventory. Used to avoid double-counting stock that is committed but not shipped.
- Supplier directory. A YAML file or spreadsheet with supplier contacts, lead times, MOQs, case packs, and freight modes per SKU.
- Optional: ad spend data. Meta and Google Ads API. Used to flag SKUs that are about to receive a paid spike. The agent does not adjust forecasts upward from ad spend alone, it flags them for human review.
The agent does not read customer profiles, abandoned carts, or website analytics beyond what is required for the forecast. The smaller the read surface the easier the agent is to audit. The same trade-off is described in how to give an agent multiple tools.
How the agent forecasts stock-out
Three inputs, one number per SKU.
- Rolling sell-through. Mean units sold per day over the past fourteen days. Outliers (single-day spikes more than three standard deviations from the mean) are clipped.
- Seasonal index. A per-SKU multiplier from a year-over-year comparison, available only for SKUs older than one year. New SKUs get an index of 1.0 and a wider confidence band.
- Promotion lift. If an active promotion includes this SKU, the historical lift for similar promotions is applied. Lift is computed from the agent's first three months of observations; before then the agent uses a conservative default of 1.5x.
The output is a daily expected sell-through and a stock-out date for each SKU per location. Confidence ranges are widest for new SKUs and narrowest for high-volume staples. Any forecast where the seventy-percent confidence interval is wider than two weeks is flagged "Forecast uncertain, needs human review" and excluded from auto-drafting. Most stores see between five and twenty percent of their SKUs in this bucket, mostly the long tail.
Output: the daily restock board
One board, updated every morning at the time you set. Three sections.
- Drafted purchase orders. One row per draft PO with the supplier, line items, total cost, freight mode, lead time, and projected delivery date. Each row has a Review button that opens the full draft.
- Reorder watch. SKUs that will need a PO drafted in the next seven days but are not yet at the threshold. Lets the operator anticipate.
- Anomalies. Two kinds. Sudden spikes (sell-through more than three times the fourteen-day average over the past forty-eight hours) and forecast uncertainty (confidence band wider than two weeks). Each anomaly has a Review button instead of an auto-draft.
The board is the single piece of paper the operator looks at. Drafts that get reviewed and approved fire off the PO through the configured channel (email, EDI 850, or supplier API). Drafts that get edited go through the same path. Drafts that get rejected get a one-line reason logged so the agent can adjust future drafts. The reason loop is what turns the agent from a forecaster into a forecaster that learns the merchant's actual buying habits, described under how to train an agent on company docs.
Guardrails
Three guardrails are baked in.
- Drafts only. The agent's OAuth scope does not include outbound email send or EDI write. Sending a PO requires a separate human-held credential set. There is no in-product setting that flips this.
- MOQ and case pack enforcement. The agent never drafts a PO below the supplier's minimum order quantity. If the projected reorder is below MOQ, the agent waits until the projected need crosses the threshold or escalates to human review with a clear note.
- No price negotiation. The agent uses the price agreed in the supplier directory. It does not propose lower prices, ask for discounts, or change payment terms. Those negotiations are human and the agent has no permission to participate.
The agent rate-limits its Shopify API calls and respects the bucket-leak algorithm Shopify uses, so a store with ten thousand SKUs runs through a slow scan rather than a burst that gets throttled. Reads are cached for fifteen minutes; the trade-off is that a sudden inventory adjustment by a human takes up to fifteen minutes to show up in the forecast.
Common mistakes
Auto-sending POs. Every team that tried it had a finance moment within sixty days. A wrong PO with the wrong supplier or wrong freight mode costs real money and is hard to retract. The agent drafts.
Setting safety stock too low. A safety buffer of zero gets stores into stock-outs whenever supplier lead time wobbles. Three to seven days of safety stock above the lead-time horizon is the practical default; the operator tunes per SKU class.
Ignoring fulfillment-pending inventory. Inventory levels in Shopify do not decrement until the order is fulfilled. Stores that did not account for the pending fulfillment bucket saw POs drafted that turned out to be unnecessary because the stock was already promised.
Forecasting new SKUs. A new SKU with seven days of sell-through is not enough data to forecast. Forcing the agent to forecast anyway produces wild swings. Hold new SKUs in the watch board for thirty days before auto-drafting.
Auto-boosting on viral spikes. A viral spike often retreats inside a week. Drafting a large PO during the spike commits the merchant to inventory they may not need. The agent flags the spike instead. The decision is human because the call is about whether the trend is durable, and an agent cannot tell. Same logic as in agent error handling and rollback.
Frequently asked questions
Can an AI agent reorder Shopify inventory automatically?
The agent drafts purchase orders. It does not send them. Every draft waits for a human to review the SKUs, quantities, supplier, and shipping method before the PO is sent. Auto-sending purchase orders is a financial commitment to a supplier and stays human-approved.
How does the agent forecast stock-out dates?
It reads the past ninety days of sell-through per SKU, applies the seasonal index you configured, factors in any active promotion or paid ads spike, and projects forward. The output is a daily stock-out date per SKU with a confidence range. SKUs with seasonal patterns get longer ranges. New SKUs flag for human review instead of auto-forecasting.
Does it work for multi-location Shopify stores?
Yes. Inventory is tracked per location. The agent forecasts stock-out per SKU per location. Purchase orders can split shipments between locations or default to the location with the deepest demand depending on how you configure the routing in setup.
Which suppliers can the agent draft POs for?
Any supplier you have wired into the agent's contact directory. The agent supports email-based purchase orders (formatted PDF and CSV attachments), EDI 850 for suppliers that require it, and direct API integrations with Faire, Alibaba, and a small list of common dropship platforms. The directory is yours; the agent does not invent suppliers.
What happens during a sudden viral spike?
The agent detects abnormal sell-through (typically more than three times the rolling fourteen-day average) and pings a human within fifteen minutes. It does not automatically draft a larger PO during a spike because viral spikes often retreat in days. The human decides whether to expedite or wait. The agent's job is to flag, not to bet.
Three takeaways before you close this tab
- Drafts only. POs commit money and stay with humans.
- Forecast confidence is part of the output. Wide bands flag SKUs the agent should not auto-draft.
- The supplier directory is the source of truth. The agent does not invent vendors, prices, or freight modes.
Sources
- Shopify. Admin API, Inventory level resource. Tier 1.
- Shopify. Orders API reference. Tier 1.
- Shopify. Fulfillment service API. Tier 1.
- Shopify. Shopify API rate limits. Tier 1.
- X12. EDI 850 Purchase Order Transaction Set. Tier 1.