Track cost of goods sold at the shipment level, not the SKU level, when your landed cost changes every time a container lands. Each purchase order becomes its own cost layer with its own unit cost. When a unit sells, you relieve the oldest layer first (FIFO), post that specific cost to COGS, and reduce inventory by the same amount. The SKU’s “cost” stops being a single number and becomes a stack of dated layers, which is the only structure that gives you a true margin when the same product cost $9.10 in March and $11.65 in July.
The worked example below uses three shipments of one SKU and shows where the arithmetic bites. It assumes accrual books, which IRS Publication 538 says a business accounting for inventory generally must use for purchases and sales, and which requires you to value inventory at the beginning and end of each year using a consistent method.
Why a single average cost fails
Most sellers start with one cost per SKU in a spreadsheet, updated whenever they remember. Under stable prices that is fine. Under 2024 to 2026 freight and tariff swings it produces margins that are wrong by five to ten points in either direction, and wrong in the direction that hides the problem: when costs rise, the stale number overstates margin on exactly the units you should be repricing.
A weighted average that updates with each shipment is better and is an accepted method, but it smears a July cost increase back across units you bought in March and have already sold. FIFO keeps each shipment’s cost attached to the units from that shipment, so your margin report for March reflects March costs.
The example: one SKU, three shipments
Landed cost means product cost plus inbound freight, duties and inbound handling, divided by units received. Outbound shipping, marketplace fees and advertising are not part of it. The definition and formula are laid out at https://www.connectbooks.com/blog-posts/glossary-cost-of-goods-sold-cogs-for-ecommerce if you want the glossary version before the arithmetic.
Shipment A, received March 4: 1,000 units, product $7,800, freight $1,100, duties $200. Landed $9,100, or $9.10 per unit.
Shipment B, received May 22: 1,500 units, product $12,300, freight $2,250, duties $315. Landed $14,865, or $9.91 per unit.
Shipment C, received July 30: 1,200 units, product $11,040, freight $2,400, duties $540. Landed $13,980, or $11.65 per unit.
Inventory asset after all three: $37,945 for 3,700 units. The SKU has three cost layers, not one cost.
Relieving layers as units sell
Say you sold 900 units in March and April, 1,300 in May through July, and 800 in August.
March and April: 900 units all from Shipment A at $9.10. COGS $8,190. Layer A has 100 units left.
May through July: 1,300 units. The first 100 come from Layer A at $9.10 ($910), the next 1,200 from Layer B at $9.91 ($11,892). COGS $12,802. Layer B has 300 units left.
August: 800 units. 300 from Layer B at $9.91 ($2,973), 500 from Layer C at $11.65 ($5,825). COGS $8,798. Layer C has 700 units left, inventory asset $8,155.
Compare that to a single average. Total landed $37,945 over 3,700 units is $10.26. Under a flat average, March COGS would be $9,234 instead of $8,190, understating March margin by $1,044 on 900 units. August COGS would be $8,208 instead of $8,798, overstating August margin by $590. Each month is wrong in the direction that misleads you about the trend.
What this means for pricing
If that SKU sells for $24.99 on Amazon in a 15 percent referral category with, say, a $5.50 fulfillment fee, gross margin after fees on a Layer A unit is $24.99 minus $3.75 minus $5.50 minus $9.10, or $6.64. On a Layer C unit it is $4.09. That is a 38 percent drop in unit contribution from a cost change you might never see in a blended number. Sellers who see it raise price or cut ad spend in August. Sellers who do not see it find out in January.
How to set it up
Capture landed cost per PO, not per invoice. Freight and duty invoices arrive weeks after the product invoice. Hold the PO open until all three are in, then compute the per-unit figure once. Posting product cost to inventory and freight to an expense account is the most common error and it understates inventory while overstating expenses in the receiving month.
Give every receipt its own layer. In a spreadsheet, that is one row per shipment with units received, landed cost, and units remaining. In accounting software with inventory, it is a receipt against a PO. Never overwrite a SKU’s cost field; add a layer.
Relieve oldest first, and record which layer. The COGS journal for a period should trace back to specific receipts. That traceability is what an auditor or a buyer’s due diligence team will ask for, and what the Small Business Administration’s guidance on managing business finances means when it talks about keeping records that support your statements.
Handle partial shipments and short receipts. If 1,200 units were ordered and 1,174 arrived, the landed cost is divided by 1,174, and the freight paid for 1,200 is spread across the units that exist. Do not carry phantom units.
Reconcile the layers to a count quarterly. Layer math drifts when units are lost, damaged or returned unsellable. A physical or FBA count against the sum of remaining layers, with the difference written off to a shrinkage account, keeps the asset balance real.
Where software takes over
Past a few dozen SKUs and a few shipments a month, the spreadsheet version breaks under its own weight, because a single miskeyed receipt corrupts every subsequent COGS entry. Inventory-aware accounting connectors do the layer relief automatically as marketplace sales post. ConnectBooks, for example, computes COGS per unit sold and posts it into QuickBooks Online, QuickBooks Desktop Enterprise or Xero along with the sale, so the inventory asset moves with each settlement rather than in a month-end adjustment. Other tools post a summarized COGS entry per payout from a cost you maintain. Either beats the blended number, and the choice between them is about whether you want the layers inside the ledger or beside it.
Whatever holds the layers, the discipline is identical: one shipment, one cost, oldest out first, and a count every quarter to prove it.
