Cost of goods sold is what the units you sold cost you to get ready to sell. Not what you spent on inventory this month. Not what you paid your supplier last quarter. What the specific units that left your warehouse cost. That distinction is the whole subject, and getting it wrong is the most common reason an ecommerce profit and loss statement is fiction.
This walks through what belongs in COGS, what does not, how the timing works, and a worked example with real numbers.
What goes in
For a seller who buys finished goods and resells them, COGS includes:
- The unit price your supplier charged
- Inbound freight to get the goods to you or to a fulfillment center
- Duty, tariffs and customs brokerage
- Prep, labeling and packaging done before the unit is sellable
- Inspection and quality control on the shipment
Add those together and divide by the units in the shipment. That is your landed cost per unit, and landed cost per unit multiplied by units sold is your COGS for the period.
What stays out
Outbound shipping to the customer is a selling expense, not COGS, in most seller setups. So are marketplace referral fees, fulfillment fees, storage, advertising, software subscriptions, and the salary of whoever answers customer emails. All of those are real costs and all of them reduce your profit. None of them are the cost of the goods.
Why does the line matter if the bottom line is the same either way? Because gross margin is the number you use to make pricing and sourcing decisions, and a gross margin polluted with advertising spend cannot tell you whether your supplier is competitive. Keep the layers clean and each one answers a different question.
The timing rule that trips everyone
Buying inventory is not an expense. It is a swap: cash becomes inventory, both on the balance sheet. Nothing hits the income statement. The expense happens when the unit sells.
This is why a seller who wired $200,000 to a factory in November can show a profitable November. The cash left, but the value did not. It sat in a container. When those units sell in February and March, the cost lands then.
The IRS guidance in Publication 538 on accounting periods and methods covers the underlying requirement: a taxpayer who keeps inventories generally uses an accrual method for purchases and sales. It also sets out the small business taxpayer gross receipts test, which in the January 2022 revision of that publication was $26 million of average annual gross receipts over the previous three years and is indexed for inflation, so check the current figure for your tax year before relying on it. Sellers under the threshold get some flexibility. Sellers who want financial statements that mean anything should use accrual regardless.
Picking a cost method
You will buy the same SKU at different prices over time. Freight moves, tariffs change, your supplier raises prices. So when you sell a unit, which cost do you use?
FIFO assumes the oldest units sell first. For imported goods this usually reflects physical reality and it is the most common answer in ecommerce. Publication 538 lists FIFO among the permitted inventory valuation methods, alongside LIFO, specific identification, and lower of cost or market.
Weighted average blends all units in stock into one cost. Simpler to maintain, smoother results, less accurate during a period of sharp cost movement.
Specific identification tracks the actual cost of the actual unit. Practical for high-value or serialized goods, impractical for a thousand units of a $9 item.
Pick one, document it, and stay with it. Changing methods to improve a period has tax consequences and is not a spreadsheet preference.
A worked example
You place two purchase orders for the same SKU.
January: 2,000 units. Factory invoice $6.40 each, so $12,800. Ocean freight and brokerage $1,900. Duty $1,150. Prep and inbound $1,100. Total $16,950, which is $8.48 per unit landed.
April: 2,500 units. Factory invoice $6.95 each, so $17,375. Freight and brokerage $3,400 because rates moved. Duty $1,560. Prep and inbound $1,300. Total $23,635, which is $9.45 per unit landed.
Note that the factory price rose 8.6 percent while landed cost rose 11.4 percent. Freight did most of that damage. A seller tracking only the invoice price would have concluded their costs went up 8.6 percent and priced accordingly, and would have been wrong by nearly a full point of margin.
Now you sell 3,000 units in the following quarter. Under FIFO, the first 2,000 come out at $8.48 and the next 1,000 at $9.45. COGS is $16,960 plus $9,450, so $26,410. Ending inventory is 1,500 units at $9.45, which is $14,175.
If those 3,000 units sold at an average of $24.99, revenue is $74,970 and gross profit is $48,560, a gross margin of 64.8 percent. Fees, advertising, returns and overhead all come out below that line, and the number that survives to the bottom will be a great deal smaller. That is expected. What matters is that the 64.8 percent is real, because it is the number you will use the next time your supplier asks for a price increase.
Where sellers get it wrong
Expensing purchase orders on payment. Produces wild swings that track your buying calendar rather than your business.
Using a single static cost per SKU. Convenient, and increasingly wrong as landed costs drift. Update it every time a shipment lands, or use a method that handles layers.
Ignoring freight and duty. Most common on imported goods, and it can hide two or three points of margin.
Forgetting returned units. A resellable return goes back into inventory at its original cost. An unsellable one is a write-off, not a COGS reversal. Treating them the same overstates inventory.
Never counting. Book inventory and physical inventory diverge. Shrinkage, damage, miscounts and marketplace losses are all real. Count, adjust, and put the adjustment somewhere visible rather than burying it in COGS.
Doing this without losing your week
At a handful of SKUs, a spreadsheet with a landed cost tab and a FIFO layer schedule works fine. Past a few dozen SKUs across more than one marketplace, the maintenance burden is what breaks, not the concept. Automated COGS assignment and settlement reconciliation is the specific reason tools like ConnectBooks exist for multi-marketplace sellers.
Either way, the discipline is the same. Landed cost, not invoice cost. Recognize when the unit sells, not when you pay. One method, consistently applied. Count what you actually have. Do those four things and your gross margin becomes a number you can make decisions with, which is more than most sellers can say about theirs.
If you want a plain-language reference on which business records to keep while you set this up, the Small Business Administration’s guide to managing your finances covers the basics without assuming an accounting background.
