Cost of Goods Sold is the direct cost of the products you actually sold in a period. For ecommerce sellers it is the single number that decides whether your margins are real or imagined.
Cost of Goods Sold (COGS) is the direct cost of producing or acquiring the goods a business sold during a specific period. It appears on the income statement directly below revenue. Subtract COGS from revenue and you get gross profit. For an ecommerce seller, COGS is the landed cost of the units that left your inventory and reached a customer, recognized in the same period the sale was recognized.
The defining word is sold. COGS is not what you spent on inventory this period. It is the cost of the specific units that converted into sales. Inventory you bought but have not sold yet sits on the balance sheet as an asset. It becomes COGS only when it sells.
"Cost of goods sold" draws roughly 9,900 US searches a month, and most explanations stop at the textbook formula. The textbook formula is correct and, for multi-marketplace sellers, almost useless on its own. The part that matters is how you cost each unit.
COGS for a period is calculated as:
Beginning Inventory + Purchases − Ending Inventory = COGS
| COMPONENT | WHAT IT MEANS |
| Beginning inventory | Value of unsold stock at the start of the period |
| Purchases | Cost of inventory acquired during the period (including freight in) |
| Ending inventory | Value of unsold stock at the end of the period |
| COGS | The difference, equal to the cost of what sold |
If you began the month with $40,000 of inventory, bought $25,000 more, and ended with $38,000, your COGS for the month is $27,000. That $27,000 is what you match against the month's sales to get gross profit.
Include every direct cost of getting a sellable unit into inventory:
These are operating expenses, not COGS. They live below gross profit on the income statement:
Misclassifying marketplace fees as COGS is the most common error we see. Fees reduce profit, but they are not the cost of the goods. Keep them separate or your gross margin will look worse than it is and your operating expenses will look smaller than they are.
The period formula gives you one blended COGS number for the whole business. That is fine for a tax return. It is worthless for deciding which SKU to reorder, which to discontinue, and which is quietly losing money.
Multi-marketplace sellers need COGS at the unit level, and they need a costing method. FIFO (first in, first out) assumes the oldest inventory sells first, so each unit that sells is costed at the price you actually paid for that batch. When your supplier raises prices or a tariff changes mid-year, FIFO keeps your margins honest by matching the real cost of the specific units sold rather than a smoothed average.
Done by hand across thousands of SKUs and several marketplaces, per-unit FIFO COGS is unmanageable. This is the calculation ConnectBooks runs automatically: it applies FIFO COGS per unit as it syncs Amazon, Shopify, Walmart, eBay, and TikTok Shop sales into QuickBooks or Xero, so each sale carries its true cost and your per-channel P&L reflects real margin. See /integrations/amazon-accounting.
COGS is the bridge between revenue and gross profit, and gross profit is the bridge to gross margin. Get COGS wrong and every downstream number is wrong. For how gross margin differs from net margin, and why ecommerce sellers obsess over the gap, see /glossary/gross-margin-vs-net-margin.
| NEXT STEPConnectBooks applies FIFO COGS per unit across every channel, so your gross margin is real, not estimated. Plans start at $149/mo. See /pricing. |
No. Referral fees, FBA fulfillment fees, and storage fees are selling and operating expenses, not the cost of the goods. They belong below gross profit on the income statement. Treating them as COGS understates your gross margin and distorts which products look profitable.
Inbound shipping is, because freight to get inventory into your possession is a direct cost of the goods. Outbound shipping to the customer is usually treated as a selling expense rather than COGS, though practice varies by accountant. Be consistent with whichever method you choose.
COGS is the direct cost of the units you sold. Operating expenses are the costs of running the business that are not tied to a specific unit, such as advertising, software, and overhead. Both reduce profit, but they sit in different parts of the income statement and answer different questions about your business.
FIFO costs each sold unit at the price you actually paid for the oldest batch in stock, which keeps margins accurate when supplier prices or tariffs change. Average cost smooths everything into one blended number, which hides the impact of cost changes on the units selling right now. For sellers managing real inventory, FIFO produces more honest per-SKU margins.
Every period you close your books, which for a serious ecommerce seller means monthly. Calculating COGS only at year-end leaves you flying blind on margin for eleven months. Automated per-unit costing lets you see accurate COGS continuously rather than in an annual lump.
Clean, accurate books make this manageable. Start a free trial of ConnectBooks to get settlement-level accuracy and real margin visibility for your ecommerce business. No credit card required.
Running an e-commerce business comes with plenty of challenges, but ConnectBooks is here to make your life easier. With real-time insights, seamless integrations, and detailed tracking of your profitability and inventory, you can stay ahead of the game. Whether you’re selling on Amazon, Shopify, Walmart, TikTok or eBay, ConnectBooks helps you manage your finances with 100% accuracy and confidence, so you can focus on growing your business.
Ready to level up? Start making smarter, data-driven decisions every step of the way. Try ConnectBooks Free Today or Schedule a Demo