Skip to main content

How Margins calculates your COGS

Margins calculates cost of goods sold by multiplying units sold by your average cost per unit, so your product margins and channel comparisons reflect what each sale really cost you.

Written by Emily Burrows

About

Applies to: Margins.

Using Finaloop Core or InventoryIQ? See How to choose your COGS tracking method in Finaloop.

Margins, Finaloop's performance analytics product, calculates cost of goods sold (COGS) by multiplying the units you sold by your average cost per unit, product by product, channel by channel, for each order or invoice.

Margins syncs your sales and the quantity of units sold automatically from your connected channels. It can sync your cost per unit from Shopify too, and for every other sales channel you add the cost yourself.

Product margins and channel comparisons all sit on top of COGS. Get the cost per unit right and they're right with it. A product with no cost per unit counts as zero cost, which makes that product, and the channel selling it, look far more profitable than it is.

Important: A cost synced from Shopify applies to your Shopify product only. If you sell the same SKU on Amazon or TikTok Shop, each channel sends its own copy, and those copies have no cost until you merge them. See Merging multiple products.


1. Key terms

  • Cost of goods sold (COGS): what the units you sold actually cost you. Not what you paid your vendor this month, what the sold units cost.

  • Cost per unit: the all-in cost of one unit of a SKU. Ideally your landed cost: the product plus freight, duties, and inbound fees. See Calculating your average cost per unit in Margins.

  • Net units depleted: units sold and given away, reduced by units restocked. Returned units don't count on their own; only units you actually put back on the shelf are deducted.

  • Average cost: the blended cost of the units depleted in the period you're looking at. It's COGS divided by net units depleted, so it moves when your cost per unit changes mid-period.


2. How the calculation works

Margins uses an average cost per unit to calculate your COGS for each SKU.

A unit's cost counts when the unit sells, not when you bought it. Buying 10,000 units in March doesn't dent March's margin; selling them over the next six months does.

Margins uses three inputs:

Input

Where it comes from

Units sold

Synced automatically from each connected sales channel

Units restocked

Synced automatically from Shopify, Amazon, and Walmart

Cost per unit

Synced from Shopify where it's available, or entered by you on the Cost per unit tab, in a bulk edit, or by CSV. See Adding your cost per unit in Margins.

Every cost you enter carries a start date and stays in effect until you enter a new one. Margins applies each cost to the units depleted while it was in effect, then adds those pieces together.

For example, a SKU with 8,000 units depleted at $1.00 and 3,000 depleted at $100.00:

  • 8,000 × $1.00 = $8,000

  • 3,000 × $100.00 = $300,000

COGS is $308,000, and the average cost is $308,000 ÷ 11,000 = $28.00.

This is why the Average cost column rarely matches the cost you last typed in. It's a weighted average across the period, not your current cost.

Key takeaway: COGS follows the sale, not the purchase, so a cost you enter today changes your numbers from its start date forward, not retroactively.


3. Where COGS shows up in Margins

  • On each product page, broken out per sales channel on the COGS tab, with Units sold, Units restocked/cancelled, Average cost, and Total.

  • In every margin figure that depends on it, including profit margins per SKU on the SKU analysis tab of your Dashboard and the Channel performance card.

Two events move COGS after the sale:

  • Restocked units reduce net units depleted, which reduces COGS in the month you record the restock.

  • Product giveaways count as depleted units. They leave your inventory and carry their cost with them, even though no revenue came in, and Margins treats them as a marketing expense instead of COGS.


4. What you need to give Margins

Margins uses two inputs to calculate your COGS per SKU:

  1. How many units you sold. This arrives automatically from every connected sales channel, with no manual work needed.

  2. What a unit costs you. Enter it once in Shopify, through a CSV upload or manually, update it when your vendor's price or your freight rate moves, and Margins takes it from there.

If you sell the same SKU on more than one channel, merge those copies before you start entering costs. Only the primary product's cost is used, so a Shopify cost reaches your Amazon or TikTok Shop sales once they're merged into the Shopify product. See Merging multiple products.

You keep the one number that depends on how you actually buy (your landed cost), and you get accurate margins. See Calculating your average cost per unit in Margins.


FAQs

Do I need to enter a cost for every product?

For accurate margins, yes. Any product without a cost per unit contributes zero COGS, so its margin shows as 100%. The banner at the top of Products tells you how many products are still missing one. See Why are my products missing cost per unit in Margins?.


I set my costs in Shopify. Why do my Amazon sales still show no cost?

The cost belongs to your Shopify product, and your Amazon sales come in as a separate product. Merge the Amazon product with the Shopify product as primary and the cost applies to both. See Merging multiple products.


Why does Average cost differ from the cost I entered?

It's a weighted average across the period. If your cost changed mid-period, the average sits between the old cost and the new one.


What happens to COGS when a customer returns something?

Nothing, unless the unit is restocked. A refund and a restock are two separate events. Refunding money doesn't put a unit back in your inventory; only a restock does.


Does the same product from two channels get counted twice?

It gets counted as two products until you merge them, which splits your COGS and SKU analysis across duplicates. See Merging multiple products.


Can I change a cost for a past period?

Yes. Add a cost with an earlier start date and Margins recalculates from that date forward. See Adding your cost per unit in Margins.


Related articles


Need help?

Email us at [email protected] and we'll be happy to help.

Did this answer your question?