COGS & Accounting

How to Calculate COGS on Shopify (Step by Step)

How to calculate cost of goods sold on Shopify, step by step: what goes into each unit's cost, where Cost per item lives, which Shopify reports add it up, and a worked month with example numbers.

GrowStack team13 November 202610 min read
how to calculate cogscogscost per itemlanded costshopify reportsshopify

The short answer

Cost of goods sold (COGS) is what the stock you sold cost you. On Shopify there are two ways to work it out, and it's worth doing both.

  • Per order. Multiply the units sold by each item's cost, then add it up. Shopify's profit reports do this for you, using the Cost per item on each product.
  • Per period. Beginning inventory + purchases − ending inventory. This is the formula your accountant uses, and the one on the IRS Schedule C.

The per-order figure tells you which products make money. The period formula catches what the per-order figure misses: broken stock, missing costs, and units that left without a sale. When the two figures disagree, find out why.

For the background on what COGS is and why it matters, start with Understanding COGS. This post covers the steps.

The example store

A small home fragrance store sells two products:

  • a soy candle at $24.00
  • a reed diffuser at $32.00

We'll work out its COGS for October 2026. On 30 September it had 40 candles and 15 diffusers in stock, and one shipment arrived in October.

To keep the arithmetic readable, the September stock cost the same per unit as the October shipment. If your costs change from one shipment to the next, you also need a costing method. Our FIFO vs weighted average post covers that.

Step 1: Decide what goes into a unit's cost

COGS is the cost of getting stock onto your shelf, ready to sell. It isn't the cost of running the business.

Include:

  • the price you paid the supplier, after any trade discount
  • inbound freight, from the supplier to you
  • import duty and customs fees (not import VAT or GST you can reclaim)
  • packaging that is part of the product, such as a gift box it's always sold in

Leave out:

  • payment processing and Shopify fees
  • ads, apps and staff
  • rent and other overheads

Shipping to customers is a cost of making the sale, but many stores keep it out of COGS and track it as its own line. Ask your accountant which way they want it.

Shopify's Help Center suggests resellers enter the price they paid the manufacturer, "excluding taxes, shipping, or other costs". That's quicker, but it leaves inbound freight out of your COGS. The IRS counts freight-in on stock you buy for resale as part of cost of goods sold (IRS Publication 334). IAS 2, the international standard, also counts the costs of bringing stock to where it's sold. If you want Shopify's numbers to match your books, enter the landed cost.

Step 2: Work out the landed cost per unit

Landed cost is the supplier price plus each unit's share of freight, duty and fees.

On 6 October 2026 the store receives this shipment:

LineUnitsUnit priceLine total
Soy candle200$6.25$1,250.00
Reed diffuser100$9.50$950.00
Products$2,200.00
Freight in$176.00
Duty and customs fees$88.00
Landed total$2,464.00

Freight, duty and fees come to $264.00, which is 12% of the $2,200.00 product value. Split it across the lines in proportion to their value:

LineLine totalShare of $264.00Landed totalUnitsLanded unit cost
Soy candle$1,250.00$150.00$1,400.00200$7.00
Reed diffuser$950.00$114.00$1,064.00100$10.64
Total$2,200.00$264.00$2,464.00

Check: the two landed totals ($1,400.00 + $1,064.00) add up to $2,464.00, the landed total of the whole shipment. If your split doesn't add back to that figure, a cost has been missed or counted twice.

Splitting by value is the usual choice, and it's how Stocky did it. For heavy or bulky items, splitting by weight or volume can be fairer. Pick one rule and stick to it.

If the store used the bare supplier prices instead, the candle would be costed at $6.25 and the diffuser at $9.50. Both would be about 11% below what they really cost.

Step 3: Enter it in Cost per item

Shopify holds one cost for each variant, in the Cost per item field (Shopify Help Center: cost per item).

  1. In your Shopify admin, go to Products and open the product.
  2. In the Price section, click Cost per item.
  3. Enter the landed cost ($7.00 for the candle) and save.
  4. If the product has variants, give each variant its own cost.

To update many products at once, use the bulk editor, or edit the Cost per item column in a product CSV and import it.

How Shopify uses this number:

  • It's saved on each order when the order is created. Changing the cost later doesn't change past orders. So update it on the day new stock arrives, not at month end.
  • Sales with no cost are left out. Profit reports only include variants that had a cost when they sold. A blank cost doesn't count as zero. The sale drops out of the COGS total altogether.
  • It's one number. It doesn't average your shipments or keep a log of earlier costs. Save a dated product export before you change it. Our Stocky post shows how.

Step 4: Add up COGS for the month in Shopify

This is the per-order method. In your Shopify admin, go to Analytics > Reports, filter the category to Profit Margin, and open Gross profit by product for 1 to 31 October 2026. For each product that had a cost when it sold, the report shows net quantity, net sales, cost, gross profit and gross margin (Shopify Help Center: profit reports).

