The Ultimate Guide to Inventory & COGS Management for Ecommerce

July 31, 2023

Learn how to manage your inventory, calculate your landed cost per unit, track inventory KPIs and metrics, and simplify your COGS stress

The Ultimate Guide to Inventory & COGS Management for Ecommerce

You know that stress headache that comes whenever you review your monthly COGS? That uneasy feeling of not trusting the numbers in your books? 

After working with hundreds of DTC brands, we can confirm that this is indeed an affliction felt by all founders - large and small. This guide is here to help you finally understand everything you need to know about COGS, inventory, and accounting for ecommerce … as well as how to get a better handle on your numbers, whether you sell on Shopify, Amazon, wholesale, or any one of the many other online sales platforms and marketplaces.

We’ll cover the basics, the complexities, how to make sure your numbers are accurate and reliable, and best practices to cure the COGS-induced stress headache once and for all. 

Stressed-out ecommerce founders: we see you and we’re here to help.

In this guide, we'll cover:

  • The basics of inventory management,
  • Accounting rules for inventory & COGS,
  • How to calculate and track your numbers,
  • The best tools for managing inventory,
  • Tried and tested tips and tricks for inventory management, and
  • Top inventory KPIs that we see successful ecommerce brands track on a consistent basis.

Once you understand these points, you’ll be able to create a process that actually works to better manage your demand planning and order management, and reduce your inventory costs.

Inventory Management: Back to the Basics

What should be included in inventory?

Let’s say you are the founder and operator of a DTC jam brand.

Your inventory includes raw materials like strawberries, sugar, and mason jars for packaging and it would also include the finished products - i.e., the delicious, ready-to-ship jars of your homemade jam.

Inventory items

Inventory includes any products, supplies, or materials a business stores for purposes of resale or production, including (but not limited to):

  • Raw materials
  • Packaging materials
  • Work-in-progress
  • Finished goods
  • Inventory in transit, also known as “pipeline” inventory

Why accurately managing inventory is so important for ecommerce

To understand how important inventory management is, let’s paint a picture of a world with no inventory management in place (cue scary music).

You sell your strawberry jam on Shopify. Without understanding how much jam you have and how much you expect to sell, you won’t know how much to make, how many strawberries to order, or when to order them.

  • Order too much and just waste money on stock you need to trash.
  • Order too little and miss out on potential sales revenue, also known as stockouts.

In a word, chaos. And this is just the beginning.

As you scale, inventory complexity only increases

Let’s say you expand your product offering and start selling blueberry and apricot jam too, add on multiple size options, or a bundle of all your favorite jam flavors. Now you also decide to branch out to Amazon or start selling wholesale.

Now the jam really hits the fan.

Properly managing your inventory process only gets more crucial and complicated as you scale.

As an ecommerce seller, you need to know how much inventory you have, when to reorder, and how much to reorder. Because out-of-stock items can hurt your bottom line, customer retention, and your overall brand but a very low inventory turnover can destroy your cash flow and result in unnecessary expenses - like storage costs and spoilage.

We discussed the problem, and now let’s dive into the solution.

Understanding Inventory Management

There are two sides to inventory management that you need to understand in order to get it set up correctly:

  1. Operational - Accurate inventory management is crucial for managing the commercial side of your business so you can efficiently prepare and send purchase orders (POs), track how many units to reorder, when to order, and manage your cost per unit.
  1. Financial - You also need to understand the accounting side of inventory costs to help you correctly assign a cost per unit for your inventory, make sure your financial reports are accurate, and have the data you need to understand your financial health, make better decisions, and file accurate tax returns.

A correct cost per unit helps you calculate your inventory value, COGS, and profit margin. Without these numbers correctly accounted for, your whole pricing model and projections may be skewed (or SKU’d if you prefer accounting puns).

If you can’t trust your COGS and inventory numbers, your balance sheet and P&L would be as helpful as a treasure map drawn by your dog.

  • How you plan to forecast demand
  • When and how you’ll order new stock
  • Where you’ll warehouse your inventory
  • What data you’ll need to make decisions about your inventory
  • How you’ll track inventory across multiple channels
  • How you’ll record inventory on your financials
  • How you’ll use software to automate processes
  • How you’ll track different categories of inventory (e.g., finished goods, raw materials, etc.)

Accounting for Inventory & COGS: Everything You Need to Know

In this guide, we’ll focus mostly on the financial and accounting side of things with some general tips & tricks thrown in that could help you on the operational side as well.

