Weighted Average Cost in Shopify: How to Keep Cost per Item Right When Supplier Prices Change

Weighted average cost in Shopify: 30 units on hand at $10 plus 15 received at $8 gives a cost per item of $9.33

Shopify stores one cost per item for each variant. When a supplier raises the price, the new stock costs more, but the stock already on your shelf doesn't, so neither price is the cost of the units you're about to sell. Weighted average cost settles that by blending what's on hand with what just arrived. Stocky used to work it out for you. Stocky closed on August 31, 2026, and Shopify's cost per item doesn't average by itself. This guide shows the formula, works through examples with made-up numbers, and covers freight, duties and the cases that throw the number off.

In one line

Weighted average cost is the total cost of the units you have divided by how many there are. In Shopify, recalculate it on each delivery: (units on hand × current cost + units received × new landed cost) ÷ (units on hand + units received), then save the result as the variant's cost per item. Shopify doesn't do this for you.

Key takeaways
  • Weighted average cost blends old and new stock into one cost per unit. The IFRS standard for inventories, IAS 2, accepts it alongside first-in, first-out.
  • Shopify keeps one cost per item for each variant and doesn't average it when stock arrives. Stocky did, and Stocky closed on August 31, 2026.
  • On each delivery: (on hand × current cost + received × landed unit cost) ÷ (on hand + received), rounded to the cent.
  • Put freight, duties and other charges into the landed unit cost first, spread across the order by value or by units.
  • When stock is at zero or below, or the variant has no cost yet, use the new delivery's cost. Stocky used the same rule for negative stock.

What is weighted average cost?

Weighted average cost is the cost of all the units you have, divided by the number of units. Each delivery gets blended in at its own price, weighted by how many units it adds. The IFRS Foundation's summary of IAS 2, the international standard for inventories, lists "the first-in, first-out or weighted average cost formula for items that are ordinarily interchangeable."

"Ordinarily interchangeable" describes most of what a Shopify store sells. One blue mug in size Large is the same as another, whichever delivery it came from. For items that aren't interchangeable, such as one-off vintage pieces, IAS 2 points to "specific identification of cost" instead: each item keeps its own cost.

There are two ways to run the average. A periodic average is worked out once per month or quarter, across everything bought in that period. A moving average is updated on every delivery. For a Shopify store the moving average is the practical one, because Shopify uses whatever cost per item is on file at the moment of each sale.

A quick example. You have 30 candles that cost $10 each, and you receive 15 more at $8 because the supplier ran a promotion. You now hold 45 candles worth $420 in total, so each one costs $9.33 on average. Neither $10 nor $8 describes the shelf. $9.33 does.

Does Shopify calculate weighted average cost?

No. Shopify keeps one cost per item for each variant, and its profit reports use the cost on file when each sale happens. Shopify's help center says "profit is reported only for products and variants that had cost recorded at the time they were sold," and describes that cost data as "static data, which means that the data in your profit reports is only relevant to a specific point in time."

In a Shopify Community thread that started in April 2025 and was still active in October 2026, a merchant who checked found that "the price seems to just be updated with the last price you paid on a PO." Later replies, several from people who build cost apps, agree that Shopify doesn't calculate a weighted average when inventory is received. None of the replies came from Shopify staff.

Stocky was the exception. Shopify's own help page for Stocky's average unit cost gives the formula, works the example above (30 units at $10 plus 15 at $8 makes $9.33), and adds that "average unit costs are unique to Stocky and don't display in Shopify." The same page carries the notice: "The Stocky app will no longer be available after August 31st, 2026." Stores that relied on Stocky for this lost it when the app closed.

Shopify's June 2026 purchase order update fills new orders with your previous purchase prices or the product's cost per item, and transfers can carry cost adjustments for shipping and duties. Neither one turns cost per item into an average. If you want an average in Shopify, you calculate it and save it, or an app does that on receipt. Our guide on what happens to Stocky data after the shutdown covers what else stopped with Stocky.

The formula, step by step

Run this for each variant on each delivery, before the new units go into stock:

New cost per item = (units on hand × current cost + units received × landed unit cost) ÷ (units on hand + units received)

Units on hand means every unit you hold of that variant, at every location, because Shopify stores a single cost per item for the variant. The landed unit cost is the supplier's price plus that unit's share of freight, duties and other charges, which the next section covers.

A longer example, with made-up numbers, follows one scented candle through two price rises:

