Cost of Goods Sold for Ecommerce: What to Include

Last verified: June 2026

Key takeaways

Cost of goods sold (COGS) is the direct cost of acquiring or producing the inventory you sell — and getting it right is what determines whether your ecommerce business actually makes money.

  • COGS includes product cost, inbound freight, tariffs and duties, manufacturing overhead, and direct labour — anything required to bring inventory to a sellable state.
  • It excludes marketing spend, platform fees, fulfillment labour, and storage rent — those live in operating expenses (OpEx), not COGS.
  • Items sellers most often miss: freight forwarding fees, quality control costs, packaging materials, and the landed cost of returns.
  • Your inventory valuation method (FIFO, LIFO, or weighted average) changes which costs hit your income statement and when — so the choice matters for both tax and margin reporting.
  • Accurate COGS unlocks per-SKU profitability, defensible pricing, and financial forecasting you can actually trust.

What is cost of goods sold for ecommerce?

Cost of goods sold (COGS) is the total direct cost of the inventory a business sells during a specific period. In practice, it's the number on your income statement that sits between gross revenue and gross profit — and it's where ecommerce brands either build margin or quietly destroy it.

The formula is straightforward:

COGS = Opening Inventory + Purchases (including all acquisition costs) − Closing Inventory

But "purchases" is where most sellers go wrong. A product bought from a supplier in Shenzhen doesn't just cost what's on the invoice. By the time it lands in your warehouse, you've added ocean freight, import duties, customs broker fees, possibly quality control inspection costs, and domestic drayage. All of that is COGS. Leave any of it out and your gross margin number is wrong.

COGS captures costs that attach to the product itself — costs that vary directly with how many units you actually move. Operating expenses are the costs of running your business regardless of what's on your shelves. For an ecommerce brand selling on Amazon and Shopify simultaneously, this distinction matters enormously. Your Amazon referral fee is not COGS — it's a selling expense. Your factory's raw materials cost is COGS. Confuse the two and you get a gross margin figure that's either optimistically wrong or uselessly conservative. If you're working out how your chart of accounts should be structured, our ecommerce chart of accounts guide covers exactly where these lines should sit.

Why COGS matters for ecommerce sellers

COGS matters because gross margin is the most honest signal of product-level health — and you can't trust gross margin without accurate COGS.

A lot of ecommerce founders obsess over top-line revenue and net profit, and ignore the middle. But gross margin is where pricing decisions live. If you're selling a product for £35 and your true COGS (including landed costs) is £22, you've got £13 — a 37% gross margin — to absorb fulfillment costs, platform fees, marketing, and your own salary. If you've been calculating COGS as just the supplier invoice (say £16), you think you have a 54% margin, you price accordingly, and you slowly go broke at scale.

We've seen exactly this pattern. A brand doing £800,000 in annual revenue, convinced they're highly profitable — until someone properly lands the freight and duties costs and discovers the "profitable" product line runs at 18% gross margin. That's before a single paid ad.

Beyond pricing, accurate COGS is essential for:

  • Tax reporting. COGS is a deduction against revenue, so understating it costs you money; overstating it is tax fraud. Neither is a position you want to be in.
  • Inventory valuation. Your balance sheet carries unsold inventory as an asset. That asset value depends entirely on the cost basis you assign to each unit.
  • Cash flow forecasting. If you don't know what it costs to replenish stock, you can't model how much cash you need to support growth.
  • Investor and lender conversations. Anyone looking at your financials will normalise your numbers to gross margin first. Messy COGS means a messy story.

For sellers running multiple channels — Amazon, Shopify, eBay, Etsy — COGS also enables channel-level profitability analysis. You might find that Etsy buyers return items at twice the rate of Shopify buyers, which meaningfully changes the effective COGS per sold unit on that channel. You can't see that without tracking it. Our broader guide to ecommerce accounting covers how all these pieces connect at a financial reporting level.

On accrual versus cash accounting: COGS is one of the primary reasons accrual accounting is standard for product businesses. You want costs matched to the period in which the related revenue is recognised — not the period in which you wired money to your supplier. If you haven't decided which method you're using, our cash vs accrual accounting explainer lays out the tradeoffs clearly.

What to include in your ecommerce COGS calculation

Your ecommerce COGS calculation should include every cost directly required to bring a product to a sellable state — and nothing beyond that.

Product cost (supplier invoice)

This is the starting point — the per-unit price you pay your manufacturer or wholesale supplier. For private-label brands, it's the factory price. For resellers, it's the wholesale cost. This is the one cost almost everyone gets right.

Inbound freight and shipping

