You sold 12,000 units last year at an average price of $28. Your supplier invoices total $96,000, so your COGS is $8.00 per unit and your gross margin is 71%. Except it is not, because you also spent $14,400 on ocean freight, $7,200 on customs duties, $3,600 on FBA prep fees, and $4,800 on inbound shipping to Amazon warehouses. Your actual COGS is $10.50 per unit, your gross margin is 62.5%, and every pricing and purchasing decision you made last year was based on numbers that were wrong by 24%.
This is the most common financial mistake in e-commerce: understating Cost of Goods Sold. Inventory accounting and COGS calculation are the foundation of every profit metric you rely on — gross margin, contribution margin, SKU-level profitability, and ultimately your taxable income. Get COGS wrong, and everything downstream is wrong.
This guide covers the mechanics of inventory accounting for online sellers: what COGS actually includes, how to calculate landed cost, the three inventory valuation methods, when and how to write down inventory, physical counting versus perpetual systems, year-end tax implications, and software setup in QuickBooks Online. For the broader e-commerce bookkeeping framework, see our complete e-commerce seller bookkeeping guide.
COGS (Cost of Goods Sold) represents the direct costs of producing or acquiring the products you sell. For manufacturers, this includes raw materials, direct labor, and factory overhead. For e-commerce resellers — the majority of Amazon, Shopify, and Etsy sellers — COGS includes every cost required to get inventory from the supplier to the point of sale.
| Cost Component | Included in COGS? | Where Sellers Typically Miss It |
|---|---|---|
| Product purchase price | Yes | Usually tracked correctly |
| International freight (ocean, air) | Yes | Often expensed as “Shipping” instead of capitalized |
| Customs duties & tariffs | Yes | Often expensed separately or missed entirely |
| Customs broker fees | Yes | Small per-shipment cost, often ignored |
| Domestic freight (port to warehouse) | Yes | Lumped with outbound shipping |
| Inspection fees (pre-shipment QC) | Yes | Classified as “professional services” |
| FBA prep & labeling | Yes | Classified as “fulfillment” expense |
| Inbound shipping to FBA | Yes | Classified as “shipping” expense |
| Packaging materials (poly bags, boxes) | Yes | Classified as “supplies” expense |
| Insurance on shipments | Yes | Classified as “insurance” expense |
What is NOT included in COGS:
The IRS standard: Under IRS Publication 334, COGS for merchants includes “the cost of products or raw materials, including freight” and “storage costs” (for goods not yet sold). The key test is whether the cost is directly attributable to getting the product into sellable condition. If it is, it belongs in COGS. If it is a cost of selling or delivering the product, it is an operating expense.
Landed cost is the total cost to acquire one unit of inventory, fully loaded with all costs required to make it available for sale. Here is a detailed worked example for a product sourced from China and sold on Amazon FBA:
You purchase 5,000 units of a kitchen gadget from a supplier in Shenzhen, China.
| Cost Component | Total Cost | Per-Unit Cost |
|---|---|---|
| Supplier invoice (FOB Shenzhen) | $40,000 | $8.00 |
| Ocean freight (Shenzhen to LA) | $3,200 | $0.64 |
| Marine cargo insurance (0.5% of goods value) | $200 | $0.04 |
| US customs duties (HTS rate: 7.5% of declared value) | $3,000 | $0.60 |
| Customs broker fee | $350 | $0.07 |
| Drayage (port to prep center) | $800 | $0.16 |
| FBA prep (poly bagging + labeling at prep center) | $1,500 | $0.30 |
| Inbound shipping (prep center to Amazon FBA) | $1,250 | $0.25 |
| Total Landed Cost | $50,300 | $10.06 |
The gap: Your supplier invoice says $8.00/unit. Your actual landed cost is $10.06/unit — a 25.8% difference. On 5,000 units, that is $10,300 in costs that belong in COGS but that many sellers expense as separate line items scattered across their P&L.
This product sells for $24.99 on Amazon:
| Metric | Using Supplier Cost Only ($8.00) | Using Full Landed Cost ($10.06) |
|---|---|---|
| Unit Revenue | $24.99 | $24.99 |
| COGS | $8.00 | $10.06 |
| Gross Profit | $16.99 | $14.93 |
| Gross Margin | 68.0% | 59.7% |
| After Amazon Fees (~32%) | $8.99 | $6.93 |
| After Advertising (~$3.00/unit) | $5.99 | $3.93 |
| Net Contribution per Unit | $5.99 (24.0%) | $3.93 (15.7%) |
The difference between a 24% and a 15.7% contribution margin is the difference between a product worth scaling and a product that barely breaks even at volume. And the only variable that changed is the accuracy of your COGS.
Your inventory valuation method determines how the cost of goods is assigned to units sold (COGS) and units remaining in stock (ending inventory). The method you choose affects your gross margin, your taxable income, and your balance sheet.
FIFO assumes that the oldest inventory is sold first. The cost of the oldest units in stock is assigned to COGS, and the newest units remain in ending inventory.
Worked example:
| Purchase | Units | Cost Per Unit | Total Cost |
|---|---|---|---|
| January (Batch 1) | 1,000 | $9.50 | $9,500 |
| April (Batch 2) | 1,000 | $10.25 | $10,250 |
| July (Batch 3) | 1,000 | $10.75 | $10,750 |
| Total Available | 3,000 | $30,500 |
You sell 2,200 units during the year. Under FIFO:
When FIFO works best: Rising costs. FIFO assigns older, cheaper costs to COGS, resulting in higher gross margins and higher taxable income. This is the most commonly used method for e-commerce sellers and is the default in QuickBooks Online.
Weighted average recalculates the cost per unit after each purchase by dividing total inventory cost by total inventory units.
Using the same example:
After January: Average cost = $9,500 / 1,000 = $9.50/unit
After April: Average cost = ($9,500 + $10,250) / 2,000 = $9.875/unit
After July: Average cost = ($9,500 + $10,250 + $10,750) / 3,000 = $10.167/unit
When weighted average works best: High-volume sellers with frequent, smaller purchase orders. The averaging smooths out cost spikes and simplifies bookkeeping (no need to track which batch each unit came from). Commonly used with inventory management systems that automatically recalculate average cost on receipt.
Specific identification tracks the actual cost of each individual unit sold. Used when each unit is unique or high-value (handmade jewelry, custom products, vintage items, refurbished electronics).
When specific identification works best: Etsy sellers with handmade goods, sellers of unique or one-of-a-kind items, or sellers with a small number of high-value SKUs where the per-unit cost varies significantly.
| Factor | FIFO | Weighted Average | Specific ID |
|---|---|---|---|
| Best for | Most e-commerce sellers | High-volume commodity sellers | Unique/handmade items |
| QuickBooks support | Native (default) | Not native — requires manual tracking | Manual or specialized software |
| Complexity | Low | Medium | High |
| Tax impact (rising costs) | Lower COGS, higher taxable income | Middle ground | Depends on units sold |
| IRS compliance | Always accepted | Accepted if applied consistently | Accepted if properly documented |
Critical: Once you choose a method, you must apply it consistently. The IRS requires sellers to file Form 3115 (Application for Change in Accounting Method) to switch between FIFO, weighted average, or any other valuation method. This is not a casual decision — consult your CPA before choosing, and do not switch without formal approval.
Inventory on your balance sheet must be valued at the lower of cost or net realizable value (NRV). This is called the Lower of Cost or Market (LCM) rule, and it requires you to write down inventory when its value has declined below what you paid for it.
Net Realizable Value (NRV) = Expected selling price minus expected costs to sell (fees, shipping, advertising).
If NRV is below your recorded cost, write down the inventory to NRV.
Example: You have 500 units of a product with a landed cost of $12.00/unit ($6,000 total). The product now sells for $14.99, but after Amazon fees (32%) and advertising ($2/unit), your net realization is $8.19/unit.
Journal entry:
| Account | Debit | Credit |
|---|---|---|
| Inventory Write-Down Expense (5600) | $1,905 | |
| Inventory Asset | $1,905 |
The write-down reduces your inventory asset on the balance sheet and increases your COGS/expenses on the P&L. This hurts current-period profitability but gives you accurate inventory valuation going forward.
Assess inventory for write-down at least quarterly. Many e-commerce sellers do a monthly review of:
Inventory accounting requires knowing how many units you have and what they cost. There are two systems for tracking quantity:
A perpetual system updates inventory in real time as purchases are received and sales are made. Every transaction adjusts the inventory count and value.
How it works for e-commerce:
QuickBooks Online uses a perpetual system natively. When integrated with A2X or a Shopify connection, sales automatically reduce inventory and post to COGS. This is the standard approach for e-commerce sellers.
Limitation: The perpetual system is only accurate if every transaction is recorded. Unrecorded adjustments — units lost at Amazon, shrinkage in your warehouse, miscounted returns — cause the system count to drift from physical reality.
A periodic count involves physically counting inventory at regular intervals (monthly, quarterly, or annually) and adjusting the books to match the physical count.
The formula:
Beginning Inventory + Purchases – Ending Inventory = COGS
Example: You start the year with $50,000 in inventory, purchase $200,000 in new inventory during the year, and count $62,000 in ending inventory.
COGS = $50,000 + $200,000 – $62,000 = $188,000
When to use: Periodic counting is required as a check on the perpetual system, even if you use perpetual tracking. Annual physical counts are standard. Quarterly cycle counts (counting a portion of inventory each quarter) are better for catching discrepancies early.
You cannot physically count inventory at Amazon FBA warehouses. Instead, you rely on Amazon’s Inventory Adjustments and Inventory Event Detail reports to reconcile. Pull these reports monthly and compare to your accounting system:
For sellers with both FBA and warehouse inventory, the reconciliation is:
FBA inventory (Amazon’s report) + Warehouse inventory (physical count) + In-transit inventory (PO receipts not yet received) = Total inventory (should match QuickBooks)
Your December 31 ending inventory value directly impacts your taxable income. Here is the year-end checklist:
Conduct a physical count of warehouse inventory on or as close to December 31 as possible. Pull Amazon’s FBA Inventory Report for December 31. Document both.
Apply your chosen method (FIFO, weighted average, or specific ID) to the ending inventory quantities.
For FIFO: assign the most recent purchase costs to ending inventory units.
For weighted average: use the blended average cost per unit as of December 31.
Compare the calculated cost to net realizable value for any slow-moving, damaged, or declining-value inventory. Write down any inventory where NRV is below cost.
Maintain documentation for:
Your ending inventory value determines your COGS and therefore your taxable income:
Higher ending inventory → Lower COGS → Higher taxable income
Lower ending inventory → Higher COGS → Lower taxable income
This is why accurate inventory valuation matters for taxes. Overstating ending inventory (by failing to write down slow-moving stock or by understating landed cost) means you pay more taxes than necessary. Understating ending inventory (by including costs that do not belong in COGS) triggers audit risk.
Pro Tip: Complete your year-end inventory count and valuation by January 15. Your CPA needs the ending inventory number to prepare your tax return, and January is when 1099-K forms arrive from Amazon, Shopify, and Etsy. Having your inventory valuation ready allows your CPA to reconcile COGS, revenue, and the 1099-K in a single pass instead of going back and forth.
QuickBooks Online (Plus or Advanced tier) has native inventory tracking that works well for e-commerce sellers when configured correctly.
When you receive a purchase order:
This capitalizes all landed cost components into the inventory value, ensuring COGS reflects the true all-in cost when units are sold.
When A2X posts a settlement journal entry, it debits COGS and credits Inventory Asset for the cost of units sold during that settlement period. This keeps the perpetual inventory system in sync with actual sales.
Critical configuration: Ensure A2X uses the correct cost basis. If A2X defaults to supplier cost instead of landed cost, your COGS will be understated. Verify by comparing a week of A2X COGS entries to your expected COGS (units sold x landed cost per unit).
Inventory accounting and COGS calculation are the most technically demanding areas of e-commerce bookkeeping. The signs you need a specialized bookkeeper:
Need accurate inventory accounting? We set up and manage COGS tracking, landed cost allocation, and inventory reconciliation for Amazon, Shopify, and multi-channel sellers. Get an instant quote or visit our bookkeeping services page to learn more.
Get a free quote and see how Steph's Books can save you 40-60% vs hiring in-house.