When you see the word accounting, ya’ll know things are about to get wild.

First, let’s debunk a commonly misunderstood fact about accounting for inventory. 

There’s a lot of focus on cash versus accrual accounting when it comes to ecommerce. Many are quite vocal that ecommerce brands should only be using accrual since they need to track their COGS and inventory. 

Here’s the thing: while we are big fans of accrual to get a better understanding of the true health of your business, based on actual tax law, whether you are a cash-basis taxpayer or an accrual-basis taxpayer, your inventory and COGS should generally be tracked the same way. Mic-drop.

Yup, it’s true. Let us explain.

Accrual versus cash basis: A quick refresher

Accrual vs cash basis accounting

For example, if you order 500 units from a vendor and are required to pay 50% today and 50% in 3 months from now, accrual means recording 100% of the cost in inventory. Even though 50% is not yet paid.

So does this mean that if you are cash-basis ecommerce brand, you record all your inventory costs as COGS right when you pay them even if you didn’t actually sell the inventory?

Nope, at least not usually. This is where many brands (and a scary percentage of accountants) get it wrong.

Here is what the IRS says about tracking your inventory

If you earn income by selling inventory, COGS must be deducted on your tax return based on accrual basis rules. With certain exceptions, this rule applies whether you file taxes on a cash basis or an accrual basis.

In other words, even if you file your tax return on a cash basis, your COGS deduction would generally be calculated based on when you sell the inventory, not when you purchase it.

In recent years, tax laws were changed to allow for exceptions for certain inventory-based businesses. One of these exceptions allows you to deduct COGS based on purchases (pure cash basis) if you meet certain conditions, including:

  1. You made a special tax election to report inventory on a cash basis.
  2. You don't actively track or record the value of your inventory. If you only know inventory count but not value, you can still record COGS on a cash basis.

Since most ecommerce brands tend to track the value of their inventory, at least on an annual basis, most would be required to report their COGS and inventory on the tax return on an accrual basis.

How to calculate your numbers

1) The inputs - what costs are included in your calculations?

Your COGS should include your landed cost per unit, or the real cost of getting your inventory to your warehouse and not just the product cost. In other words, this should be the cost you add to Shopify as the cost per unit for each of the SKUs on your site.

Here is how you should calculate your landed cost per unit:

  • Cost of the products
  • Freight / Shipping-in costs to ship the products to your warehouse
  • Insurance
  • Taxes and tariff
  • Handling fee
  • Other fees

When tracking landed costs, your product costs should include all above costs relating to:

  • Raw materials, packaging, and labeling supplies (since these items are usually purchased in bulk but used at the rate of actual sales), and finished goods.
  • Manufacturing / assembly costs (e.g., direct labor, contract manufacturers, manufacturing overhead) if you manufacture your own products.

You should also include unpaid bills relating to inventory, since you need to track inventory on an accrual basis for tax purposes. These are the costs that are included in the value of your inventory on your balance sheet and impact your COGS on the P&L.

As a general rule, when calculating inventory value, include costs for products and supplies that your business owns that are both:

  • Physically on hand (e.g., in a warehouse)
  • Purchased but not yet received (i.e., prepaid inventory or inventory in transit)

For purposes of simplicity, let's refer to all the above expenses as “Inventory Costs”.

2) The inventory calculation formula

Now that we understand the Inventory Costs that you should take into account in valuing your inventory, let’s do a quick run-through of the key inventory terms for calculating your ending inventory balance.

  • Beginning inventory - Inventory Costs relating to unsold inventory at the start of the month
  • Purchases - Inventory Costs relating to new inventory purchased during the month that you already legally own.
  • Manufacturing costs - Inventory Costs related to manufacturing of the products, e.g., contract manufacturers, direct labor or other manufacturing costs.
  • Cost of goods sold (COGS)- Inventory Costs relating to units sold during the month. This is often calculated as a cost per unit amount and can be calculated based on FIFO, LIFO, or average cost methods. The cost per unit should not include shipping costs to customers, customs warehouse fees, payments fees or marketing costs.
  • Ending inventory - Inventory Costs relating to the unsold inventory at the end of the month.
  • Dead inventory- The estimated cost of loss or breakage of inventory, e.g., broken or spoiled inventory, loss of purchases in shipment, etc
  • Product giveaways - Inventory Costs for stock you gave away for marketing (e.g., to influencers).

Here’s how to calculate your inventory:

How to calculate inventory

