Profitability & COGS

FIFO COGS: how ShipWave costs your inventory

Why First-In-First-Out costing matters for accounting accuracy, how cost layers are built from receipts and adjustments, and how consumption stays atomic at ship time.

What FIFO costing is

FIFO stands for First-In-First-Out. When you receive inventory at different costs over time (a PO at $40/unit, then another at $45/unit, then a return at $42/unit), ShipWave stores each receipt as a separate cost layer. When a unit ships, the oldest layer is consumed first—same order the inventory came in. This is the cost-accounting standard most US small businesses use, and it's what your CPA will expect on year-end financials.

Why it matters

Without FIFO layers, you'd either average all your costs together (which obscures margin changes when costs rise) or guess. With FIFO, your profitability dashboard shows real per-order margin based on the actual cost of that specific unit. Your inventory valuation at month-end matches the IRS expectation for cost-of-goods-sold deductions. And your opportunities engine can spot when margins are declining because costs rose faster than prices did.

How layers are created

A new FIFO layer is created any time inventory flows in: PO receipts (cost = vendor invoice unit price + landed-cost allocation), manual inventory adjustments with a cost specified, returns coming back into stock (cost = original consumed cost in assembled_kit mode, or current most-recent layer cost in components mode), and MO completions for BOM-produced finished goods (cost = components consumed + labor). Each layer stores: SKU, qtyReceived, qtyRemaining, unitCost, source (PO/MO/Return/Adjustment), and timestamp.

Atomic consumption at ship time

When an order ships, ShipWave wraps the cost consumption in a Postgres transaction with a per-SKU advisory lock. This serializes all concurrent ship events for the same SKU, so two simultaneous shipments can't accidentally consume the same layer twice. The transaction: (1) finds the oldest layer with qtyRemaining > 0, (2) consumes as much as it can, (3) moves to the next layer if more is needed, (4) writes a CogsConsumption record per layer touched, (5) commits. If any step fails, the entire transaction rolls back and the ship action retries cleanly.

Opening balance backfill

If you had inventory in ShipWave before FIFO costing was enabled, the system creates a single opening-balance layer per SKU using your previously-stored cogs field as the unit cost and your current on-hand as the quantity. This layer is treated as the oldest, so it's consumed first—exactly the right behavior for legacy stock. You can see the backfill layers in the SKU's cost history with source OPENING_BALANCE.

FAQs

Can I use weighted-average costing instead?
Not currently. FIFO is the only supported method. Most US tax filings expect FIFO or LIFO; ShipWave standardizes on FIFO for consistency across the dashboard.
What happens if I sell more than I have layers for?
ShipWave consumes available layers, then creates a "negative" stub layer at the most recent known cost. When you receive the backfill PO, ShipWave reconciles the stub. You'll see a warning in the dashboard until reconciled.
Are landed costs (freight, duties, broker fees) included?
Yes, if you record them on the PO. ShipWave allocates landed costs across PO line items by line value (default) or by weight, and bakes them into each layer's unitCost.
What about kits and BOMs?
Kits don't have their own layers&mdash;they consume from their components' layers at ship time. BOM finished goods have their own layers created at MO completion. See <a href="/help/kits-vs-boms">Kits vs. BOMs</a>.

More in Profitability & COGS

  • Marketplace fee ingestion

    How ShipWave pulls real fee data from Amazon, Shopify, eBay, and Walmart so your profitability numbers reflect what each channel actually charges you.

  • The profitability dashboard

    See revenue, COGS, fees, shipping, and overhead stacked together to understand real net margin per order, SKU, channel, and warehouse.

  • Inventory valuation

    See the dollar value of every SKU sitting on your shelves and snapshot month-end totals for accounting.

  • Opportunities Found: 8 ways ShipWave spots money on the table

    Heuristics that surface SKUs losing money, declining margins, cheaper suppliers, slow movers, and shipping outliers&mdash;capped to a human-reviewable cadence.

  • Overhead allocation

    Spread fixed monthly overhead (rent, utilities, software, salaries) across SKUs so the profitability dashboard shows fully-loaded margin.