Inventory is the largest pile of cash most ecommerce businesses own, and the one they can see least clearly. A stock count tells you how many units exist. It does not tell you which of them are moving, which will run out during the campaign you just funded, and which have been sitting since spring paying rent.

Two sources of truth, reconciled rather than merged

Most stores have inventory numbers in two places, and they disagree. Shopify knows what a shopper can still buy, and it decrements on every sale through every channel it knows about — including channels your analytics never saw. Your own production or purchase records know what you made or bought and what was defective.

ORVX resolves this with a stated order of precedence rather than a silent average:

  • Shopify inventory present → Shopify wins. It is the storefront's own truth about availability and it accounts for sales ORVX never saw.
  • Otherwise, production data present → ORVX remaining (produced − defected − sold).
  • Otherwise → unknown, and it says so.

When both exist and disagree materially, the product is flagged as a conflict with both figures shown. A produced count and a storefront count that disagree is an operational fact — usually shrinkage, an unrecorded channel or a bad receipt — and averaging them away destroys the only signal that something is wrong.

NULL is not zero

Shopify returns no value for a variant that does not track inventory. That is not "out of stock". A catalogue of untracked variants rendered as a wall of zeros is the specific bug this module was written to prevent, and it is the reason "unknown" is a state ORVX is willing to display.

Velocity and days of stock, over windows that are published

Stock runway Sales velocity = units sold ÷ 30 (trailing 30 days) Days of stock = units remaining ÷ velocity Dead stock = no sale in 90 days

Both windows are fixed and travel with the figures, because days of stock computed over 7 days on one screen and 60 on another is two different metrics wearing one name. A 30-day window is short enough to react and long enough to survive a slow week.

What this surfaces

  • Stockouts before they happen. A product with eleven days of stock and a campaign scheduled for the next month is a problem with a deadline.
  • Dead stock, quantified. Not just which SKUs have not sold in 90 days, but how much capital is sitting in them at cost.
  • Overstock against velocity. Nine months of cover on a product selling three a week is a purchasing decision to revisit, not a safety margin.
  • Reconciliation conflicts. Where your counts and the storefront's have drifted apart, and by how much.

Stock is a profit question, not a logistics one

The reason inventory sits inside a profitability product rather than beside one is that the two decisions are the same decision. Capital tied up in a slow SKU is capital not funding a fast one, and a product's margin only matters alongside how quickly it turns.

A 45% margin at two units a month and a 22% margin at forty are not comparable on margin alone — and ranking a catalogue on margin without velocity is how a business ends up proud of a product that earns almost nothing per quarter.