At first glance, this formula can seem overwhelming so let's break it down step by step:

  1. Start with beginning inventory
  2. Add Inventory Costs for purchases made during the month and manufacturing costs for services received during the month.
  3. Subtract COGS (i.e., Inventory Costs related to products sold during the month on your website or through wholesale channels).
  4. Subtract product giveaways and dead inventory. This is a part of the inventory equation that is often missed. For ecommerce businesses, this can really add up and should be taken into account when tracking your inventory.


Like magic, you have your ending inventory. 

Easy as pie, amiright?

3) How to calculate your cost per unit

To calculate the cost per unit of your products or SKUs, include all costs necessary to get the unit ready for sale, including all purchase costs mentioned below, allocated per unit:

1) Net purchase price of the unit usually includes

  • Direct purchases of ready-for-sale items (also known as finished goods or finished products)
  • Raw materials, if relevant

2) Estimated indirect vendor costs, usually include -

  • Shipping/ freight costs to ship the stock to your warehouse
  • Other indirect vendor costs (such as sales tax, customs, and vendor fees)

3) Purchase price of packaging and labeling supplies per unit (since these items are usually purchased in bulk but used at the rate of actual sales)

4) Estimated manufacturing / assembly costs (less relevant if you’re a reseller and don’t manufacture your own products), usually include

  • Direct and indirect labor
  • Contract manufacturer
  • Manufacturing overhead

Estimated cost per unit should NOT include:

  • Shipping costs to customers (e.g. USPS, UPS)
  • Warehouse fees
  • Payments processing fees
  • Marketing costs
How to calculate per unit

Let's take a quick example - You are assembling 100 units of Product A and incur $2,000 in raw materials, $500 in packaging costs, and $500 in freight costs. The cost per unit of Product A would be $30 (total costs of raw materials, packaging costs, and freight divided by the quantity).

4) How to calculate your COGS

COGs are calculated based on a cost per unit determined using one of the following accounting methods:

FIFO- first-in, first-out method

This assumes that the first unit purchased is the first unit sold.

LIFO - last-in, first-out method

This assumes the last unit purchased is the first one sold.

Average cost method

This takes the weighted average cost of all units available for sale to determine the cost per unit.

Let’s see it in action:

You pack 200 jars of jam that cost you $1 each on Sunday and another 200 jars that cost you $1.50 on Wednesday. On Thursday, you sell 100 jars of jam.

How to calculate FIFO, LIFO, and average cost

As a general rule, the average cost and FIFO methods tend to be more commonly used by ecommerce businesses to calculate your COGS.

How often to track your inventory

Here are the different schools of thought when it comes to tracking inventory:

1) Perpetual System - Brands use software to track items as sales occur, usually through Shopify and occasionally with the addition of inventory management software. It’s the best way to monitor goods if you’re a rapidly growing eCommerce business or manage a wide variety of products.

2) Periodic System - Businesses physically count inventory at the beginning and end of a period. This may occur monthly, quarterly or annually.

Tools for managing your inventory

Here are the top 4 most common ways brands deal with managing their inventory:

  1. Track the data manually in an Excel or Google Sheet
  2. Use a real-time bookkeeping system that syncs your sales directly to your books
  3. Use an inventory management system (IMS) to help you automate your inventory tracking process
  4. Use denial to avoid dealing with the problem altogether (not recommended, although an alarmingly popular choice).

1) Excel or Google Sheet Inventory Tracking

Tracking your inventory in an Excel or Google Sheet is simple and cost-effective and is a good option for brand-new businesses with very few SKUs as a way to begin managing your inventory units as well as your COGS and purchase costs. 

The downside is that you or your employees will have to manually update any changes. This results in a lot of manual work and a ton of room for human error.

If you decide to go down this path, create an inventory tracking template with formulas to help you optimize this process as much as possible. Here are some of the key recommended items that should be included in the template:

  • Product number / SKU number
  • Product name and description
  • Product cost per unit
  • Quantity in stock
  • Quantity sold
  • Total inventory value
  • Reorder reminder
  • COGS
  • Other inventory adjustments, such as dead inventory or giveaways

Even with the best formulas in place, using Excel can lead to errors. It’s best practice to have a system in place to self-audit and update your numbers consistently.

To get a free inventory tracking template from Finaloop, just send us an email at and we’ll be happy to share one used by some of our customers.

