OrderOpsBETA
All procedures

FIFO cost layers & COGS

How landed cost flows from receipt to the order that consumed it.

OrderOps tracks what your stock actually cost using FIFO cost layers. Every receipt creates a layer at its landed cost; every order consumes the oldest stock first; the cost lands as COGS on the exact line item that consumed it.

Receipts create layers

When you receive stock, log the landed cost per unit alongside the quantity. The receipt and its cost layer are created together, atomically — no receipt without a layer, no layer without a receipt. You can receive ad hoc or book against a purchase order, which tracks ordered versus received per supplier through draft, partial, and received states.

Orders consume oldest first

When an order deducts stock, units come out of the oldest active layer — ordered by the date the stock was received. When a layer runs dry it is marked depleted and the next oldest takes over. Each deduction records an allocation against the order line: that allocation is your COGS, at the price you actually paid for those specific units.

So if you bought a SKU at $4.10 in March and $4.60 in May, orders keep consuming $4.10 stock until the March layer is gone. Your margin reports reflect that, not a blended guess.

Where it shows up

The inventory report aggregates per SKU: units sold, revenue, COGS from the layer allocations, margin and margin %, current stock, and last-sold date. Filter by 24 hours, 7, 30, or 90 days, or all time, and sort by most sold, lowest stock, recently sold, or name.

What FIFO does not do

Every cost layer event — receive, deduct, cost update, rollback — lands in the inventory activity trail with before/after snapshots, so you can always trace where a COGS number came from. If your stock counts themselves look off, reconcile against Shopify first; how stock behaves across sister stores is covered in pooled vs independent stock.

FIFO cost layers & COGS — OrderOps Docs