E-Commerce8 min read2026-06-24

Cost of Goods Sold Ecommerce: What Counts and What Most Brands Get Wrong

Cost of Goods Sold Ecommerce: What Counts and What Most Brands Get Wrong

Cost of goods sold ecommerce looks like a settled accounting concept. It isn't. The formula is simple. The hard part is deciding what goes inside it. Most brands get this wrong, and not because they're careless. They get it wrong because keeping COGS accurate is operationally hard when you ship thousands of orders a month.

This guide gives you a decision rule, not a textbook definition. By the end, you'll know exactly where 3PL fees, returns processing, custom packaging, and shipping upgrades belong.

The textbook definition is the easy part

COGS is the direct cost of producing the goods you sold. Beginning inventory plus purchases minus ending inventory equals COGS. Shopify's COGS guide and NerdWallet's breakdown both walk the formula cleanly.

The IRS treats COGS as a deduction from gross receipts, not an expense line. Publication 334 spells out the categories: cost of products, freight-in, and direct labor to get goods sale-ready.

So far, so clean. The problem starts when a real order leaves your warehouse. A single sale touches manufacturing, inbound freight, a 3PL pick fee, a custom box, and an outbound shipping label. Which of those is COGS? Which is operating expense? The wrong answer inflates your gross margin and hides where money actually leaks.

The decision rule that ends the debate

Here is the test. Ask one question of every cost:

Does this cost rise and fall with each unit you sell?

If yes, it belongs in COGS. If it stays roughly flat whether you ship 100 orders or 1,000, it's an operating expense.

This per-unit logic is what separates a useful gross margin from a vanity number. Shopify's ecommerce accounting guide frames the same boundary: direct, product-tied costs sit above the gross margin line. Everything that runs the business sits below it.

One caution. Tax treatment and management reporting don't always match. The IRS has its own rules for what you capitalize into inventory. Your internal margin view can be stricter. Keep both, and reconcile them quarterly with your accountant.

Running the four hard costs through the rule

Now the costs that actually trip founders up.

3PL fulfillment fees. Pick, pack, and per-order handling charges scale directly with orders shipped. That's COGS. Your monthly warehouse storage minimum doesn't move with sales — that's an operating expense. Split the 3PL invoice into variable and fixed buckets. Most brands dump the whole bill into one line and lose the signal.

Custom packaging. A branded box that goes into every shipment scales per unit. It's COGS. The design cost you paid once to create the box is not — that's a one-time operating expense. Per-unit packaging is one of the most under-counted line items in ecommerce. BigCommerce's accounting primer lists packaging among the direct costs brands routinely miss.

Shipping upgrades. Outbound shipping is genuinely contested. If you charge the customer and shipping is part of delivering the product, treat it as COGS — it rises with every order. If you absorb it as a marketing promotion ("free shipping over $50"), some brands log it as a selling cost. Pick one treatment and apply it consistently. Inconsistency here is the single biggest source of fake margin.

Returns processing. Inbound shipping, inspection labor, and restocking fees all scale with returned units. That's COGS — a contra-revenue and cost adjustment on the goods that came back. If your return rate is climbing, this number tells you before your bank balance does. Dig into the pattern in our returns analysis hub.

Why your product costs are probably wrong right now

Here's the uncomfortable truth. Product costs in most ecommerce books are frequently and significantly wrong. Not from sloppiness — from operational reality.

Supplier prices change mid-quarter. Freight rates spike. You reorder at a new unit cost while old inventory still sits in the warehouse. Unless you're actively maintaining cost layers, your COGS drifts from reality every single week. This is exactly why inventory costing methods like FIFO and weighted average exist — and why the method you choose changes your reported margin.

The fix isn't heroic spreadsheet work. It's a process you can sustain. Update unit costs on every purchase order. Reconcile inventory monthly. And watch gross margin as a live number, not a quarter-end surprise.

This is where an intelligence layer on top of QuickBooks and your bank earns its keep. CentSight reads your live ledger — synced on demand, as often as every fifteen minutes — and flags when margin moves before it shows up in next month's close. A fractional CFO costs $8K–$15K a month to catch the same drift. CentSight is $95/mo.

Get the classification right, and margin becomes actionable

When COGS is built on the per-unit rule, your gross margin finally means something. You can see which SKUs actually make money after fulfillment and returns. You can price with confidence instead of guesswork.

That clarity compounds. Accurate COGS feeds accurate gross margin, which feeds real decisions about discounting, ad spend, and which products to cut. Get the definition itself straight in our cost of goods sold glossary entry, then see how it shapes the full picture in true margins.

Marketplace and platform fees deserve the same scrutiny — they quietly erode the margin you think you have. Map them in our marketplace fees breakdown. For the complete walkthrough of how these costs stack, read ecommerce margins decoded.

Strong financial management for retail starts with knowing your real cost to sell one unit. Shopify's retail finance guide makes the same point: the operators who win are the ones who measure margin honestly.

The takeaway

Stop debating COGS line by line. Apply one rule to every cost: if it rises and falls with each unit sold, it's COGS. If it's flat, it's an operating expense.

Run your 3PL fees, custom packaging, shipping upgrades, and returns through that test. Update unit costs every time you reorder. Reconcile monthly. Then watch gross margin as a live signal, not a quarter-end reveal.

Get this right and you stop guessing at profitability. Start at the ecommerce finance hub or go deep on the discipline in COGS tracking.

Gerald Hetrick
Gerald Hetrick

Founder, CentSight

Gerald writes about financial intelligence, cash flow strategy, and how AI is changing the way growing businesses understand their numbers.

Get Financial Clarity for Your Business

AI-powered financial intelligence with real-time visibility — built for growing businesses.

Start Free Trial

Stop Guessing. Start Knowing.

CentSight gives growing businesses real-time financial intelligence.