As your business grows, it’s important to reassess how you are tracking your inventory to determine if it's time to take your inventory management to the next level. You know you are ready for a next-level tool if you find yourself with the following issues:

  • You spend a lot of time maintaining and tracking your inventory
  • You regularly run out of stock or have too much inventory spoilage
  • You find it difficult to track your stock across multiple sales channels

2) Integrated real-time tracking with your bookkeeping solution

This may be a shameless plug to inform you of the benefits of using a real-time ecommerce-focused bookkeeping solution like Finaloop, but the fact is, it’s an amazing and brand new option to better manage and track your inventory and COGS and to integrate the data directly with your financials. 

Finaloop automatically categorizes your inventory purchases using AI and machine learning and syncs your COGS directly from Shopify and Amazon in real-time so your financials are updated 24/7 and you have full visibility into the financial health of your business 24/7. 

Hundreds of large brands use Finaloop and it’s a game-changer to deal with the major stress ball that is COGS and inventory management. 

3) Inventory Management Systems (IMS)

IMS is software that can help you manage various aspects of your inventory and supply chain by integrating across online stores, marketplaces, and warehouses to sync inventory updates in real-time.

For example, if you have 30 jars of strawberry jam in stock and you sell 2 jars on Amazon, your inventory count should reduce to 28 jars on both Shopify and Amazon. The IMS can alert you when it's time to reorder more jars based on forecasted sales. Some systems even automate the purchase order to your vendor. 

There are lots of IMS out there each with its features, pros, and cons. The key is finding the one that checks off all the boxes on your wish list while also meeting your budget constraints (some can be quite pricey)!

Here are our suggestions of key features to consider when choosing an IMS:

  • Tracks all orders and order fulfillment details
  • Sends alert when it's time to purchase new stock
  • Accurately tracks the number of items you have at any given time
  • Integrates with your warehouse, POS systems, website ecommerce tools, and other key apps
  • Forecasts sales
  • Allows customization of real-time reports

Inventory Tips and Tricks 

Here are a few methods you can use to streamline your inventory management, no matter where you are in your growth process:

Utilize technology

It’s 2023. You no longer need to use the same methods used by gram and gramps. Technology can significantly help reduce your headache, if used correctly. From barcoding and RFID tagging to automated reordering systems, various technology solutions are available to help streamline your process.

Cycle Counts

Cycle counting every so often helps ensure that your physical inventory matches what you have recorded in the system, keeping everything in check. It’s good to check this at least semi-annually.

Analyze supplier performance for better inventory management

An unreliable supplier can cause problems for your inventory. If you have a supplier that’s habitually late with deliveries, frequently shorts an order or is the source of supply chain delays, it’s time to take action.

Consider supplier diversity

Accessing vendors from various places or with diverse routes and ports – can build supply chain resilience and present options when a supplier is unreliable.

Practice the 80/20 inventory rule for better inventory management

As a general rule, 80 percent of your profits come from 20 percent of your stock. Prioritize managing this 20 percent of your inventory.

Track sales for effective inventory management

You should understand, on a daily basis, what items you sold and how many you sold, and update your inventory totals.

Analyze your sales data

Do you know when specific items sell faster or drop off? Do specific items sell according to seasons? Is there a specific day of the week when you sell certain items? Do some items almost always sell together?

Understand profitability per SKU

You don’t want to cross-finance your loss-making products with your profitable ones. If a product isn’t profitable, it’s time to amputate that limb before it poisons the other organs.

Order restocks yourself for better inventory management

Some vendors offer to reorder inventory for you. On the surface, this seems like a plus. Your time – and your team’s time – is freed while someone else manages the restocking process.

Create strict order management processes

Make sure any employees or founders involved in the order management process adheres to the guidelines so you know when to order, how much to order, and from which supplier to order.

Choose your 3PL wisely

It’s best to choose an option that integrates directly with Shopify and your other sales channels to streamline order management.

Top Ecommerce Inventory KPIs

Inventory Sales KPIs

1) Inventory Turnover

Inventory turnover is the number of times inventory items have been sold and replaced in a given period. You also may have heard it referred to as inventory turnover ratio or inventory turn.

You should use inventory turnover to determine if your business has too much inventory compared to how much of your stock you're selling.  A slow rate of inventory turnover may indicate potential issues in sales or marketing, suggesting that your products are not gaining sufficient traction and you have an excessive amount of unsold stock remaining.

Inventory turnover rate = cost of goods sold / average inventory

2) Stock to Sales Ratio

Stock to sales ratio is the ratio of stock available to sell for stock that has already been sold.