Getting inventory from your supplier to your warehouse costs real money, and that cost is part of COGS. This includes ocean freight (usually per-container or per-CBM), air freight when you're expediting, domestic trucking from port to warehouse, and last-mile delivery from freight forwarder to your 3PL.

Worked example: if you ship a container of 2,000 units and ocean freight costs £3,200, that's £1.60 per unit added to COGS. Ignore that and your margin calculation is off by £1.60 on every unit you sell.

Import duties, tariffs, and customs fees

Any duty levied at the border — UK import VAT (recoverable, so often excluded from COGS on VAT-registered businesses), customs duty based on HS code, US Section 301 tariffs on Chinese goods, antidumping duties — these are product acquisition costs. They belong in COGS.

US sellers importing from China in 2026 are dealing with tariff rates that, depending on product category, have been significant. The landed cost of a product with a meaningful duty rate can look very different from the factory price. Omitting it from COGS isn't a minor rounding error — it can be the difference between a 40% gross margin and a 25% gross margin.

For brands importing across multiple geographies, this connects to broader operational complexity — our international CPG operations guide covers how to structure your ops stack to handle multi-market procurement.

Freight forwarding and customs broker fees

Your freight forwarder charges for documentation, booking, and carrier coordination. Your customs broker charges for filing entries and handling classification. Both are direct costs of getting inventory into your warehouse, and both belong in COGS.

Raw materials (for manufacturers)

If you manufacture your own products rather than buying finished goods, raw materials are the core of COGS. Every component, sub-assembly, and raw material that ends up in the finished product gets included — at the cost you paid for it.

Direct labour

Labour that directly touches production belongs in COGS. For brands with their own manufacturing or assembly operations, this means wages for workers who physically make or assemble the product. It does not include warehouse staff who pick and pack outbound orders — that's fulfillment, which is OpEx.

The distinction matters. A brand that does light assembly (kitting products together, adding inserts, applying custom labels) before items go to a 3PL has a labour cost that's legitimately COGS. The same brand's customer service team is not.

Manufacturing overhead

Manufacturing overhead covers the indirect costs of running a production facility — factory rent, equipment depreciation, utilities at the production site, quality control staff. These get allocated to COGS on a per-unit basis, typically using a standard overhead rate tied to direct labour hours or machine hours.

For most ecommerce brands buying finished goods rather than manufacturing, this category is small or nonexistent. But if you run any production operations, leaving overhead out will consistently understate your true product cost.

Packaging materials (product packaging)

This is genuinely contested territory, so let's be direct: packaging materials integral to the product — the box a product ships in as its primary packaging, the blister pack, the bottle — belong in COGS. They're part of what you're selling.

Generic poly mailers or outer shipping boxes used for fulfillment are a different story and typically sit in operating expenses. The test is whether the packaging is part of the product (custom-printed box, branded tissue, retail packaging) or purely a fulfillment input.

Quality control and inspection costs

If you hire a third-party QC firm to inspect goods at the factory before shipment — common practice for private-label brands sourcing from Asia — that cost is part of bringing inventory to a sellable state. It goes in COGS.

Common COGS items ecommerce sellers miss

Most sellers get the supplier invoice right. The gaps almost always appear in the costs that surround it.

Freight forwarder and broker fees (again)

Honestly, this is the one we see misclassified most often — by experienced operators, not just people just starting out. A brand spending £15,000 a year on customs brokerage fees and lumping it into "professional services" in OpEx is misclassifying a material COGS item. On £600,000 of inventory purchases, that's 2.5% off your gross margin calculation.

The landed cost of returns

When a customer returns a product, there are costs: the return shipping you absorb, any inspection or repackaging labour, restocking fees charged by your 3PL. If the product is unsellable, you've also lost the original COGS for that unit. Treating returns purely as a revenue reversal — without accounting for the cost side — overstates gross margin.

