COGS Tracking for Online Sellers
Everything you need to know about tracking Cost of Goods Sold for your ecommerce business — from inventory valuation methods to QuickBooks account setup.
What is Cost of Goods Sold (COGS)?
Cost of Goods Sold (COGS) represents the direct costs attributable to producing or acquiring the goods that a business sells during a specific period. For ecommerce sellers, COGS is the total cost of the products you sold — not the products you bought, but specifically the ones that left your inventory.
The COGS Formula
COGS = Beginning Inventory + Purchases - Ending Inventory
Example: You start the month with $10,000 in inventory, buy $5,000 more, and end with $8,000 in inventory. Your COGS = $10,000 + $5,000 - $8,000 = $7,000.
Included in COGS
- +Product purchase price (wholesale cost)
- +Inbound shipping and freight
- +Customs duties and import taxes
- +Packaging materials (boxes, labels, tape)
- +Direct manufacturing labor (if applicable)
- +FBA fulfillment fees (if treated as direct cost)
NOT Included in COGS
- -Marketing and advertising costs
- -Website hosting and software subscriptions
- -Office supplies and rent
- -Salaries (unless directly involved in production)
- -Payment processing fees (Stripe, PayPal)
- -Outbound shipping to customers (usually)
Why COGS Matters for Profitability
Accurate COGS tracking is the foundation of profitability analysis. Without it, you cannot calculate gross margin — the single most important metric for an ecommerce business.
Gross Profit
Gross Profit = Revenue - COGS
If you sell $50,000 worth of products and your COGS is $20,000, your gross profit is $30,000.
Gross Margin %
Gross Margin = (Gross Profit / Revenue) x 100
Using the example above: ($30,000 / $50,000) x 100 = 60% gross margin. A healthy ecommerce gross margin is typically 40-60%.
Pricing Decisions
If your COGS per unit is $12 and you sell for $25, your gross margin is 52%. If a competitor forces you to drop to $20, your margin drops to 40%. Without accurate COGS, you might price below cost without knowing it.
SKU Profitability Analysis
Not all products are equally profitable. COGS tracking per SKU reveals which products earn the most margin and which are dragging down your overall profitability.
Tax Liability
COGS is deductible on your tax return. Understating COGS means you pay more tax than necessary. Overstating it risks an IRS audit. Accurate tracking protects you both ways.
Investor and Lender Requirements
Banks and investors evaluate gross margin as a key health metric. Inaccurate COGS makes your business look either worse or better than it actually is — both are problems.
FIFO vs LIFO vs Weighted Average
The inventory valuation method you choose determines how COGS is calculated when purchase prices change over time. Each method produces different COGS, gross margin, and tax outcomes.
First In, First Out
Oldest inventory units are sold first. COGS reflects older (usually lower) purchase prices.
Advantages
- +Matches physical flow of most goods
- +Produces more accurate balance sheet (ending inventory at recent costs)
- +Required under IFRS; accepted by IRS
- +Best for perishable or seasonal goods
Disadvantages
- -Higher taxable income in inflationary periods (lower COGS)
- -Requires tracking purchase lots by date
Example
You buy 100 units at $5, then 100 at $7. You sell 80. COGS = 80 x $5 = $400. Remaining inventory = 20 x $5 + 100 x $7 = $800.
Last In, First Out
Newest inventory units are sold first. COGS reflects recent (usually higher) purchase prices.
Advantages
- +Lower taxable income in inflationary periods (higher COGS)
- +Better matching of current costs to current revenue
Disadvantages
- -Not allowed under IFRS (only US GAAP)
- -Balance sheet shows outdated inventory values
- -Rarely used in ecommerce
- -Can create distorted profitability metrics
Example
Same purchase: 100 at $5, then 100 at $7. You sell 80. COGS = 80 x $7 = $560. Remaining inventory = 100 x $5 + 20 x $7 = $640.
Weighted Average Cost
Average cost is recalculated after each purchase. COGS reflects the blended average cost.
Advantages
- +Simplest to calculate and maintain
- +Smooths out price fluctuations
- +Accepted by both IFRS and US GAAP
- +Good for homogeneous products
Disadvantages
- -Less accurate for products with varying purchase costs
- -May not reflect true economic cost of specific sales
Example
Same purchase: 100 at $5, then 100 at $7. Average cost = (500 + 700) / 200 = $6. You sell 80. COGS = 80 x $6 = $480. Remaining = 120 x $6 = $720.
Recommendation for ecommerce sellers: Use FIFO unless your accountant specifically advises otherwise. It matches the physical flow of goods, is accepted by both US GAAP and IFRS, and is the default method in QuickBooks Online.
Tracking Inventory Costs
Accurate COGS starts with accurate cost tracking at the inventory level. Here are the key practices for maintaining clean cost data.
Per-SKU Cost Tracking
Maintain a cost field for every SKU in your inventory system. Update it when purchase prices change. This is the atomic unit of COGS calculation — without per-SKU costs, you are guessing.
Purchase Order Tracking
Record every purchase order with: supplier, date, quantity, unit cost, and freight charges. Link each PO to a specific inventory receipt so you can trace costs back to their source.
Cost Updates on Receipt
When a new shipment arrives at a different price, update the per-unit cost immediately. For FIFO, keep both cost lots separate. For weighted average, recalculate the blended cost.
Regular Physical Counts
Count physical inventory at least quarterly. Compare to book inventory. Adjust for shrinkage (lost, damaged, stolen units). Record adjustments as an expense, not a reduction in COGS.
Shipping: COGS or Operating Expense?
Shipping is one of the most commonly misclassified costs in ecommerce accounting. The answer depends on which direction the shipping goes.
Inbound Shipping = COGS
Shipping from your supplier to your warehouse (or to Amazon FBA) is a direct cost of acquiring inventory. It should be included in your per-unit product cost.
- - Freight from manufacturer to warehouse
- - Shipping to Amazon FBA fulfillment centers
- - Container shipping for imported goods
- - Courier/parcel fees for supplier shipments
Calculation: If 500 units cost $5,000 to ship, add $10/unit to your product cost basis.
Outbound Shipping = Operating Expense
Shipping from your warehouse to the customer is typically classified as a Selling Expense or Shipping Expense, separate from COGS.
- - USPS/UPS/FedEx customer delivery costs
- - Packaging materials for outbound orders
- - Shipping labels and postage
- - Free shipping costs you absorb
Exception: Some sellers include outbound shipping in COGS. This is acceptable as long as it is consistent and disclosed.
FBA Fee Allocation
Amazon FBA (Fulfillment by Amazon) fees are one of the largest costs for Amazon sellers. How you classify them affects your gross margin calculation and tax reporting.
Amazon FBA Fee Types
| Fee Type | Description | COGS or OpEx? |
|---|---|---|
| FBA Fulfillment Fee | Per-unit pick, pack, and ship fee | Either (most use COGS) |
| Referral Fee | Commission on sale (8-15%) | Operating Expense (Sales Commission) |
| Monthly Storage Fee | Per-cubic-foot warehouse storage | Operating Expense (Warehousing) |
| Long-Term Storage Fee | Surcharge for inventory over 365 days | Operating Expense (Warehousing) |
| Removal/Disposal Fee | Fee to remove or destroy inventory | Operating Expense (Inventory Write-off) |
| Inbound Shipping to FBA | Your cost to ship inventory to FBA | COGS (Freight In) |
Approach 1: FBA Fees as COGS
Treat FBA fulfillment fees as a direct cost of sale, similar to how a brick-and-mortar store treats shelf stocking costs.
Best for: FBA-heavy sellers who want accurate per-unit margins.
Approach 2: FBA Fees as OpEx
Classify all FBA fees as a separate "Fulfillment Expenses" line item under operating expenses, keeping COGS limited to product cost.
Best for: Multi-channel sellers who want to compare product costs across platforms.
PrimeConnect's Amazon-to-QB converter automatically splits FBA settlement reports into separate fee categories, so you can classify each one correctly in QuickBooks.
Landed Cost Calculation
If you import products from overseas manufacturers, the purchase price on the invoice is only part of the story. The "landed cost" includes every expense required to get the product from the factory to your warehouse.
Landed Cost Components
Example: Phone Case Import
Unit price (FOB China): . . . . . . . . $2.00
Ocean freight (1,000 units): . . . . . . $0.80/unit
Customs duty (3.4% rate): . . . . . . . $0.07/unit
Broker fee ($250 / 1,000): . . . . . . . $0.25/unit
Domestic trucking: . . . . . . . . . . . $0.15/unit
Insurance (0.5%): . . . . . . . . . . . $0.01/unit
Landed cost per unit: . . . . . . . . . $3.28/unit
The landed cost ($3.28) is 64% higher than the invoice price ($2.00). Using only the invoice price would understate COGS by $1.28 per unit sold.
Setting Up COGS in QuickBooks
Proper account structure in QuickBooks is essential for accurate COGS tracking. Here is the recommended setup for ecommerce businesses.
QuickBooks Online Setup
- 1
Enable inventory tracking
Go to Settings > Account and Settings > Advanced > Inventory. Toggle "Track inventory quantity on hand" to ON. This creates the default Inventory Asset and COGS accounts.
- 2
Create COGS sub-accounts
Go to Chart of Accounts > New. Create sub-accounts under "Cost of Goods Sold" for: Product Cost, Freight In, Packaging Materials, and FBA Fulfillment Fees (if applicable).
- 3
Set up inventory items
Go to Products and Services > New. Select "Inventory" type. Enter the SKU, cost per unit, and sales price. Link to the appropriate COGS sub-account and income account.
- 4
Record purchases
When you receive inventory, create a Bill or Expense. QuickBooks automatically debits the Inventory Asset account and credits Accounts Payable (or Cash).
- 5
Record sales
When you record an invoice or sales receipt, QuickBooks automatically debits COGS and credits Inventory Asset based on the per-unit cost. This is the COGS recognition event.
Recommended COGS Account Structure
5000 - Cost of Goods Sold (Parent account)
5010 - Product Cost (wholesale purchase price)
5020 - Freight In (inbound shipping & duties)
5030 - Packaging Materials
5040 - FBA Fulfillment Fees
5050 - Inventory Adjustments (shrinkage, damage)
1400 - Inventory Asset (Other Current Asset)
1410 - FBA Inventory
1420 - Warehouse Inventory
1430 - In-Transit Inventory
Skip the manual setup. PrimeConnect's Chart of Accounts Generator creates an ecommerce-optimized account structure with all COGS sub-accounts pre-configured. Export as CSV, IIF, or directly import into QuickBooks.
Common COGS Mistakes to Avoid
These are the eight most common mistakes ecommerce sellers make when tracking Cost of Goods Sold. Each one can lead to inaccurate financials, incorrect tax filings, or poor business decisions.
Not including inbound shipping in product cost
Classifying FBA fees as an operating expense when they should be COGS
Using revenue-based COGS estimates instead of actual costs
Forgetting to adjust COGS for returns and damaged goods
Mixing inventory and non-inventory items in the same COGS account
Not reconciling physical inventory counts to book inventory
Switching inventory methods mid-year without IRS approval
Ignoring multi-channel inventory synchronization
Frequently Asked Questions
What counts as COGS for an ecommerce business?
Should I use FIFO, LIFO, or weighted average?
Is shipping cost part of COGS or an operating expense?
How do I handle Amazon FBA fees in COGS?
What is landed cost and why does it matter?
How do I set up COGS tracking in QuickBooks?
Set Up Your COGS Accounts in Minutes
PrimeConnect's Chart of Accounts Generator creates an ecommerce-optimized account structure with COGS sub-accounts, inventory tracking, and fee categories pre-configured. Export directly to QuickBooks.
Generate Chart of Accounts