A small confession from the accounting side of the internet: we get a little excited about landed cost. Not birthday-party excited. More like finding-a-twenty-in-your-winter-coat excited.
That's because landed cost is where a lot of ecommerce margins go missing. A product that "costs $8" from the supplier might cost $10 by the time it's on your shelf, and if your books still say $8, your margin is fiction with a decimal point.
This article covers how cost of goods sold works for ecommerce, how to calculate landed cost, and what a sound monthly inventory routine looks like.
What counts as cost of goods sold in ecommerce?
Cost of goods sold (COGS) is the cost of the specific products you sold during a period. For an online store, that usually includes:
- The purchase price from your supplier or manufacturer
- Inbound freight to get goods to your warehouse or 3PL (third-party logistics provider)
- Import duties and customs broker fees
- Packaging that ships with the product, if you choose to treat it that way consistently
What usually isn't COGS: ad spend, app subscriptions, office rent, and your own salary. Those are operating expenses. Outbound shipping to customers and payment processing fees sit in a gray zone. Many stores show them just below COGS as "cost of sales" or "fulfillment" so gross margin reflects the true cost of getting an order out the door. Pick a treatment, write it down, and use it every month.
The COGS formula
Here's the classic periodic calculation:
Beginning inventory + purchases during the period minus ending inventory = cost of goods sold
Say you start March with $40,000 of inventory at cost, buy $25,000 more (landed), and count $38,000 on hand at the end of the month. COGS for March is $40,000 + $25,000 minus $38,000 = $27,000.
This is why an accurate count matters so much. Overstate ending inventory by $3,000 and COGS drops by $3,000, which makes profit look $3,000 better than it was.
How to calculate landed cost
Landed cost is the total cost to get a product to the place you sell it from. Here's a hypothetical shipment of 1,000 water bottles:
| Cost | Amount |
|---|---|
| Supplier invoice (1,000 units at $8) | $8,000 |
| Ocean freight and trucking | $1,200 |
| Import duties | $640 |
| Customs broker fee | $160 |
| Total landed cost | $10,000 |
| Landed cost per unit | $10.00 |
The bottles sell for $32. With an $8 cost, gross margin per unit looks like 75%. With the true $10 cost, it's 68.75%. Across 1,000 units, that's $2,000 of margin that only ever existed on paper.
When costs arrive at different times (the freight bill comes three weeks after the goods), record them to inventory as they come in and spread them across the units in that shipment. If you have many products in one container, allocate freight by weight, volume or value. Choose one sensible method and stick with it.
Inventory accounting for ecommerce, in plain English
Inventory accounting for ecommerce comes down to one idea: inventory is an asset until it sells.
When a shipment arrives, the cost goes on the balance sheet. When units sell, their cost moves from inventory to COGS on the income statement. When stock goes missing, gets damaged or expires, it's written down.
A lot of small stores skip this and expense every purchase order as it's paid. That creates whiplash. A $30,000 restock in November makes November look terrible, and December (full of sales from that stock with no cost recorded) looks fantastic. Neither month tells you anything useful, a bit like judging your diet by the one week you ate only salad.
How you track the flow matters too. Common methods include FIFO (first in, first out, where the oldest costs go to COGS first) and weighted average cost. Your inventory software may pick one by default. How inventory is treated for tax purposes, including which method to use and whether any small-business simplifications apply, is a question for your CPA. The bookkeeping job is to keep counts and costs accurate so they have solid numbers to work from.
A monthly inventory routine
Here's a practical checklist for stores with a few hundred SKUs or fewer:
- Record every inbound shipment to inventory at landed cost, including late freight and duty bills.
- Reconcile inventory units in your system to your warehouse or 3PL report.
- Do a physical count or cycle count (a rotating count of a portion of your SKUs) on a set schedule.
- Book COGS for units sold, using your chosen method.
- Write down damaged, lost or obsolete stock.
- Review gross margin by product line and look for anything that moved more than a point or two.
If you sell through Amazon too, inventory held at Amazon's warehouses needs its own reconciliation. Our guide to Amazon seller accounting and settlement reports covers how fees and reimbursements interact with stock.
What your margin is actually telling you
Once COGS is right, gross margin becomes a number you can act on. You can see which products deserve more ad spend, which need a price increase, and which are really just expensive hobbies.
Gross margin is only half the story, though. A product line with a great gross margin can still lose money once ad spend and fulfillment are counted. Our article on gross margin vs net margin explains how to read the two together. And if you haven't yet separated your store's sales report from your real profit and loss, start with why your Shopify dashboard isn't your P&L.
Questions owners ask
Is shipping to customers part of COGS?
It depends on how you set up your chart of accounts. Many ecommerce businesses group outbound shipping and fulfillment just below product cost so gross margin reflects the full cost of delivering an order. What matters most is applying the same treatment every month.
What is landed cost in ecommerce?
Landed cost is the total cost of getting a product to where you sell it from: the supplier price plus freight, duties, broker fees and similar costs. Using landed cost in inventory gives you an accurate COGS and margin.
How often should an online store count inventory?
At least once a year in full, and ideally with cycle counts throughout the year. Stores with high volume or frequent shrinkage often count fast-moving SKUs monthly.
Want a margin you can actually trust?
Our ecommerce accounting service records landed cost, reconciles inventory to your warehouse, and closes the books each month with a review before reports reach you. Request a consultation to walk through your products and suppliers, or check the Scope & Investment Estimator for a planning range.