A worked example: you sell a £45 product. Customer returns it. You credit £45. But you also absorb £4.50 in return postage, £2 in 3PL restocking labour, and the original COGS of £18 (because the unit is damaged and can't be resold). Total economic loss on that one return: £24.50. If you only book the revenue reversal, your P&L thinks this cost £18.

Sample and development costs

Pre-production samples, development rounds, prototype iterations — if these are for products you actually launch, a portion of those costs should be absorbed into COGS (typically spread across the initial production run). Brands that expense everything immediately understate the true cost basis of their first inventory batch.

Duty drawback adjustments

If you import goods and subsequently export them (or import materials used in products that are exported), you may be entitled to duty drawback — a refund of duties paid. When you receive a drawback, that's a reduction of COGS, and it should be recorded as such rather than as miscellaneous income.

Storage costs (partial)

This one has genuine nuance. Ongoing warehouse storage is an operating expense. But storage costs incurred as part of bringing inventory into a ready-for-sale state — bonded warehouse fees while goods are cleared through customs, for example — are arguably a cost of acquisition and belong in COGS. The rule of thumb: if the storage happens before the inventory is sellable, it's COGS-adjacent; if it happens after, it's OpEx.

What definitely doesn't belong in COGS

Getting the exclusions right matters just as much as getting the inclusions right. These costs are operating expenses.

  • Marketplace fees. Amazon referral fees, Etsy transaction fees, eBay selling fees — these are costs of selling, not costs of acquiring inventory. They belong in OpEx. For a closer look at how to record these correctly, see our guide on recording Amazon fees, refunds and reserves.
  • Fulfillment labour. Picking, packing, and dispatching outbound orders is a fulfillment cost. If you use a 3PL, pick-and-pack fees are OpEx. If you do it in-house, the labour is OpEx. This is separate from direct manufacturing labour.
  • Outbound shipping to customers. The cost of getting a product from your warehouse to the customer is a fulfillment cost, not a product acquisition cost.
  • Marketing and advertising. Amazon PPC spend, Google Shopping, Meta ads — none of this is COGS. It's a customer acquisition cost sitting in OpEx.
  • Customer service. Staff answering emails and processing returns are an operational cost, not a product cost.
  • Software subscriptions. Your inventory management platform, your accounting software, your ecommerce platform fees — OpEx.
  • Storage rent (ongoing). Warehouse rent paid monthly to house finished goods is an overhead expense, not a product cost.

Amazon FBA fees are the one we see mixed into COGS most often. FBA fees are a fulfillment cost Amazon charges per unit shipped — a real cost, sometimes a large one, but a cost of selling and delivering the product rather than acquiring it. They belong in operating expenses. Mixing them into COGS artificially depresses gross margin and makes it impossible to compare profitability across channels.

How to track and separate COGS from other expenses

Knowing what belongs in COGS is one thing. Building a system that actually captures it correctly — across multiple SKUs, multiple suppliers, and multiple channels — is another challenge entirely.

Build a landed cost calculation into every purchase order

The time to calculate true product cost is when you raise a purchase order, not six months later when you're trying to reconcile your books. For each PO, build a landed cost worksheet: start with the supplier invoice, then add freight (estimated by weight/volume), duties (look up the HS code and applicable rate), broker fees (often a fixed amount per shipment you can average across units), and QC costs if applicable.

When the actual invoices arrive, reconcile against your estimates and update the unit cost. Over time, your estimates get more accurate because you're tracking real variances.

Use inventory valuation methods consistently

Once you know the cost of each batch of inventory, you need a method for deciding which costs hit COGS when you sell units. The three standard approaches:

  • FIFO (First In, First Out): The oldest inventory is deemed sold first. In a rising-cost environment, this gives higher closing inventory values and lower COGS — meaning higher reported gross profit. Most product businesses use this as the default.
  • LIFO (Last In, First Out): The most recently acquired inventory is deemed sold first. Permitted under US GAAP but not under IFRS. In a rising-cost environment, it produces higher COGS and lower taxable income. Not commonly used in ecommerce, but worth knowing.
  • Weighted average cost: You average the cost across all units in inventory at the time of each sale. Simpler to implement and smooths out cost fluctuations between purchase orders. Works well for brands with high product velocity and relatively stable costs.

The method you choose has real financial consequences. If you buy 500 units at £10 each in January and another 500 at £12 each in March, then sell 600 units, your COGS is either £6,200 (FIFO) or £6,600 (LIFO) or a weighted-average figure in between — a meaningful difference in a single quarter that grows more consequential as your volumes scale. Pick one method, apply it consistently, and document the choice.

Set up dedicated COGS accounts in your chart of accounts

Your chart of accounts should have separate COGS lines for each meaningful cost category: product cost, inbound freight, import duties, and so on. Lumping everything into one "cost of goods" line makes it impossible to analyse where your costs are moving. If inbound freight doubles one quarter because you switched to air freight for a launch, you want to see that as a specific line item — not hidden inside a blended number.

Our ecommerce chart of accounts guide covers the specific account structure we recommend for Amazon and Shopify sellers, including how to separate COGS from fulfillment costs.

Track COGS per SKU

Aggregate COGS is a starting point. Per-SKU COGS is where the decisions live. If you're selling 40 products and three of them are carrying your overall margin, you need to know which three — and you can't know that without assigning costs at SKU level.

This means logging the landed cost of each product variant as a line item in your inventory records. When you sell a unit, the COGS entry should reference that SKU's specific cost, not a blended average across your whole catalogue. For brands with hundreds of SKUs, doing this without a proper system tends to collapse into spreadsheet chaos fairly quickly — either your inventory management tool handles it, or your accounting integration does, but something has to.

Reconcile settlements to actual revenue and COGS

Ecommerce settlement payouts are notoriously hard to reconcile. Amazon pays you a net figure every two weeks that bundles sales, refunds, fees, reserves, and reimbursements into a single deposit. If you're trying to post accurate COGS against each sale from your settlement data, you need to see the gross sales figure — before all the deductions — and match it to the inventory that moved.

Done manually at any real volume, that reconciliation breaks. We've written separately about why your Amazon and Shopify payouts don't match your books — the core problem is that platforms report on a cash basis per payout cycle, while accrual accounting requires you to recognise revenue (and the matching COGS) at point of sale.

Review COGS monthly, not quarterly

Monthly COGS review catches errors before they compound. Check whether the inbound freight rate still matches your estimate. Did a duty rate change (it happens)? Did you receive a supplier credit or duty drawback that needs to reduce your COGS? Has your 3PL adjusted its handling fees in a way that affects anything you've misclassified? A half-hour once a month now means you're not untangling twelve months of drift come year-end.

Frequently asked questions

What is the difference between COGS and operating expenses for ecommerce?

COGS is the direct cost of acquiring or producing the inventory you sell — product cost, inbound freight, duties, and direct manufacturing inputs. Operating expenses (OpEx) are the costs of running your business that aren't tied directly to the goods themselves — marketplace fees, advertising, fulfillment labour, software subscriptions, and customer service. The distinction determines gross margin (revenue minus COGS) versus operating profit (gross margin minus OpEx), and getting it wrong distorts both numbers.

How do I calculate COGS for imported products with tariffs and duties?

Start with the supplier invoice, then add every cost incurred to bring the goods to your warehouse: ocean or air freight, freight forwarder fees, import duties (based on the applicable HS code tariff rate for your product and country of import), customs broker fees, and any domestic drayage. This total is your landed cost — divide by unit count to get cost per unit, and that's the figure you carry into COGS when each unit sells. For VAT-registered UK businesses, import VAT is typically recoverable through your VAT return and excluded from COGS; customs duty is not recoverable and stays in COGS.

Should packaging materials be included in COGS or operating expenses?

Packaging integral to the product — the retail box, branded outer carton, product-specific inserts, custom labelling — belongs in COGS as part of the cost of the sellable unit. Generic fulfillment materials like plain poly mailers, void fill, and outer dispatch boxes are fulfillment costs and sit in operating expenses. When in doubt, ask whether the packaging would exist if there were no product: product packaging yes, fulfillment packaging no.

Getting your COGS right: what to do next

Accurate COGS requires a system, and that system has to be built deliberately. Start by auditing your current chart of accounts against the inclusion and exclusion list above. Are freight forwarding fees in COGS or miscategorised as professional services? Are Amazon fees correctly in OpEx? Are you landing duties and tariffs into product cost? These are fixable — and fixing them sharpens your margin reporting immediately, not eventually.

Next, build a landed cost template for every purchase order going forward. It doesn't need to be complicated — a spreadsheet with supplier cost, freight estimate, duty rate, and broker fee, calculated per unit, is enough to start. Update it with actual costs when invoices arrive. After six months of doing this consistently, you'll have a real cost history per SKU rather than rough estimates, which makes FIFO or weighted-average COGS calculations far more defensible.

For sellers running on Amazon, Shopify, eBay, or Etsy, the hardest part is usually linking your inventory cost data to your settlement data — connecting what you paid for stock to what you actually sold in each payout period. Done manually, it's painful and error-prone. Ceendesis Accounting is built for exactly this: it parses settlement and payout files from Amazon, Shopify, eBay, Etsy, Walmart, TikTok Shop, Square and WooCommerce, splits each payout into sales, fees, refunds, reserves and tax, and posts accrual-correct journals — with per-product COGS — into your ledger. It's built around Xero today, with QuickBooks Online support rolling out; there's no Sage integration yet. For brands where settlement reconciliation is eating hours every month and COGS is still a manual estimate, it's worth your time to take a look.

Get gross margin right and your pricing decisions, inventory calls, and channel strategy all follow from something real. Get it wrong and you're making those same decisions based on a number someone invented by accident.