If this ratio is too high, it means you are paying extra in carrying costs (rent, utilities, salaries) and other costs related to things like depreciation, perishability, shrinkage, and insurance. If the ratio is too low, it means that you will run out of stock and you will lose both sales and customers.

Stock to Sales Ratio = Units Available/Units Sold

3) Sell-through Rate (STR)

The sell-through rate is the comparison between the amount of inventory sold and the amount received from the manufacturer or supplier. It is usually measured monthly.

This helps gauge the accuracy of demand forecasting, measure supply chain efficiency, mitigate storage costs and which product quantities need to be increased or decreased based on sales data.

A high rate is an indication that a business sells most of its inventory received in a period.

You should therefore aim for STR of 80% and higher.

STR = (# Units Sold/# Units Received) x100

4) Backorder Rate

Backorder rate is the percentage of customer orders a company can’t fulfill from current inventory.

This KPI can be a good or bad thing, depending on the scenario. If you have a high backorder rate it means you have a high demand, while a low backorder rate can also mean excellent demand planning. On the flip side, if you have a high backorder rate, it can also mean that you have poor demand planning, while a low backorder rate can suggest very low demand.

In either case, this metric is a great market research tool, as you can use backorders to test the demand for new products.

Backorder rate = (# Orders Delayed due to Backorder/Total # of Orders) X100

5) Days Sales in Inventory (DSI)

Days Sale in Inventory (DSI) is the rate of inventory turns per day. It is also known as the average days to sell inventory (DSI) or average age of inventory.

DSI is used to show the efficiency of sales and how long the company’s cash is tied up in its inventory. Typically, a lower DSI is desirable as it signifies a shorter time needed to sell off the inventory. If you have a high DSI, it may suggest inadequate inventory management or that you have inventory that is challenging to sell.

As high-price items tend to sell slower than low-price items, you may want to calculate separate DSI for each product category.

Days Sales in Inventory = Days in Accounting Period/Inventory Turnover Rate

Inventory Operations KPIs

6) Lead Time

Lead time is the amount of time it takes for a customer to receive a product once they’ve made an order.

This KPI measures the efficiency of the entire supply chain process and inventory management performance. You should aim to have a short of a lead time as possible, as the higher the lead time, the more likely it is that your customers will get frustrated and simply move to one of your competitors at a click of a button.

Lead time = order process time + production lead time + delivery lead time

7) Carrying Costs

Carrying costs are all expenses relating to storing and maintaining unsold products. Also known as holding costs. Costs include warehouse costs, insurance, taxes, administrative costs, and physical handling.

There are many factors that can lead to high carrying costs and therefore we suggest carrying out a careful top-to-bottom analysis of all inputs, in order to lower your carrying costs.

As a rule of thumb, carrying costs tend to be around 20-30% of your total inventory value.

Inventory carrying costs = [(inventory service costs + inventory risk costs + capital cost + storage cost) / total inventory value] x 100

8) Dead Inventory /Spoilage

Dead inventory is inventory that no one wants to buy, e.g. seasonal items like swimwear unsold at the end of the summer season, as consumers don’t want to follow last year’s trend.

This metric indicates the company’s viability. Companies with more than 25-30% of dead stock are not competitive. Use proactive inventory management strategies such as SKU rationalizing to lessen the overall inventory carrying costs of your dead stock.

Dead/spoiled stock = (amount of unsellable stock in period / amount of available stock in period) x 100

9) Rate of returns

Rate of returns is the percentage of items that are returned by the customer.

Analyze this metric to track any increases or potential patterns and identify why something is being returned. If you have high return rates, then there might be something not right with your choice of inventory. Even a minor discrepancy, such as a misrepresented color in a product image or an inaccurate sizing guide, can contribute to a significant increase in the return rate.

Rate of returns = [(# of Items Returned)/(Total # of Items Shipped)] x100


Armed with this ultimate guide, you can now finally understand everything you need to know about COGS and inventory and how to get a better handle on your ecommerce numbers.

Finaloop uses AI accounting and AI bookkeeping as well as a team of ecommerce finance experts, bookkeepers, and accountants to give you easy access to accurate real-time financials and to make sure your inventory is properly recorded in your financials.

Sign up HERE to get your financials set up today.

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

That’s what we’re here for.
Accurate ecommerce books, done for you.

100% accurate ecommerce books, available 24/7.

Finally, you can focus on everything else.

Get started
14-Day Free Trial
No Credit Card Required