Every October order shipped before the end of the month, with no discounts or refunds. Here are the report's figures, with each product's cost per item added so you can follow the maths:

ProductNet quantityNet salesCost per itemCost
Soy candle130$3,120.00$7.00$910.00
Reed diffuser45$1,440.00$10.64$478.80
Total175$4,560.00$1,388.80

Per-order COGS for October is $1,388.80.

Next, open the Finance Summary report and find the Gross profit breakdown card. Check Net sales without cost recorded. It should be $0.00. If it isn't, some sales are missing from your COGS total, and the figure is too low.

Step 5: Check it with the inventory formula

This is the per-period method:

COGS = beginning inventory + purchases − ending inventory

Value both inventory figures at cost, not at selling price.

Beginning inventory. Shopify's Month-end inventory value report, in the Inventory category, multiplies each variant's on-hand quantity at month end (available, for months before October 2026) by its cost per item (Shopify Help Center: inventory reports). For 30 September 2026 it shows 40 candles × $7.00 = $280.00 and 15 diffusers × $10.64 = $159.60, so $439.60.

Purchases. Use the landed totals for stock received in the month, not the purchase orders you placed. For October that's $2,464.00.

Ending inventory. At the end of October the store counts its stock. Shopify expects 110 candles (40 + 200 − 130), but the shelf holds 108, because two broke when a box was dropped. The store throws them away and sets the candle's on-hand quantity to 108. The diffusers count 70 (15 + 100 − 45), as expected. The October report then shows 108 × $7.00 = $756.00 and 70 × $10.64 = $744.80, so $1,500.80.

Amount
Beginning inventory, 30 September 2026$439.60
Plus purchases in October$2,464.00
Goods available for sale$2,903.60
Minus ending inventory, 31 October 2026$1,500.80
COGS$1,402.80

The formula gives $1,402.80. The per-order figure was $1,388.80. The $14.00 gap is the two broken candles at $7.00 each. They left the shelf without being sold, so no order ever carried their cost.

Three things to know about the inventory report:

  • From 1 October 2026, Shopify's inventory reports count On hand stock. That includes units committed to unfulfilled orders and units set aside as unavailable. Months before that count Available stock. So a 30 September 2026 figure and a 31 October 2026 figure aren't counted the same way. If you had unfulfilled orders or set-aside stock on 30 September, adjust the opening figure.
  • Stock you mark as damaged but don't remove still counts as on hand, so it's still in the value. Take thrown-away stock out of the count.
  • Export the report on the first working day of each month and keep the file. That fixes your opening figure for next month.

Step 6: Work out gross profit and margin

Gross profit = net sales − COGS. Gross margin = gross profit ÷ net sales.

Per order (Shopify reports)Per period (formula)
Net sales$4,560.00$4,560.00
COGS$1,388.80$1,402.80
Gross profit$3,171.20$3,157.20
Gross margin69.5%69.2%

The per-period figure is the one for your books, because it includes the breakage. Most small stores count breakage and shrinkage as part of COGS, but ask your accountant how they want it shown.

The per-order figure is the one for product decisions. Here, the candle made a 70.8% gross margin and the diffuser 66.8%.

Now compare what the store would have seen with bare supplier prices in Cost per item. Shopify would report COGS of $1,240.00 and a 72.8% margin. That is $148.80 of real cost missing from one month's reports, all of it freight and duty.

Why the two numbers differ

When the per-order figure and the formula don't match, it's usually one of these:

  1. Sales with no cost recorded. Shopify leaves them out of the per-order COGS. Check Net sales without cost recorded.
  2. Stock that left without a sale. Breakage, theft, samples, giveaways and write-offs.
  3. Orders not shipped by month end. The sale is in the profit report, but the units still count as on hand in the inventory report.
  4. A cost that changed during the month. Each order keeps the cost it was created with. The inventory report uses the cost per item.
  5. Purchases entered at the wrong amount. For example, a purchase order total used instead of the landed total with freight and duty.

If the gap is small and you can name the cause, you're done. If you can't explain it, find the cause before the figure goes into your accounts.

A monthly routine

  • On delivery day: work out the landed unit cost, save a dated product export, then update Cost per item.
  • On the first working day of the month: export the Month-end inventory value report for the month just ended.
  • The same day: run Gross profit by product for the month, and check that Net sales without cost recorded is $0.00.
  • Then: run the formula and explain any gap.
  • Finally: send both figures to whoever does your books.

Where CostSync fits

We are building CostSync, a Shopify app that tracks your product costs over time and works out COGS and margin for you, so this routine doesn't depend on a spreadsheet. It is coming soon. You can see the plans on the pricing page.

Related articles