Your COGS number is probably wrong. Not by a little — by enough to hide whether last month made money. The COGS formula itself is simple. The mistake happens one layer down, in how you book inventory when it arrives. Expense a purchase order on the day it lands, and your Cost of Goods Sold tracks what you bought, not what you sold. Those are two different businesses on paper.
This is the single most common bookkeeping error we see on ecommerce P&Ls. Let's fix it.
The COGS formula is not your problem
Here is the standard formula, and it is correct:
Beginning Inventory + Purchases − Ending Inventory = COGS
That's it. The IRS lays it out the same way in Publication 334, and every accounting textbook agrees. Say you started the month with $40,000 of inventory, bought $25,000 more, and ended with $38,000. Your COGS is $27,000. That $27,000 is the cost of the goods you actually sold — nothing more.
Notice what the formula does. It backs out cost from the change in inventory. It never asks "how much did you spend this month." It asks "how much inventory left the shelves." NerdWallet walks through the same calculation, and Shopify's COGS guide does too. The math is settled.
So if the formula is right, why is your number wrong?
The real error: expensing inventory when you buy it
Most owners never touch that formula. Their bookkeeping software does something simpler and quieter — and wrong.
When you pay a supplier, the transaction gets coded straight to a COGS or "inventory purchases" expense line. The $25,000 you spent hits the P&L the day the money leaves. That feels intuitive. You spent it, so it's an expense, right?
No. You bought an asset. The cash turned into stock sitting in a warehouse. It is not a cost until a customer buys it.
Book it as an expense on purchase day and your COGS becomes a record of your buying habits. Order a big restock in March and March looks brutal — even if sales were flat. Skip a reorder in April and April looks like your best month ever. Your gross margin swings wildly with your purchasing calendar, and it tells you nothing about how the business is actually performing. This is why store owners stare at their P&L and can't reconcile why COGS looks wrong.
Both Shopify's ecommerce accounting guide and BigCommerce's accounting primer flag this as a foundational setup decision, not a preference.
The one fix: route purchases through an inventory asset account
Here is the correction. It is two steps, and it changes everything downstream.
Step 1 — When inventory arrives, book it as an asset. Code the supplier payment to an Inventory asset account on your balance sheet. Not an expense. The $25,000 sits there as stock you own.
Step 2 — When something sells, move its cost to COGS. As units ship, transfer their cost out of Inventory and into COGS. This is the entry that finally connects cost to a sale.
Now COGS moves with revenue, not with your purchase orders. Sell $50,000 and the matching product cost lands right beside it. That's the matching principle — costs recognized in the same period as the revenue they produced. It's the whole point of sound retail financial management.
Most bookkeeping tools can automate step two if you tell them a landed cost per SKU. The setup takes an afternoon. The payoff is a P&L you can trust every month, not just at year-end when your accountant trues it up.
Don't forget what belongs inside the cost
Getting the accounting flow right is half the job. The other half is loading the correct cost onto each unit.
COGS is not just the price on the supplier invoice. It's the landed cost — everything spent to get a unit sellable and on your shelf:
- Product cost from the supplier
- Inbound freight and shipping (freight-in)
- Import duties and tariffs
- Inspection, repackaging, and prep fees
Freight-in is the most-skipped item. If you ship product in and expense the freight separately, your per-unit cost is understated and your margin looks better than it is. We cover this trap in detail in freight-in and COGS. What does not go in COGS: the cost to ship an order to a customer, marketplace fees, and ad spend. Those are operating costs — see the difference in ecommerce contribution margin and marketplace fees.
What a correct COGS unlocks
Once COGS tracks selling instead of buying, three things become real.
Your gross margin means something. Revenue minus a true COGS is a clean read on unit economics. Full breakdown in the gross margin glossary and in ecommerce margins decoded.
You can price with confidence. If you don't know the real cost of a unit, every markup is a guess. A landed COGS is the floor every price sits on.
Cash and profit stop looking like the same thing. A big restock drains cash without touching profit. That distinction is where founders get blindsided — and it's exactly what our inventory costing hub and the cost of goods sold guide are built to keep straight.
For the deeper accounting walkthrough, start with cost of goods sold for ecommerce and the COGS tracking subtopic hub.
The takeaway
The COGS formula is not the thing that's wrong. Your inventory bookkeeping is. Route purchases through an asset account and move cost to COGS only when a unit sells. That one change makes your gross margin real and your monthly P&L reconcilable.
This is the kind of gap CentSight surfaces automatically. As the intelligence layer on top of QuickBooks and your bank, it reads your live ledger — synced on demand, as often as every fifteen minutes — and flags when COGS is tracking purchases instead of sales. See the full picture at the ecommerce finance hub. If it confirms what you already know, you're out $95. If it doesn't, it just found the margin you were missing.




