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

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.
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.
- 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:
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:
| Event | Units on hand | Cost per item |
|---|---|---|
| Start | 40 | $6.00 |
| Receive 60 at $6.50 | 100 | (40 × 6.00 + 60 × 6.50) ÷ 100 = $6.30 |
| Sell 70 | 30 | $6.30 (sales don't change it) |
| Receive 50 at $7.00 | 80 | (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:
| Line | Spread by value | Spread 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.
- Wrong counts. The average weights the old cost by the units on hand. If Shopify says 100 and the shelf holds 40, the old cost gets far too much weight. Count before you trust the number; our Shopify inventory audit guide shows how.
- Other currencies. Convert a supplier's price into your store's currency at the rate you paid before you average it. Mixing euros and dollars in one formula gives a number that means nothing.
- Units sent back to the supplier. Stocky left the average unchanged when a negative received quantity pushed stock below zero. Outside that case, taking units out at the current average leaves the average where it was.
- Free units. Units a supplier adds for free count at $0 and pull the average down. That's right if they're free, and wrong if the supplier billed them on another invoice.
- A wrong starting cost. An average carries its starting point forward. If the cost per item was wrong before the first delivery, fix it by hand first, or every average after it inherits the error.
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 file | Where it comes from | Margin at $18 |
|---|---|---|
| $6.30 | Old cost, never updated | 65.0% |
| $6.74 | Weighted average | 62.6% |
| $7.00 | Last price paid | 61.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:
| Method | What cost per item shows | Fits when |
|---|---|---|
| Last price paid | The newest supplier price | Prices rarely change and stock turns over fast. |
| Weighted average | A blend of old and new stock | Prices move and you want steady, comparable margins. |
| FIFO (first in, first out) | The cost of the oldest units still on hand | You track each batch, usually in accounting software. |
| Standard cost | A planned cost you review on a schedule | Prices 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
- 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.
- Work out the landed unit cost for each line, with freight, duties and discounts spread by value or by units.
- Run the formula, with the rule for zero stock and missing costs.
- Save the result as cost per item on the product page, or in the Cost per item column of a product CSV.
- 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 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".
- The average counts the stock you already have, across every location, at its current cost, and the new units at the purchase order's cost.
- The order's shipping, other charges and discount go into that cost through the Landed costs box on the purchase order, spread by cost value or by quantity.
- If stock is at zero or below, or the product has no cost in Shopify yet, it uses the purchase order's cost, the same rule Stocky used.
- If the supplier is set to a different currency from your store, EZstock writes the PO price as it is, without averaging, and says so on the receive screen.
- The purchase order page lists the cost changes each receipt made, and costs are rounded to the cent.
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
Sources
- Shopify Help Center, "Average unit cost" (Stocky), retrieved October 20, 2026, help.shopify.com/en/manual/products/inventory/stocky/reporting/average-unit-cost
- Shopify Help Center, "Profit reports," retrieved October 20, 2026, help.shopify.com/manual/reports-and-analytics/shopify-reports/report-types/profit-reports
- 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
- 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
- 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
- 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
- IFRS Foundation, "IAS 2 Inventories," retrieved October 20, 2026, ifrs.org/issued-standards/list-of-standards/ias-2-inventories
- Moore Global, "IAS 2 Inventories," retrieved October 20, 2026, moore-global.com/services/ifrs/ias-2-inventories
- 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