EventUnits on handCost per item
Start40$6.00
Receive 60 at $6.50100(40 × 6.00 + 60 × 6.50) ÷ 100 = $6.30
Sell 7030$6.30 (sales don't change it)
Receive 50 at $7.0080(30 × 6.30 + 50 × 7.00) ÷ 80 = $6.74

Selling doesn't move the average; only deliveries do. The average also climbs more slowly than the supplier's price, because old stock still counts. Round each result to the cent, and expect tiny rounding differences from one delivery to the next.

The second delivery shows why the weight matters. Before it arrived, only 30 of the cheaper candles were left, so the new $7.00 units count for 50 of the 80 on the shelf. That pulls the average to $6.74, much closer to $7.00 than to $6.30.

What goes into the cost of a unit?

Everything you pay to get the unit onto your shelf. FedEx's guide for small businesses defines landed cost as "the sum of expenses associated with shipping a product" and sums it up as "product + shipping + customs + risk + overhead = landed cost." In accounting terms, Moore Global's summary of IAS 2 says costs of purchase "comprise the purchase price (less trade discounts, rebates and similar items), import duties and other irrecoverable taxes, and other costs directly attributable to the acquisition."

Supplier invoices usually charge freight and duties for the whole order, so you have to spread them across the lines before averaging. There are two ways to do it, by value and by units. Take one order of mugs and plates with $150 of freight and $50 of duties, $200 in total:

LineSpread by valueSpread by units
100 mugs at $4.00 ($400)40% of $200 = $80, so $4.80 a mug$200 ÷ 150 units = $1.33 each, so $5.33 a mug
50 plates at $12.00 ($600)60% of $200 = $120, so $14.40 a plate$1.33 each, so $13.33 a plate

Both add up to the $1,200 you paid. The difference is who carries the charges. Duties are usually charged on value, so spreading by value matches how they were billed. Freight depends on size and weight, so spreading by units can be fairer when items are similar in size, and less fair when a cheap item is bulky. Pick one rule and use it every time, so your costs stay comparable from order to order.

A supplier discount on the whole order works the same way in reverse: subtract it from the charges before you spread them. Card fees and the shipping you pay to send orders to customers usually stay out of cost per item. They're costs of selling, and cost per item is about buying. Our guide to Shopify cost price tracking and COGS covers which costs go where.

What throws the average off?

The formula assumes the units on hand and the current cost are both right. When either one isn't, the result drifts. Stocky's help page covers the negative stock case directly: when a variant has negative stock, Stocky skips the formula and sets the average to "the Landing Cost of Received Stock" from the new delivery.

The rule makes sense, because the formula gives nonsense below zero. Say a variant shows -5 on hand at $10 after some overselling, and you receive 20 at $8. The formula says (-5 × 10 + 20 × 8) ÷ 15 = $7.33, cheaper than both prices you ever paid. Using the new $8.00 is the sensible answer. The same goes for zero stock and for a variant with no cost saved yet.

How much does the choice change your margin?

Take the candle from the table and sell it at $18. Shopify's profit reports work out margin as "([net sales - cost] / net sales) * 100", so the cost on file decides the margin you see. After the second delivery, the three possible costs give three different answers:

Cost on fileWhere it comes fromMargin at $18
$6.30Old cost, never updated65.0%
$6.74Weighted average62.6%
$7.00Last price paid61.1%

Across the 80 candles on hand, last price reports $20.80 more cost than the average, and the stale cost reports $35.20 less. On one product that's small. Across a few hundred variants and a year of price rises, it can change which products your reports say are worth reordering.

Shopify records the cost at the time of each sale, so the fix has to happen at receipt. Updating cost per item a month later leaves the sales in between at the old cost. For margins inside Shopify's own assistant, Marjn shows true profit margins in Shopify Sidekick. I build Marjn too.

Weighted average, last price or FIFO?

Each method answers a different question, and Shopify's single cost per item can only hold one answer at a time. For a small store, they compare like this:

MethodWhat cost per item showsFits when
Last price paidThe newest supplier pricePrices rarely change and stock turns over fast.
Weighted averageA blend of old and new stockPrices move and you want steady, comparable margins.
FIFO (first in, first out)The cost of the oldest units still on handYou track each batch, usually in accounting software.
Standard costA planned cost you review on a schedulePrices are stable and you review them once or twice a year.

FIFO needs a cost record for every batch, which one cost field per variant can't hold, so stores that use it usually keep it in their accounting system. Weighted average fits Shopify's single field well, and it's the method Stocky used. Last in, first out (LIFO) isn't on the list: IAS 2 doesn't permit it.

For tax returns and financial statements, ask your accountant which method your business uses. The cost per item in Shopify should follow the same method, or your margins and your books will tell different stories.

How do you keep cost per item at the average in Shopify?

Calculate the average for each variant on the delivery, before the units go into stock, and save it as the variant's cost per item. You can do that by hand with a spreadsheet, or with an app that writes it when you receive the purchase order.

By hand

  1. Before receiving, note each variant's units on hand at all locations and its current cost per item. A product export gives you the cost, in the Cost per item column.
  2. Work out the landed unit cost for each line, with freight, duties and discounts spread by value or by units.
  3. Run the formula, with the rule for zero stock and missing costs.
  4. Save the result as cost per item on the product page, or in the Cost per item column of a product CSV.
  5. Receive the delivery once the cost is saved, so sales from the new stock report the new cost.

A spreadsheet row with units on hand in column B, current cost in C, units received in D and landed unit cost in E can do steps 3 and 4 with one formula. It falls back to the new cost when stock is at zero or below, or when no cost is saved:

=IF(OR(B2<=0, C2=""), E2, ROUND((B2*C2 + D2*E2) / (B2 + D2), 2))

If you edit costs through a CSV import, keep the variant's option columns in the file. A product CSV without them can replace your variants with one default variant, which our guide on why a Shopify CSV import deletes variants explains. When a supplier sends a whole new price list, the free Supplier Price Reconciler matches it against your catalog so you can see which costs changed.

With EZstock

I build EZstock, so treat this part as the maker's description. On the Growth plan, receiving a purchase order writes Shopify's cost per item, and a setting chooses which cost. Under "When I receive a PO, set Shopify's cost per item to", you pick "The price on the PO" or "The average of my stock and the new units".

Every install gets 14 days of every feature with no credit card, so you can receive one real delivery with the average on and compare the result against your own spreadsheet. The pricing section lists what each plan includes, and the live demo shows the app with sample data.

If you're coming from Stocky, download its purchase order report before the read-only export ends, around November 29, 2026. EZstock creates your suppliers from it and links each product to the supplier it was last ordered from, with its cost. Our Stocky migration guide covers the steps, and the guide on how to receive inventory in Shopify covers checking each delivery before its cost goes in.

Keep cost per item right on every delivery

EZstock on Growth writes the average of your stock and the new units to Shopify when you receive, with freight and duties included. Try every feature free for 14 days.

Install EZstock freeFree plan available. No credit card for the trial.

Frequently asked questions

Does Shopify use weighted average cost?
No. Shopify stores one cost per item for each variant and uses whatever is on file when each sale happens. It doesn't average old and new stock when you receive a delivery. You calculate the average yourself, or use an app that writes it on receipt.
How do I calculate weighted average cost for a Shopify product?
Multiply the units on hand by the current cost, add the units received times their landed cost, and divide by the total units. For 30 units at $10 plus 15 at $8, that's $420 divided by 45, or $9.33. Save it as the cost per item.
Should shipping be included in cost per item?
Inbound freight and import duties belong in it, because they're part of what a unit costs to reach your shelf. Spread them across the order by value or by units first. Shipping you pay to send orders to customers usually stays out of cost per item.
What happens to the average when stock is negative?
The formula breaks below zero, so use the new delivery's cost instead. Stocky did exactly that: with negative stock on the variant, it set the average to the landed cost of the received stock. Do the same when stock is zero or there's no cost yet.
Does selling stock change the weighted average cost?
No. Sales take units out at the current average, so the average stays the same. Only deliveries at a different price, corrections to the count, and fixes to the cost itself move it.
Is weighted average cost allowed for accounting?
Under IAS 2, the IFRS standard for inventories, interchangeable items use either first-in, first-out or the weighted average cost formula. Local tax rules can differ, so ask your accountant which method your business uses and keep Shopify's cost per item on the same method.
Did Stocky calculate average cost?
Yes. Stocky recalculated an average unit cost each time a purchase order was received, and Shopify's help page notes that the figure was unique to Stocky and didn't display in Shopify. Stocky closed on August 31, 2026, and that calculation closed with it.

Sources

  1. Shopify Help Center, "Average unit cost" (Stocky), retrieved October 20, 2026, help.shopify.com/en/manual/products/inventory/stocky/reporting/average-unit-cost
  2. Shopify Help Center, "Profit reports," retrieved October 20, 2026, help.shopify.com/manual/reports-and-analytics/shopify-reports/report-types/profit-reports
  3. Shopify Help Center, "Using CSV files to import and export products," retrieved October 20, 2026, help.shopify.com/en/manual/products/import-export/using-csv
  4. Shopify Changelog, "Purchase orders now create transfers to move inventory," June 22, 2026, retrieved October 20, 2026, changelog.shopify.com/posts/purchase-orders-now-create-transfers-to-move-inventory
  5. Shopify Help Center, "Receiving inventory from a purchase order," retrieved October 20, 2026, help.shopify.com/en/manual/inventory-and-locations/purchase-orders/creating-inventory-transfers
  6. Shopify Community, "Does shopify track Average Inventory cost / WAC somewhere?," April 2025 to October 2026, retrieved October 20, 2026, community.shopify.com/t/does-shopify-track-average-inventory-cost-wac-somewhere/408827
  7. IFRS Foundation, "IAS 2 Inventories," retrieved October 20, 2026, ifrs.org/issued-standards/list-of-standards/ias-2-inventories
  8. Moore Global, "IAS 2 Inventories," retrieved October 20, 2026, moore-global.com/services/ifrs/ias-2-inventories
  9. FedEx, "How to calculate landed cost for your small business," retrieved October 20, 2026, fedex.com/en-us/small-business/articles-insights/what-is-landed-cost.html