Skip to main content
Skip to content
Back to Accounting Guides8 min read

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.

3 Valuation MethodsQuickBooks SetupUpdated Feb 2026

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.

FIFO

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.

LIFO

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

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 TypeDescriptionCOGS or OpEx?
FBA Fulfillment FeePer-unit pick, pack, and ship feeEither (most use COGS)
Referral FeeCommission on sale (8-15%)Operating Expense (Sales Commission)
Monthly Storage FeePer-cubic-foot warehouse storageOperating Expense (Warehousing)
Long-Term Storage FeeSurcharge for inventory over 365 daysOperating Expense (Warehousing)
Removal/Disposal FeeFee to remove or destroy inventoryOperating Expense (Inventory Write-off)
Inbound Shipping to FBAYour cost to ship inventory to FBACOGS (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

Unit Purchase PriceInvoice price from the manufacturerBase cost
International FreightOcean, air, or rail shipping from factory to port5-15% of unit cost
Customs DutiesImport tariffs based on HTS code and country of origin0-25% of unit cost
Customs Broker FeesFee for customs clearance paperwork$150-500 per shipment
Domestic FreightTrucking from port to your warehouse or FBA2-5% of unit cost
InsuranceCargo insurance for international transit0.5-1% of shipment value
Inspection FeesPre-shipment quality inspection$200-500 per inspection
Currency ConversionFX spread if paying in foreign currency1-3% of payment

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. 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. 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. 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. 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. 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.

#1

Not including inbound shipping in product cost

Impact: COGS is understated by 5-15%, inflating gross margin and overstating profitability.
Fix: Add freight, customs, and duties to your per-unit cost before recording inventory. This is the "landed cost" approach.
#2

Classifying FBA fees as an operating expense when they should be COGS

Impact: Gross margin appears artificially high, making it harder to evaluate true product profitability.
Fix: For FBA sellers, include per-unit fulfillment fees in COGS. Record monthly FBA fee statements as a COGS expense.
#3

Using revenue-based COGS estimates instead of actual costs

Impact: Estimated percentages drift from reality as supplier prices change, leading to inaccurate financials.
Fix: Track actual purchase costs per SKU. Update costs when new purchase orders arrive at different prices.
#4

Forgetting to adjust COGS for returns and damaged goods

Impact: Returned inventory is still counted as sold, overstating COGS and understating inventory.
Fix: When a return is received and restocked, reverse the COGS entry. For damaged goods, write off to a "Shrinkage" expense.
#5

Mixing inventory and non-inventory items in the same COGS account

Impact: Cannot distinguish between product costs and other cost-of-sales items (like direct labor).
Fix: Create separate COGS sub-accounts: "Product Cost," "Freight In," "Packaging," "Fulfillment Fees." Use PrimeConnect's Chart of Accounts Generator for a pre-built structure.
#6

Not reconciling physical inventory counts to book inventory

Impact: Shrinkage, theft, and miscounts accumulate silently, distorting COGS and inventory asset values.
Fix: Perform quarterly physical counts (monthly for high-volume SKUs). Adjust book inventory to match, recording the difference as shrinkage.
#7

Switching inventory methods mid-year without IRS approval

Impact: The IRS requires Form 3115 to change accounting methods. Switching without filing can trigger an audit.
Fix: Choose your inventory method at business formation and stick with it. If you must change, file Form 3115 (Application for Change in Accounting Method).
#8

Ignoring multi-channel inventory synchronization

Impact: Selling the same SKU on Amazon, Shopify, and eBay without syncing leads to overselling and incorrect COGS.
Fix: Use inventory management software to sync stock levels across channels. Record COGS per-channel for accurate platform profitability analysis.

Frequently Asked Questions

What counts as COGS for an ecommerce business?
COGS for ecommerce includes the purchase price of products (wholesale cost), inbound shipping/freight, customs duties and import taxes, packaging materials used for shipping, and FBA or 3PL fulfillment fees if classified as a direct cost. It does NOT include marketing, website hosting, office supplies, or software subscriptions — those are operating expenses.
Should I use FIFO, LIFO, or weighted average?
FIFO (First In, First Out) is the most common and generally recommended for ecommerce sellers. It assumes older inventory is sold first, which matches the physical reality of most businesses. LIFO is not allowed under IFRS and is rare in ecommerce. Weighted Average is simpler but less accurate for businesses with fluctuating purchase costs. The IRS requires consistency — once you choose a method, you must stick with it unless you file for a change.
Is shipping cost part of COGS or an operating expense?
It depends on the type of shipping. Inbound shipping (freight from your supplier to your warehouse or Amazon FBA) is part of COGS — it is a direct cost of acquiring inventory. Outbound shipping (shipping the product to the customer) is an operating expense unless you include it in your product cost basis. The IRS accepts either treatment for outbound shipping as long as you are consistent.
How do I handle Amazon FBA fees in COGS?
There are two acceptable approaches. (1) Include FBA fulfillment fees in COGS — this treats Amazon as your fulfillment center, making the fee a direct cost of sale. (2) Classify FBA fees as a separate operating expense under "Fulfillment Expenses." Approach 1 gives you a more accurate gross margin. Approach 2 is simpler and separates product cost from platform cost. Most accountants recommend Approach 1 for FBA-heavy sellers.
What is landed cost and why does it matter?
Landed cost is the total cost to get a product from the manufacturer to your warehouse, including: unit price, international shipping/freight, customs duties, import taxes, insurance, inspection fees, and broker fees. Landed cost matters because your true product cost (and therefore your gross margin) is understated if you only use the unit purchase price. For imported goods, landed cost can be 20-40% higher than the invoice price.
How do I set up COGS tracking in QuickBooks?
In QuickBooks Online: (1) Enable inventory tracking under Settings > Advanced. (2) Create an "Inventory Asset" account (Other Current Asset type). (3) Create a "Cost of Goods Sold" expense account. (4) When creating products, set the cost per unit — QuickBooks auto-calculates COGS when you record a sale. In QuickBooks Desktop: use the Inventory Part item type and set up COGS accounts in the Chart of Accounts. PrimeConnect's Chart of Accounts Generator creates an ecommerce-optimized account structure automatically.

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