庫存數據如何轉化為補貨產品:從庫存提醒到採購任務
Inventory Data to Replenishment Product: From Stock Alerts to Purchase Tasks
EveryInfra 提出補貨產品應由變體、地點和庫存狀態出發,串連補貨建議、採購任務及收貨流程,而非只依賴產品級庫存提醒。其抽查 10 間 Shopify 商店的 1,589 件多變體商品,發現 802 件(50.5%)有部分變體缺貨。文章再以需求波動、交貨期、可售與在途數量及供應商起訂量示範訂貨量計算,並討論 API 同步、採購單和收貨記錄如何更新補貨建議。
On November 20, 2026, we read the first product page of 10 public Shopify stores: 2,415 products and 16,342 variants. Of the 1,589 products with two or more variants, 802 (50.5%) had at least one size or color sold out. Only 96 products (4.0%) were sold out in every variant.
A stock alert at the product level fires only for those 96 products. It does not fire for any of the 802 products with a size gap. Of the 802, 234 had only one variant sold out, and 307 had half or more of their variants sold out. A replenishment product must start from variant, location and inventory state, and then connect lead time, minimum order quantity and the purchase order.
Key points
- In 10 Shopify stores, 802 of 1,589 multi-variant products (50.5%) had a size gap; a product-level alert catches none of them.
- Few public pages show a unit count: walmart/search 0/20, amazon/search 0/10, Shopify product JSON 0/16,342, ebay/product_detail 3/6, jd/skus 11/26.
- From Shopify API 2026-04, inventory writes must carry changeFromQuantity and an idempotency key; API 2026-10 adds purchase order reads. These rules and the Amazon, Walmart and Mercado Libre state models come from official docs, not from tests on a real store.
- In our example SKU (assumed inputs), a lead time of 28 days instead of 7 moves the suggested order from 120 to 360 units.
- Of the 21 live requests in our table, 18 were charged, $0.056913 in total; the 3 empty results were refunded automatically.
Between an empty slot on the shelf and a purchase task sit variant mapping, inventory states, lead time and receiving checks. Illustration for this article
Half of multi-variant products had a size gap
The easiest inventory feature is "alert me when stock drops below 10". Users also turn it off quickly. At 00:17 Singapore time on November 20, 2026, we fixed a list of 12 Shopify stores before we read any data. The list covers apparel, shoes, bedding, coffee, watches and cosmetics. At 00:18 Singapore time, we read /products.json?limit=250 from each store.
This JSON is the public product list of a Shopify storefront. It is storefront data, like the Ajax Product API. Each variant in our files carries an available true or false value and no unit count. Two stores gave no product data: bombas.com returned a security check page, and ruggable.com returned 404. The other 10 stores returned their first page.
The 10 stores had 2,415 products and 16,342 variants in total. Of these variants, 3,440 (21.1%) showed as not available. At the product level, 1,517 products had every variant available. Only 96 products had no variant available. A further 802 products had some variants sold out and some still for sale.
| Store | Products | Variants | Multi-variant products | Partly sold out | Fully sold out | Sold-out variants |
|---|---|---|---|---|---|---|
| allbirds.com | 250 | 3,094 | 250 | 228 | 0 | 39.5% |
| chubbiesshorts.com | 250 | 1,499 | 239 | 163 | 3 | 28.2% |
| outdoorvoices.com | 250 | 1,484 | 248 | 117 | 5 | 28.4% |
| rothys.com | 250 | 4,197 | 225 | 100 | 2 | 12.3% |
| brooklinen.com | 250 | 2,404 | 133 | 58 | 3 | 13.7% |
| taylorstitch.com | 250 | 1,730 | 230 | 78 | 6 | 15.6% |
| deathwishcoffee.com | 165 | 448 | 80 | 18 | 6 | 12.7% |
| tentree.com | 250 | 986 | 184 | 40 | 11 | 14.4% |
| mvmt.com (one variant each) | 250 | 250 | 0 | 0 | 43 | 17.2% |
| colourpop.com (one variant each) | 250 | 250 | 0 | 0 | 17 | 6.8% |
| Total | 2,415 | 16,342 | 1,589 | 802 | 96 | 21.1% |
Among the 1,589 products with two or more variants, 50.5% were partly sold out. At Allbirds, 248 of the 250 products on the first page were shoes; the other 2 were a gift card and a returns coverage item. Of the 248 shoes, 228 missed at least one size. Of these 228, 44 missed only one size and 93 missed half or more.
The men's Tree Runner NZ in Natural Black had 14 sizes, and only 7 were available. The Outdoor Voices CloudKnit Sweatpant had 18 color and size combinations, and only 4 were available. A product-level alert in these 10 stores fires 96 times. The variant-level gap touches 802 products and 3,440 variants.
We read only the first 250 products per store, in the order that the store chose.
An available value of true can also mean that the merchant lets customers buy when stock is out. The Shopify Help Center page on inventory tracking describes that setting. A value of false can mean that the merchant stopped one color on purpose. The public JSON cannot tell these cases apart. So 802 and 3,440 count items that a shopper cannot buy. They do not all count items that the warehouse does not have.
The size of each gap also differs by store. At Outdoor Voices, 36 of 117 gap products missed one variant and 64 missed half or more. At Rothy's, 32 of 100 missed one variant and only 22 missed half or more. A product with one missing size needs one reorder line. A product with 7 missing sizes needs a different priority.
From size gaps to reorder candidates
A replenishment product must split each gap by variant. Take the Allbirds shoe with 7 of 14 sizes available. At the product level it is "in stock". At the variant level, half of the sizes are gone. The system must find which sizes are gone and how many of each size sold in the last 8 weeks. It must also find the share of total sales for each size.
We grouped the 248 Allbirds shoes by US size value, with men's and women's styles together. Middle sizes sold out less often. Size 9 had 63 of 247 variants sold out (25.5%), size 9.5 had 26.5%, and size 10 had 25.9%. The far ends sold out much more often.
Size 13.5 had 68 of 71 sold out (95.8%), size 15 had 34 of 39 (87.2%), and size 14 had 68.6%. Fewer styles carry the end sizes, and more of them are sold out. This does not prove that end sizes sell faster. A more likely cause is thin stock that the store does not reorder.
If the three best-selling sizes are gone, the usable stock can be a small part of the product total. A total of "300 pairs available" then does not tell you whether a shopper can buy the size they need. If only the smallest and the largest sizes are gone, look at the past sales of those two sizes first. Then decide to reorder them or to stop them.
So each variant-level suggestion needs a size curve. The size curve is the share of sales for each variant over a recent period. A new style has no history, so the system can use the curve of a similar older style. The suggestion must say which style it used. With a curve, "reorder 300 pairs" becomes "60 pairs in size 9, 75 in size 10 and 45 in size 11".
Variant counts also affect sync traffic. On November 17, 2026, Shopify increased the payload limit for webhooks and Events sent through Amazon EventBridge from 256 KB to 1 MB (Shopify changelog). The post names products with many variants as the main case. Before the change, such updates over 256 KB arrived as a bare {"id": ...} body. The app then needed one more API call to get the variants.
Define the inventory object before any forecast
When you sell on many channels, one physical item has many IDs. It has an internal SKU, a platform product ID, a variant ID, barcodes and channel listing IDs. One wrong link in color, size, pack size or bundle makes the system spread a wrong number faster. So the first version needs a master table that a person can check. Forecasts come after that.
The Shopify guide Manage inventory quantities and states splits the model into four objects. ProductVariant holds what customers see, such as price and images. Each variant has one InventoryItem, which holds back-office data such as the SKU. An InventoryLevel connects one inventory item to one location and holds the quantities by state. A Location is a store or a warehouse.
The global ID of the InventoryLevel object contains both the level ID and the inventory item ID. Other platforms use other models. But this model shows why "this SKU has 8 units" is half a statement without a location and a state. This guide has moved from an orders-fulfillment folder to an inventory-management-apps folder. Update old links in your integration docs.
| Object | What it holds | Mapping to keep | Change in 2026 |
|---|---|---|---|
| Product / variant | Title, price, color, size | Channel variant ID to internal SKU, with pack ratios | From 2026-09-08, up to 20 barcodes per variant |
| Inventory item | SKU, cost, tracked or not | One item per variant; bundles split to parts | — |
| Inventory level | Quantities by state at one location | Location by state, with source time | From API 2026-04, inactive levels can exist |
| Location | Store, warehouse, third-party warehouse | Can it ship, and for which channels | 2026-11-05: order routing can rank locations across groups (unstable) |
Each of these objects changed this year. From September 8, 2026, a ProductVariant can hold up to 20 typed barcodes (Shopify changelog). Each barcode can have the type UPC, EAN, ISBN, GTIN or ASIN, and Shopify checks it against that standard. The old single barcode field is deprecated and returns only the first barcode. The changelog warns that an integration that reads only barcode loses the other codes with no signal.
From API 2026-04, a quantity write can create an inactive InventoryLevel at a location where the item is not stocked yet (2026-04 release notes). Queries return only active levels unless you pass includeInactive. The isActive field tells the two apart. A replenishment system that sums stock by location must treat inactive levels as their own case. The units exist in the data, but customers cannot buy them.
The mapping table is data too. Record who confirmed each link, when it starts, whether it is one-to-many, and how bundles and substitutes convert. The GS1 page on the GTIN defines the GTIN as the ID of a trade item. A single unit, an inner pack and an outer case of the same goods each get their own GTIN. Write down which level you buy in, which level you receive in, and which level you sell in. If you skip this, the supplier quotes per pack, the warehouse receives per case, and the store sells per bundle.
Available, on hand, committed and incoming are different numbers
The Shopify guide Apps in inventory management lists eight states: incoming, on_hand, available, committed, reserved, damaged, safety_stock and quality_control. The on_hand state is the sum of the other six physical states. The incoming state is the only one that is not physically at the location.
The example query in the guide returns 72 available units, 101 on hand, 0 reserved and 29 committed. So 101 = 72 + 29. Almost 30% of the units on the shelf already belong to orders. A stock alert that reads on_hand would see 101 units. Only 72 can go to new orders.
A replenishment product must answer four questions. How many units can we sell now (available)? How many belong to orders (committed)? How many are physically in the building (on_hand)? How many are on the way, and when can we sell them (incoming plus the expected date)?
Stock alerts use available. Reorder math uses available plus incoming. Cycle counts check on_hand. Use the wrong number and the system asks people to order at the wrong time.
| Platform | Sellable | Committed or in process | Incoming | Not sellable | Level |
|---|---|---|---|---|---|
| Shopify | available | committed, reserved | incoming | damaged, quality_control, safety_stock | Item by location |
| Amazon FBA | fulfillable | reserved | inbound | unfulfillable, researching | Seller SKU by marketplace |
| Walmart Marketplace | quantity per ship node | — | — | — | SKU by ship node |
| Mercado Libre | quantity per stock location | — | — | — | User product by location type |
The Amazon FBA Inventory API page splits FBA stock into fulfillable, inbound, reserved, unfulfillable and researching. Reserved includes units in picking and units held for measurement or sampling. The Walmart Inventory API overview reads and writes quantities by SKU and ship node. The Mercado Libre distributed stock page puts stock for one user product in three location types. API calls cannot change the stock in the marketplace warehouse type.
| Mercado Libre location type | What it is | Writable by API? | How to restock |
|---|---|---|---|
meli_facility |
Mercado Libre warehouse (Full) | No | Send goods; the inbound trip has its own lead time |
selling_address |
Seller's selling address | Yes, with x-version
|
Write stock after each count or receipt |
seller_warehouse |
Seller's own warehouse | Yes, with x-version
|
Write stock after each count or receipt |
When a platform gives only some states, the product must show what it covers. Do not subtract numbers to invent an exact "true stock". Safety stock also must not be a hidden fixed number that the system takes away from available. Shopify keeps safety_stock as its own state, and the admin shows it as unavailable. Show the safety stock rule, the location and the start date to the user. Any automatic change needs a reason and a person.
Events and scheduled reconciliation: in 2026 the rules moved into the API
Orders, cancellations, refunds, receipts, transfers and counts all change stock. Events cut delay. They do not replace a full reconciliation on a schedule. The Shopify webhooks overview states the rules. Shopify does not guarantee order within one topic or across topics for one resource. A products/update delivery can arrive before products/create.
The same page tells apps to sort by the X-Shopify-Triggered-At header or the updated_at value. It tells apps to drop duplicates by X-Shopify-Webhook-Id. It also tells apps to run reconciliation jobs that fetch data again. The inventory guide adds one more line.
Changes to committed, reserved, damaged, safety_stock and quality_control do not trigger webhooks. An app that listens only to inventory_levels/update does not see those changes.
Idempotency keys stop double counts, and versions or timestamps handle out-of-order events. In 2026, Shopify made both into hard API rules. The concurrency protection summary gives the timeline. API 2026-01 added the changeFromQuantity field and an optional @idempotent directive. From API 2026-04, writes such as inventorySetQuantities, inventoryAdjustQuantities and inventoryMoveQuantities must include changeFromQuantity.
You pass the expected current quantity for a compare-and-swap check, or you pass null to skip the check. The same writes must also carry an idempotency key, and the old compareQuantity field is gone. The inventorySetQuantities reference states both rules. Mercado Libre uses the same idea with a different tool.
A stock read returns an x-version header. A stock write must send that header back, and an old version gets HTTP 409. The app then reads again and writes again.
mutation SetOnHand @idempotent(key: "po-1042-receive-sku-881-loc-3") {
inventorySetQuantities(input: {
name: "on_hand"
reason: "movement_received"
referenceDocumentUri: "app://purchasing/po/1042"
quantities: [{
inventoryItemId: "gid://shopify/InventoryItem/30322695"
locationId: "gid://shopify/Location/124656943"
quantity: 161
changeFromQuantity: 101
}]
}) {
inventoryAdjustmentGroup { reason changes { name delta } }
userErrors { field message code }
}
}
This example records a receipt. The location had 101 units on hand and 60 units arrived. The write sets on_hand to 161 only if the current value is still 101. If another process changed the number first, the write fails, and the system must read and calculate again.
It must not overwrite. The idempotency key joins the purchase order number, the SKU and the location, so a retry after a timeout cannot receive the goods twice. The referenceDocumentUri points back to the purchase order for audits.
API 2026-10 has two more changes that touch reconciliation jobs. First, Next Gen Events became generally available on October 1, 2026. A subscription can name triggers, a GraphQL query and a filter, and the delivery carries the query result. Second, on October 19, 2026, Shopify said that exclusive timestamp filters changed.
From API 2026-10, updated_at:>'...T12:00:02Z' skips the full second. A job that asks for "records after the last one I saw" can now miss records written later in that same second. Shopify tells apps to use >= and remove duplicates by id.
Two access changes can stop a night sync job without an error. Public apps must set an IP allowlist by 11:59 PM ET on November 20, 2026. If not, Shopify delists them and blocks new installs (Shopify changelog). For apps that use bulk operations, the date was November 12, 2026, and bulk operations without an allowlist fail. Non-expiring offline tokens must change to expiring tokens before January 1, 2027. From April 1, 2027, requests with old tokens get HTTP 403 (Shopify changelog, October 27, 2026).
Custom apps that agencies install on client stores have their own rule. From November 20, 2026, new installs need an allowlist, and from January 1, 2027, existing installs need one too (Shopify changelog, November 11, 2026). On November 16, 2026, Shopify added a token expiry test switch in the Dev Dashboard. After you turn it on, check the logs of background jobs for rejected requests.
When a token stops working, the dashboard often shows old stock as if it were current. So show data freshness next to each stock number. For each stock event, keep the source event ID, product mapping, location, state and change. Also keep the source time, the receive time and the result. Send failed syncs to an exception queue. If one channel updates and another fails, do not show "all synced". Our API errors and self-healing guide separates rate limits, timeouts, permission errors, bad parameters and source errors, because each one needs a different retry.
What public stock signals add: live calls on five platforms
Your own inventory is the master data for replenishment. Public data adds two things. It shows whether competitors and similar items are in stock on other platforms. It also shows supplier minimum order quantities and dispatch times.
We ran the first round of live calls between 00:15 and 00:27 Singapore time on November 20, 2026. First we read the free capability catalog for parameters and prices, as the quickstart shows. Then we sent each request to POST https://api.everyinfra.com/api/v1/social.
curl -s https://api.everyinfra.com/api/v1/social \
-H "Authorization: Bearer $EVERYINFRA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"platform":"ebay","action":"product_detail","params":{"url":"https://www.ebay.com/itm/366394423324"}}'
| Capability | Singapore time | Rows | Stock fields | Rows with a count | Charge |
|---|---|---|---|---|---|
walmart/search "paper towels" |
00:15:22 | 20 | in_stock, availability, seller_name | 0/20 | $0.001389 |
amazon/search "paper towels" |
00:19:16 | 10 | in_stock, seller_name | 0/10 | $0.002236 |
alibaba1688/search "tissue" |
00:20:04 | 20 | min_order_quantity, stock | 0/20 | $0.002778 |
jd/search "tissue" |
00:20:22 | 5 | — | — | $0.002472 |
ebay/product_detail x8 |
00:23:33 to 00:26:54 | 6, plus 2 ended | quantity_available, quantity_sold | 3/6 | 6 x $0.000958 |
ebay/product_detail x6 (round 2) |
01:12:11 to 01:13:42 | 5, plus 1 empty | quantity_available, quantity_sold | 2/5 | 5 x $0.000958 |
jd/skus x2 |
00:25:06, 00:25:33 | 9 + 17 SKUs | in_stock, stock_state, stock, delivery_promise | 11/26 | $0.0125 + $0.023611 |
alibaba1688/product_detail (async) |
00:26:07 | 1 | min_order_quantity, stock, shipping | 1/1 | $0.001389 |
The Walmart search capability returned 20 rows, and every row had in_stock: true. No row had an availability value this time; the catalog notes that this field is sometimes absent. Walmart.com sold 17 of the 20 items and third-party sellers sold 3. One third-party row had no price. The Amazon search capability returned 10 rows, all in stock and all sold by Amazon.com.
A search page shows "in stock" so that a shopper can buy now. It does not show how many units are left or how many days they last. As a competitor stockout monitor, a search flag catches only the moment when a product goes from in stock to out of stock.
Real walmart/search return at 00:15:22 Singapore time on 2026-11-20: all 20 rows say in_stock true, and no row gives a unit count. EveryInfra API response screenshot
The eBay product detail capability gives more. First we found 8 toner listings on the eBay website. All 8 fit the Brother TN-760, but they are not the same item: there are single cartridges, 2-packs and a toner and drum set. Then we read each item page directly.
Two items had ended and returned an empty result, and the charge was refunded automatically. Of the 6 live items, 3 showed quantity_available: 89, 10 and 3 units. Their quantity_sold values were 110, 217 and 13.
For the item with 10 available and 217 sold, 10 is not an exact count. eBay lets sellers show "More than 10 available" when they have more than 10 units (eBay seller help). The catalog field note also says that quantity_available can read 10 in that case. So 10 means "at least 10". It is not an exact count.
Real ebay/product_detail returns, 00:24 to 00:26 Singapore time. Four TN-760 compatible toner listings: one shows an exact count, one a count capped at 10, and one nothing. EveryInfra API response screenshot
Stock movement shows only when you read the same items again later. Between 45 and 49 minutes after the first round, at 01:12:11 to 01:13:42 Singapore time, we read the 6 live items again (round 2).
| eBay item | Round 1 (Singapore time) | Round 2 (Singapore time) | Available, round 1 to 2 | Sold, round 1 to 2 |
|---|---|---|---|---|
| 366394423324 | 00:24:25 | 01:13:42 | 89 to 89 | 110 to 110 |
| 204821712789 | 00:26:04 | 01:12:51 | 10 to 10 | 217 to 217 |
| 176114928596 | 00:25:28 | 01:12:25 | 3 to empty (refunded) | 13 to empty |
| 336892570717 | 00:25:09 | 01:13:25 | not shown | not shown |
| 267730535660 | 00:26:54 | 01:13:08 | not shown | not shown |
| 127426103027 | 00:26:35 | 01:12:11 | not shown | not shown |
For the two items with counts, available and sold did not change in those 45 minutes. So no unit sold in that window. One hour is too short to estimate daily sales.
The item with 3 units returned an empty result in round 2, and the charge came back. The response does not say whether the item sold out, the seller ended it, or this one read failed. A replenishment system must mark this case "to check" and read again next round. It must not record a competitor stockout. The other three items showed no counts in either round, so they only say "for sale". Read competitor sales daily and watch sold counts for a week or more.
The JD SKU capability is closest to the level that replenishment needs. JD is a large Chinese retail platform. For one Vinda facial tissue product, it returned 9 SKUs, from a 6-pack to a 30-pack. Eight were in stock and one co-branded pack was out of stock.
Only 2 SKUs showed a count: 97 and 516. For one C&S tissue product, it returned 17 SKUs. Sixteen were in stock, one travel pack was out of stock, and 9 showed counts from 27 to 859.
On one product page, the 6-pack, the 24-pack and the 48-pack are different SKUs with different stock.
Convert each pack size to base units. When a 48-pack sells, replenishment must count 48 single packs.
JD also returns delivery_promise, and 20 of the 26 SKUs promised same-day delivery. That is a direct signal of how fast a competitor can ship. Pack sizes on one page can ship at different speeds. The C&S 6-pack of 110-sheet tissue promised delivery on November 22 for orders before 18:00, two days after the 24-pack and the 48-pack. Five SKUs gave no delivery time, and two of them were the two out-of-stock packs.
Note the billing rule for jd/skus. It charges per returned SKU, at $0.001389 each. Nine SKUs cost $0.0125 and 17 SKUs cost $0.023611. Before you watch products with many SKUs, do the math first.
The 1688 product detail capability adds the supply side. 1688 is a large Chinese wholesale marketplace. We searched for facial tissue.
Of the top 20 offers, 13 showed a minimum order quantity. Eight offers started at 1 pack and 2 at 30 packs. One each started at 2, 10 and 24 packs. Seven offers showed none. No search row had a stock value.
We read the detail page of the first offer. The minimum order was 30 packs, and the variant name told buyers to order in multiples of 30. The unit price was 0.89 yuan. The seller promised dispatch within 48 hours, usually ships in about 18 hours, and quoted 2 days for delivery.
The stock field said 9,855,400 packs. That number looks like a placeholder that the supplier typed. A replenishment system can read it as "supply is ample", but not as a real cap.
Public data can say "this competitor variant is out", "a similar item ships same-day on JD", or "this supplier needs 30 packs and 2 days". Those facts support a purchase decision. They cannot tell you how much stock is in your own warehouse.
Keep price watching apart from replenishment too. Price changes can move the timing of a purchase. They cannot replace your own stock and supply data. Our price monitoring subscription product article covers that case.
A suggestion must show its math
A fixed threshold works for a small, stable business. It cannot handle lead time, demand changes, open purchase orders or minimum order quantities. An explainable suggestion shows the sales window, the available and incoming units, and the expected lead time with its spread. It also shows the target service level, the supplier limits and the suggested quantity.
The common safety stock formula comes from a 2011 APICS Magazine article (King, "Crack the Code"). Assume that demand and lead time both vary, are independent and are close to normal. Then safety stock = Z x square root of (cycle demand variance + (lead-time SD x daily demand) squared). The service level sets Z: 1.65 for 95% and 2.05 for 98%. The article also says that a 100% service level is not possible in statistics.
We ran the formula on an example SKU. We fixed the inputs before the calculation. Demand is 12 units per day with a daily standard deviation of 4. The lead-time standard deviation is 3 days, the service level is 95%, and the review is every 7 days. Available is 72, incoming is 60, and the supplier ships in multiples of 30.
| Lead time | Cover days | Safety stock (demand only) | Safety stock (with lead-time SD) | Target stock | Gap | Suggested order (x30) |
|---|---|---|---|---|---|---|
| 7 days | 14 | 24.7 | 64.3 | 232.3 | 100.3 | 120 |
| 14 days | 21 | 30.2 | 66.7 | 318.7 | 186.7 | 210 |
| 21 days | 28 | 34.9 | 68.9 | 404.9 | 272.9 | 300 |
| 28 days | 35 | 39.0 | 71.1 | 491.1 | 359.1 | 360 |
Lead-time spread costs more stock than demand spread. A 3-day lead-time SD at 12 units per day adds a variance of 1,296. Over a 7-day lead time plus a 7-day review, demand variance is only 224.
The first is 5.8 times the second. So safety stock with lead-time spread (64.3) is 2.6 times the demand-only value (24.7). Ask suppliers for the latest arrival day, not only the average.
When the lead time goes from 7 to 28 days, the suggested order goes from 120 to 360 units. Safety stock goes only from 64.3 to 71.1. Most of the increase comes from the units that sell during the lead time. When the lead time goes from 7 to 21 days, the suggestion goes from 120 to 300 units.
The math must not hide behind an "AI suggestion" label. Users need the key inputs and how sensitive the result is to each one. Who can remove promotion weeks from the sales window? What is the starting guess for a new product?
How many days did the last three orders from this supplier take? The Python below is the method behind the table. Each suggestion in the product should expand into steps like these.
import math
def suggest(daily, sd_daily, lead, sd_lead, review=7, z=1.65,
available=0, incoming=0, pack=1):
period = lead + review
safety = z * math.sqrt(period * sd_daily**2 + (sd_lead * daily)**2)
target = daily * period + safety
need = max(0, target - (available + incoming))
return round(safety, 1), math.ceil(need / pack) * pack
print(suggest(12, 4, 21, 3, available=72, incoming=60, pack=30)) # (68.9, 300)
Sort candidates into three groups. "Act now" means that a gap appears before new stock can arrive, based on available, committed, incoming and lead time. "Needs a check" means that sales or lead-time data is missing; the system names the missing field and the person who can check it. "No order now" means that stock or incoming units cover demand, or that the item is being discontinued. Each "no order now" result needs a time, a stock version and an expiry rule. A large order, a supplier delay or a manual count starts a new calculation.
Amazon sellers must add one platform rule. On November 5, 2026, Amazon published its 2027 US fee changes (Seller Forums announcement). From January 15, 2027, FBA fulfillment fees rise by $0.19 per unit on average, about 0.8% of the average price. From February 1, 2027, Amazon removes the storage utilization surcharge. It also folds the aged inventory surcharge into one age-based storage rate, with flat or lower fees for stock that turns in under six months.
The same notice changes the low-inventory-level fee (fee page). The fee applies only when inventory is below 28 days of supply. Amazon bases this on actual shipments in the four weeks before and after the assessment date. Our example SKU has 72 available units and sells 12 per day, which is 6 days of supply. With incoming units it has 11 days. For an FBA seller, 28 days can be the floor for target cover, and each suggestion can show a "low-inventory fee risk" line.
Take each suggestion to a purchase task and to receiving
After the alert, a buyer still picks a supplier and checks the minimum order and pack size. The buyer asks for budget, creates the purchase order, tracks shipping, and receives and inspects the goods. If the product only sends a "low stock" email, the user rebuilds the same facts in several systems. A purchase candidate card can hold the product, variant, location, expected stockout date and suggested quantity. It can also hold open orders, the supplier, the lead time, the math and any exceptions.
After a person approves the card, the system creates a purchase task. It does not place the order itself. Automatic ordering moves real money and real stock. Build it later as a separate feature, with permissions, limits and a way to undo.
Shopify added two parts of this flow in 2026. The Purchase Order Read API, announced on September 17, 2026, adds the inventoryPurchaseOrder and inventoryPurchaseOrders queries in API 2026-10. Apps can read line items, a supplier snapshot in origin.supplierName, and linked transfers. The app needs the separate read_inventory_purchase_orders scope. The release is read-only, so apps cannot create purchase orders through it.
On the same day, Shopify added a canceled receive action. Receiving now has accept, reject and cancel. Cancel records units that will never arrive, and totalReceivedQuantity splits into accepted, rejected and canceled. Before this, missing units stayed open forever or were wrongly marked as rejected. Incoming quantity then stayed too high, and suggestions stayed too low.
Our example shows the size of the effect. At a 21-day lead time, target stock is 404.9 units. With 72 available and 60 incoming, the suggestion is 300 units. Now say that the supplier confirms that 40 of the 60 incoming units will not ship. Without a cancel action, the system still counts 60 incoming and still suggests 300.
With the cancel recorded, incoming drops to 20. The gap becomes 404.9 - 92 = 312.9, and in multiples of 30 the suggestion becomes 330. The 30-unit difference is what the shelf would miss on arrival day. So write all three receiving results back to the incoming count, and recalculate the suggestion after each write.
After receipt, do not assume that all units can be sold. Record count differences, damage and inspection status. Keep the open balance on a partly received order. The full flow is suggestion, approval, order, transit, receipt, inspection, sellable and review. Write the result of each step back into the inputs of the next suggestion. Our unified data API guide covers data objects and state endpoints. The idempotency key from the order number, SKU and location works like the shared ID in our failure refund reconciliation guide.
Multi-warehouse and multichannel stock need written rules
Stock somewhere in the company does not mean that one location can ship. First, the system checks whether a transfer is better than a purchase. Does another warehouse have spare units? How long does the move take, and what does it cost? Does the transfer create a new gap at the source? Transfer suggestions and purchase suggestions need different actions and approvals.
On November 5, 2026, Shopify added location ranking across several fulfillment groups to the unstable order routing function API (Shopify docs). The choice of shipping warehouse is turning into a programmable rule. A replenishment system needs to know the routing rule to judge which location gap is real.
Channel allocation needs rules too. If you send all available units to each channel, you oversell. If you split stock into fixed shares, units sit idle. In a 2026 r/InventoryManagement thread on sync frequency, replies agree on a pattern.
Orders, cancellations and returns go through events, with scheduled reconciliation as a safety net. One system owns the available-to-sell number and reserves stock at the time of the order. Failed syncs and oversells go to an exception queue.
The multi-platform thread shows the other side. A part-time seller listed 8 units on Mercari and eBay. After 7 sold on Mercari, an eBay buyer offered to buy 5. These are personal stories, and they do not prove that any tool works.
They raise three questions. Which system owns the sellable number? How do channel IDs map? Who learns about a failed update?
"Real time" still has concurrent orders, network delay and platform processing time. Do not promise zero oversells. Convert bundles and multi-packs to base parts. When a 2-pack sells, the base count drops by 2. When one part is in several bundles, sum the need at the part level. When a mapping is uncertain, stop the automatic sync and ask a person. Do not keep pushing a wrong number.
A data quality dashboard pays off before a better forecast
Most replenishment errors come from missing lead times, wrong SKU mappings, late counts, canceled orders that never returned to stock, and stale transit status. Turn these gaps into work queues. Which products have no supplier? Which locations have not been counted for a long time? Which events failed? Which purchase orders passed their expected date?
The Shopify sample above gives one ready-made check: the variant sell-out rate. If a store's sold-out variant share goes from 15% to 30%, replenishment is already behind. This is true even when no product is fully sold out.
| Dashboard metric | How to calculate | Example alert line | Action |
|---|---|---|---|
| Variant sell-out rate | Unavailable variants / all variants | 5 points above last week | Create variant-level candidates |
| Products with size gaps | Products with some variants sold out | Over 30% of multi-variant products | Check the size curve and forecast |
| Late purchase orders | Orders past the expected date, not received | Any order 3 days late | Contact the supplier; mark as canceled if needed |
| Sync freshness | Time since the last good sync per channel | Over 2 reconciliation cycles | Check tokens, allowlists and rate limits |
| Inactive stock | Levels with isActive false and quantity above 0 | Above 0 | Activate the location or transfer |
| Suggestion acceptance | Approved suggestions with no change / all suggestions | Below 50% | Read the edit reasons and fix the inputs |
Compare forecasts with results. When did the system expect a stockout, and did it happen? What quantity did it suggest, and why did the approved quantity differ?
How many days did the stock take to sell after arrival, and did it pile up? Record the reason for each manual edit and use it to fix the inputs. For example, assume that a buyer cuts 300 units to 240 and writes "no shelf space". The next suggestion must then use shelf space as a limit.
Track coverage gaps on their own. When a channel token fails, sales seem to drop, and the model may cut demand. When a stock query fails, the system may order too much.
The National Retail Federation found that 53% of holiday shoppers plan to buy online, the lowest share since 2015. Marketplace reported on November 16, 2026 that retailers moved holiday promotions earlier and that NRF forecasts 4.2% growth in holiday sales. Earlier promotions pull demand forward, so the sales window in each suggestion must handle a promotion spike.
Why merchants pay for a replenishment product
Merchants pay for a replenishment product when it saves money. How much margin does one stockout lose? How much cash and storage cost does excess stock hold? How much does the product cut each one?
Use the example SKU again. It sells 12 units per day. If each unit earns $8 of margin, a 5-day stockout loses 12 x 5 x $8 = $480. That excludes the loss of rank and customers. On the other side, 120 extra units at a $6 cost hold $720 in cash.
From February 2027, FBA sellers also pay storage by inventory age. These are example numbers, so use your own margin, cost and stockout days. With these assumptions, one 5-day stockout loses $480 of margin. That is more than 300 times the monthly fee for 50 daily eBay reads in the MVP table below (about $1.44).
Before launch, record a baseline: stockout days per SKU, average days of stock and the number of rush orders over the last three months. After launch, measure the same items the same way. Keep a small control group of SKUs that do not use the suggestions. A dozen SKUs can show the direction. Without a control group, seasonal demand, a new supplier or a fee change all look like wins for the system. A count of alerts sent does not show better replenishment.
Start the MVP with one purchase cycle; API fees are per call
Start with one channel, one warehouse and a few dozen fast-moving SKUs. Build the product mapping, the stock states, the events and reconciliation, and the purchase candidate card. Test them with one full purchase cycle. Complex forecasts, multi-warehouse optimization and automatic ordering can wait.
One possible plan has four weeks. In week 1, build the mapping table and check the first 50 SKUs by hand. In week 2, connect stock states and events, run the first full reconciliation, and record each difference and its cause. In week 3, show purchase candidate cards with their math, as suggestions only. From week 4, run one real purchase cycle from approval to sellable stock, and review it at month end.
Measure the warning time before a stockout, the time to find a sync error and the reasons for edited suggestions. Also measure rush orders, the change in stockouts and excess, and the time from suggestion to order.
Public data fees follow the catalog price. The table assumes a seller with three watch jobs. The seller reads 50 eBay competitor items each day and 20 JD competitor products each week. The seller also reads 40 supplier pages on 1688 each month. The JD average of 13 SKUs per product is the mean of the 9 and 17 SKUs from our two jd/skus calls.
| Watch job | Volume | Catalog price | Cost |
|---|---|---|---|
| eBay competitor items, daily | 50 items x 30 days | $0.000958 per call | about $1.44 per 30 days |
| JD competitor products, weekly | 20 products x 13 SKUs | $0.001389 per SKU | about $0.36 per week |
| 1688 supplier pages, monthly | 40 pages | $0.001389 per page | about $0.056 per month |
Failed and empty requests cost nothing. The two ended listings and the empty round-2 read all cost $0. If a call returns 503, the response shows billing.charged as false; wait for the number of seconds in error.retry_after and send the request again. Each platform page lists the full parameters: Walmart, eBay, JD and 1688.
EveryInfra does not sell an inventory or purchasing system; it sells access to public product data. The model, plan and dashboard above are a design reference for teams that build their own replenishment product.
Industry updates
| Date | Change | What it means for replenishment |
|---|---|---|
| November 20, 2026 | Shopify IP allowlist deadline for public apps (11:59 PM ET); apps without one are delisted and blocked from new installs | Merchants who use third-party inventory sync apps should confirm that the app still pulls data |
| November 19, 2026 | Walmart reported global inventory of $70.6 billion, up 8.1% | Walmart US inventory rose 5.2%; the release names seasonal timing and costs |
| November 5, 2026 | Amazon published 2027 US FBA fees; the low-inventory-level fee will apply only below 28 days of supply | Set 28 days as the floor for target cover on FBA SKUs |
| October 27, 2026 | Shopify told public apps to move to expiring offline tokens before January 1, 2027 | Night sync jobs must refresh tokens, or they get HTTP 403 from April 2027 |
FAQ
What is the inventory replenishment formula? The common form is the APICS 2011 formula. Safety stock = Z x square root of (cycle demand variance + (lead-time SD x daily demand) squared). Target stock = daily demand x (lead time + review period) + safety stock. Suggested order = target stock minus (available + incoming), rounded up to the supplier's pack size. Source of the question: Google suggestion "inventory replenishment formula".
What are the main inventory replenishment methods? Common methods are a fixed threshold, a reorder point (daily demand x lead time + safety stock) and a forecast-based plan. Another is a periodic review up to a target level, which is the method in the example SKU above. The right one depends on how stable sales are and how complete the data is. Periodic review with a visible formula is the easiest to check in a first version. Source: Google suggestion "inventory replenishment methods".
How often should I sync inventory across sales channels? Replies in an r/InventoryManagement thread agree on one pattern. Send orders, cancellations and returns as events, and run a scheduled full reconciliation as a safety net. Slow movers can reconcile daily. Fast movers and promotions need near real-time updates and a buffer. One system should own the sellable number. Source: the 2026 thread "How often do you sync inventory across sales channels?".
Can Shopify sync inventory across variants? Yes. Shopify stores stock on inventory items, one per variant, and each item has one inventory level per location. So the smallest sync unit is variant by location. From API 2026-04, writes need changeFromQuantity and an idempotency key. Source: Google suggestion "shopify sync inventory across variants".
How do I sync Shopify and Amazon inventory? Map each Shopify variant to one Amazon seller SKU. Then map FBA states to Shopify states: fulfillable to available, inbound to incoming, reserved to committed. Keep FBA stock in its own location, because Amazon owns it. Reconcile both sides on a schedule. Source: Google suggestion "shopify amazon inventory sync".
Can I see how much stock a competitor has? Mostly not as a unit count. In our live calls, Walmart and Amazon search gave only in stock or not. Half of the eBay items showed a count, and a count can stop at 10. JD showed counts for 11 of 26 SKUs. Source: Google suggestion "shopify stock sync" and related searches for competitor stock.
References
- Shopify, Ajax API: Product, read 2026-11-20, https://shopify.dev/docs/api/ajax/reference/product
- Shopify Help Center, Setting up inventory tracking, read 2026-11-20, https://help.shopify.com/en/manual/products/inventory/getting-started-with-inventory/set-up-inventory-tracking
- Shopify, Manage inventory quantities and states, read 2026-11-20, https://shopify.dev/docs/apps/build/inventory-management-apps/manage-quantities-states
- Shopify, InventoryLevel object, read 2026-11-20, https://shopify.dev/docs/api/admin-graphql/latest/objects/InventoryLevel
- Shopify, Variants now support multiple barcodes, 2026-09-08, https://shopify.dev/changelog/product-variant-barcode-is-being-replaced-by-barcodes
- Shopify, 2026-04 release notes, read 2026-11-20, https://shopify.dev/changelog/release-notes/2026-04
- GS1, Global Trade Item Number (GTIN), read 2026-11-20, https://www.gs1.org/standards/id-keys/gtin
- Shopify, Apps in inventory management, read 2026-11-20, https://shopify.dev/docs/apps/build/inventory-management-apps
- Amazon Selling Partner API, FBA Inventory API, read 2026-11-20, https://developer-docs.amazon/sp-api/docs/fba-inventory-api
- Walmart Developer, Inventory API overview, read 2026-11-20, https://developer.walmart.com/us-marketplace/docs/inventory-api-overview
- Mercado Libre Developers, Distributed Stock, 2026-04-22, https://developers.mercadolibre.co.cr/en_us/vehicles-manage-packages/distributed-stock
- Shopify, About webhooks, read 2026-11-20, https://shopify.dev/docs/apps/build/webhooks/best-practices
- Shopify, Concurrency protection features for inventory and refund mutations, 2025-12-12, https://shopify.dev/changelog/posts/concurrency-protection-features
- Shopify, inventorySetQuantities mutation, read 2026-11-20, https://shopify.dev/docs/api/admin-graphql/latest/mutations/inventorySetQuantities
- Shopify, More control over commerce updates with Next Gen Events, 2026-10-01, https://shopify.dev/changelog/blog/next-generation-events-are-now-generally-available
- Shopify, Exclusive > timestamp filters exclude the full second, 2026-10-19, https://shopify.dev/changelog/posts/exclusive-timestamp-filters
- Shopify, IP allowlists are now required for public apps, 2026-11-05, https://shopify.dev/changelog/posts/ip-allowlists-are-now-required-for-public-apps
- Shopify, Migrate to expiring offline access tokens before January 1, 2027, 2026-10-27, https://shopify.dev/changelog/posts/migrate-to-expiring-offline-access-tokens-before-january-2027
- Shopify, Amazon EventBridge webhook payload size limit increased to 1 MB, 2026-11-17, https://shopify.dev/changelog/posts/amazon-eventbridge-webhook-payload-size-limit-increased-to-1-mb
- eBay, Quantity (seller help), read 2026-11-20, https://pages.ebay.com.sg/help/sell/contextual/inframe/quantity.html
- Peter L. King, Crack the Code: Understanding safety stock and mastering its equations, APICS Magazine, 2011, https://web.mit.edu/2.810/www/files/readings/King_SafetyStock.pdf
- Amazon Seller Forums, 2027 Updates to US Referral and Fulfillment by Amazon fees, 2026-11-05, https://sellercentral.amazon.com/seller-forums/discussions/t/bc3deccc-28c6-47c1-ade3-9fbed1f29316
- Amazon Seller Central, Low-inventory-level fee 2027, read 2026-11-20, https://sellercentral.amazon.com/help/hub/reference/external/GV43F6S76Y9DHYRH
- Shopify, Purchase Order Read API, 2026-09-17, https://shopify.dev/changelog/posts/purchase-order-read-api
- Shopify, Adding a canceled receive action to the inventory shipments API, 2026-09-17, https://shopify.dev/changelog/adding-a-canceled-receive-action-to-the-inventory-shipments-api
- Shopify, Order routing location rule (unstable), 2026-11-05, https://shopify.dev/docs/api/functions/unstable/order-routing-location-rule#rank-locations-across-multiple-fulfillment-groups
- Reddit r/InventoryManagement, How often do you sync inventory across sales channels?, 2026, https://www.reddit.com/r/InventoryManagement/comments/1wjp9zw/how_often_do_you_sync_inventory_across_sales/
- Reddit r/InventoryManagement, How do you all keep inventory straight across platforms?, 2026, https://www.reddit.com/r/InventoryManagement/comments/1uq9l7k/how_do_you_all_keep_inventory_straight_across/
- Walmart, Earnings Release (FY27 Q3), 2026-11-19, https://stock.walmart.com/_assets/_584724612834b84e661f0caf26ece998/walmart/db/938/10001/earnings_release/Earnings_Release_%28FY27_Q3%29.pdf
- NRF, 2026 holiday shopping trends: What consumers are planning, read 2026-11-20, https://nrf.com/blog/2026-holiday-shopping-trends-what-consumers-are-planning
- Marketplace, This holiday season, consumers may spend more, earlier, 2026-11-16, https://www.marketplace.org/story/2026/11/16/this-holiday-season-consumers-may-spend-more-earlier
- Amazon Seller Central, 2027 US Referral and Fulfillment by Amazon fees, read 2026-11-20, https://sellercentral.amazon.com/gp/help/external/G201411300
- Shopify, App security updates: Thank you, plus what's required next, 2026-11-14, https://shopify.dev/changelog/blog/app-security-updates-thank-you-plus-what-s-required-next
- Walmart Developer, Update inventory in bulk, read 2026-11-20, https://developer.walmart.com/us-marketplace/docs/bulk-inventory
- Amazon, selling-partner-api-models: fbaInventory.json, GitHub, read 2026-11-20, https://github.com/amzn/selling-partner-api-models/blob/main/models/fba-inventory-api-model/fbaInventory.json
- Shopify, Idempotent requests, read 2026-11-20, https://shopify.dev/docs/api/usage/idempotent-requests
- Shopify, 2026-10 release notes, read 2026-11-20, https://shopify.dev/changelog/release-notes/2026-10
- Shopify, Removal of ITEM_NOT_STOCKED_AT_LOCATION error, 2026-06-19, https://shopify.dev/changelog/removal-of-itemnotstockedatlocation-error
- ASCM, Peter L. King, Courtney Bigler: Calculate Inventory with Precision, Even Amid Variability, 2025-09-21, https://www.ascm.org/ascm-insights/safety-stock-a-contingency-plan-to-keep-supply-chains-flying-high/
- Shopify, Recent changes to Shopify's platform, read 2026-11-20, https://shopify.dev/changelog
- Shopify, Restrict API access with an IP allowlist, read 2026-11-20, https://shopify.dev/docs/apps/build/dev-dashboard/ip-allowlist
- Amazon Seller Central, FBA inbound placement service fee, read 2026-11-20, https://sellercentral.amazon.com/help/hub/reference/external/GC3Q44PBK8BXQW3Z
- Shopify, IP allowlists are now required for custom apps installed outside your organization, 2026-11-11, https://shopify.dev/changelog/posts/ip-allowlists-are-now-required-for-custom-apps-installed-outside-your-organization
- Shopify, Opt in to Admin API token expiry in the Dev Dashboard, 2026-11-16, https://shopify.dev/changelog/posts/opt-in-to-admin-api-token-expiry-in-the-dev-dashboard
Originally published on the EveryInfra blog: Inventory Data to Replenishment Product: From Stock Alerts to Purchase Tasks. This article was written with AI assistance; the numbers come from the API calls and sources linked above, and were checked before publishing.
EveryInfra is a pay-per-call data API for AI agents and developers: everyinfra.com.
來源:DEV Community · dev.to


