Shopify field mapping
Shopify inventory to availability
variant.inventory_quantity + inventory_policy + inventory_management
availability
Availability cannot be read from the Shopify inventory quantity alone. A variant with zero on hand is still purchasable when its inventory policy allows overselling, and a variant with inventory tracking switched off reports zero while being permanently available.
The Shopify side
- API field
- variant.inventory_quantity + inventory_policy + inventory_management
- Called
- Inventory quantity, and whether to continue selling when out of stock
- Found at
- Product → Variants → edit variant → Inventory
- Feeds
- availability
Before and after
Real values on the left as Shopify stores them, on the right as a channel needs them.
| In Shopify | In the feed | Note |
|---|---|---|
| quantity 12, policy deny | in_stock | The straightforward case. |
| quantity 0, policy deny | out_of_stock | Genuinely unavailable. |
| quantity 0, policy continue | in_stock | Overselling allowed, so the item is purchasable. The quantity alone would be wrong. |
| quantity -3, policy continue | in_stock | Negative stock from oversells. Still purchasable. |
| inventory not tracked | in_stock | Quantity is meaningless when tracking is off. Common on made-to-order and digital goods. |
| quantity 0, policy continue, pre-order tag | preorder | Where the channel supports it, with an availability date if you have one. |
The transformation, step by step
-
Check whether inventory is tracked at all
When inventory management is not set, Shopify does not track the variant and the quantity is meaningless. Those items are always purchasable, so they are in stock regardless of what the number says. This single check fixes more wrong availability values than any other.
-
Read the inventory policy before the quantity
A policy of continue means the variant keeps selling at zero and below. Those items are in stock even on a negative quantity, and treating the number alone as truth removes purchasable products from every channel.
-
Sum quantity across locations, but only the ones you sell from
A multi-location store holds stock in warehouses that do not fulfil online orders. Summing everything makes unavailable items look available; using one location makes available items look out of stock. Choose the locations deliberately.
-
Map to the channel's vocabulary
Most channels take in_stock and out_of_stock with underscores, some accept preorder and backorder, and the Content API uses "in stock" with a space. One internal state mapped per channel is safer than writing the literal value at the source.
-
Regenerate on inventory changes, not only on a timer
Availability is the fastest-moving value in a feed and the one channels check against your product page. A daily regeneration guarantees hours of disagreement every day, so this is the field that justifies webhook-driven updates.
What goes wrong
Untracked inventory reads as zero
Switching inventory tracking off is how many stores handle made-to-order and digital products. The API still reports a quantity, and it is zero, so a quantity-only mapping marks the entire range out of stock while it is selling perfectly well.
The policy field is easy to overlook
Continue selling when out of stock is a per-variant setting that merchants use for backorders and pre-orders. Ignoring it means every backorderable product disappears from every channel the moment its count reaches zero.
Availability is checked against your page
Google crawls the landing page and compares what it finds to the feed. An availability value that is right at generation time and stale by the time of the crawl produces a mismatch disapproval, which is why cadence matters as much as the mapping.
Multi-location stores need a deliberate answer
Stock sitting in a retail shop or a supplier warehouse is not stock you can ship online. The sum across all locations is the convenient value and often the wrong one, and the error only surfaces as cancelled orders.
How feedlab maps it
feedlab resolves availability from the whole inventory picture rather than the quantity: untracked variants are in stock, a continue policy keeps an item in stock at or below zero, and quantity is summed only across the locations you nominate. Regeneration can be driven by inventory webhooks so the value is current between scheduled runs.
Frequently asked questions
Why are my in-stock products showing as out of stock?
Usually because availability was mapped from the inventory quantity alone. Variants with inventory tracking switched off report zero, and variants set to continue selling at zero are still purchasable.
How does Shopify inventory policy affect availability?
A policy of continue means the variant keeps selling at or below zero, so it is in stock whatever the count says. A policy of deny means zero really is out of stock.
Should I sum inventory across all Shopify locations?
Only across the locations that actually fulfil online orders. Including retail or supplier locations makes unavailable items look available, which ends in cancelled orders rather than a feed error.
How often should availability be refreshed?
As often as your channels allow, and ideally driven by inventory webhooks rather than a timer. It is the fastest-moving field in a feed and the one channels verify against your product page.
Errors this mapping causes
Attributes involved
Related concepts
Primary sources
Channel specifications change. These are the official documents this page is based on.