COGS (Cost of Goods Sold) for Ecommerce

Ecommerce COGS, or Cost of Goods Sold, is a core component of ecommerce accounting and inventory purchase accounting. It represents the direct costs associated with producing and delivering the products you sell online. This includes raw materials, manufacturing, shipping fees, landed cost calculation, packaging, and any other expense tied directly to getting a product from your supplier to your customer.

If you're wondering how to figure out the cost of goods sold, it's typically calculated using the following formula:

Beginning Inventory + Inventory Purchases – Ending Inventory = COGS

This formula helps calculate the cost of goods sold over a specific period, giving you a clear picture of your true product costs. For ecommerce businesses, tracking COGS is essential because it directly affects gross profit margins, pricing strategy, and long-term scalability.

To properly record this, you need to understand the journal entry for cost of goods sold (COGS). When inventory is sold, the correct COGS entry is:

Debit: Cost of Goods Sold
Credit: Inventory

This reflects the movement of inventory out of your books and the recognition of the related expense on your income statement.

Likewise, when you purchase inventory, the correct journal entry for buying inventory (under accrual accounting) is typically:

Debit: Inventory
Credit: Accounts Payable or Cash

These journal entries are crucial for maintaining accurate financials and aligning your inventory purchase accounting with tax requirements.

In ecommerce, especially if you’re using multiple suppliers, overseas manufacturers, or 3PLs, it's important to account for landed cost calculation. Landed costs include not just the unit price of the product but also freight-in, import duties, taxes, and any costs required to bring the inventory to its final destination. Including these in your COGS ensures your pricing and gross margin calculations are accurate.

Monitoring your ecommerce COGS helps you:

  • Optimize pricing to protect your profit margins
  • Negotiate with suppliers or manufacturers more effectively
  • Improve cash flow by understanding how inventory affects your bottom line
  • Make better purchasing decisions and avoid overstocking or stockouts

Understanding and properly recording COGS entries isn't just good accounting—it's essential for running a profitable, scalable ecommerce business. Whether you’re preparing financial statements, filing taxes, or reporting to investors, your ability to accurately calculate the cost of goods sold and record the correct COGS journal entries will have a significant impact on your financial clarity.

Read our in-depth article about ecommerce COGS.

Ecommerce COGS Formula

COGS=Beginning Inventory+Purchases During the Period−Ending Inventory

Cost of goods sold is calculated by adding your beginning inventory and purchases and subracting your ending inventory.

In this article

Excited to do your bookkeeping? Didn't think so.

Free Consultation

Offload your books to us and get 100% real-time financials. Now you can focus on everything else.

Free Consultation
14 days free
No credit card required
14 days free | No credit card required