Nexus Logic SystemsShopify apps

Inventory costing methods for Shopify: FIFO, moving weighted average and landed cost

Updated · By Senoussi, developer of True COGS at Nexus Logic Systems

Short answer

Shopify tracks quantities but does not cost them: each variant keeps one Cost per item, and Shopify Help says it stays fixed when you receive a purchase order or transfer. Inventory costing on Shopify means adding a layer that records what every delivery cost, including its share of freight and duty, works out the moving weighted average (or FIFO) cost on each receipt, writes it to Cost per item, leaves services out of stock value, and closes each month on cost of goods sold. True COGS is a Shopify app built to be that layer.

What inventory costing is

Inventory costing is how a business puts a cost on the units it holds and on the units it sells. It produces the two figures an accountant asks for: the value of your stock at cost, and your cost of goods sold (COGS).

The common methods are specific identification, first-in first-out (FIFO) and weighted average cost. Under IFRS, interchangeable goods are costed by FIFO or weighted average, and LIFO is not permitted; US GAAP also allows LIFO (KPMG, Deloitte). A store that buys the same product again and again at different prices nearly always uses weighted average or FIFO. FIFO vs weighted average compares the two on the same stock.

A weighted average can be periodic, worked out once at the end of a period, or moving, worked out again on every receipt. A store that sells every day needs the moving average: the cost of today's sale should be the cost of the stock on today's shelf.

What Shopify does on its own

  • Quantities, yes. Shopify counts stock by location and receives purchase orders and transfers.
  • Cost, one fixed number. Shopify's own help says each variant has a static cost that stays fixed when you receive a purchase order or transfer. For weighted-average costing or landed cost allocation, Shopify points stores to a third-party app (Shopify Help).
  • Freight and duty, recorded but not spread. A purchase order's transfer can carry cost adjustments such as shipping and customs duties (Shopify Help), but they do not reach each variant's Cost per item.
  • Reports trust the field. Profit is reported only for products and variants that had cost recorded at the time they were sold (Shopify Help), and the month-end inventory value is the cost per item multiplied by the ending quantity amount for each product variant option (Shopify Help).

So Shopify is a sound inventory system with no costing engine. Whatever sits in Cost per item on the day of a sale is the cost that sale is reported with.

Shopify for stock, a costing layer for cost

The clean design is to keep Shopify as the one inventory system, where quantities are received, counted and sold, and to add a costing layer that reads those movements and owns the cost. The layer never changes a quantity. Shopify never has to calculate a cost.

What each side is responsible for.
JobShopifyCosting layer
Quantities on hand, receiving purchase orders and transfersOwns itReads it, never changes it
Cost per unit on each receiptCost per item stays fixedRecords the price paid and works out the new average or FIFO layer
Freight, duty and feesCost adjustments on a transferSplit into each unit's cost
Cost per itemHolds the number reports useWrites the current average to it
Services and placeholder quantitiesCounted if quantity is trackedLeft out of stock value and COGS
Month-end figuresCost per item × quantity on the dayOpening, purchases, revaluations, COGS and closing, recorded once

Moving weighted average with freight and duty

landed unit cost = price paid + (line's share of freight + line's share of duty) ÷ units received
new average = (units on hand × current average + units received × landed unit cost) ÷ (units on hand + units received)

Worked example

You hold 80 frames at a moving average of $21.40, which is $1,712.00 of stock. A shipment arrives with two lines and two bills: freight of $246.00 and duty of $123.00. Both are split by line value here; see landed cost per unit for splitting freight by weight or units instead.

Freight and duty split by each line's share of the $2,460.00 of goods.
LineUnitsPriceGoodsFreightDutyLanded
Frame120$18.00$2,160.00$216.00$108.00$2,484.00
Case200$1.50$300.00$30.00$15.00$345.00
Shipment320$2,460.00$246.00$123.00$2,829.00

The frame's landed unit cost is $2,484.00 ÷ 120 = $20.70, not the $18.00 on the invoice. Its new moving average is ($1,712.00 + $2,484.00) ÷ 200 = $20.98.

What the wrong cost does to margin

Sell 100 of those frames at $49.00, $4,900.00 of sales. The margin you see depends only on the number in Cost per item:

Gross profit = $4,900.00 − 100 × cost per item.
Cost per item usedCOGSGross profitMargin
Left at the old average, $21.40$2,140.00$2,760.0056.3%
Overwritten with the invoice price, $18.00$1,800.00$3,100.0063.3%
Averaged without freight and duty, $19.36$1,936.00$2,964.0060.5%
Moving average with freight and duty, $20.98$2,098.00$2,802.0057.2%

Typing the invoice price overstates profit by $298.00 on 100 units. Averaging without freight and duty still overstates it by $162.00, and the stock on the shelf is undervalued by the same $1.62 a unit. Neither error shows anywhere in Shopify, because the report trusts the field.

Keep services and placeholder quantities out

Many stores sell things that are not stock: engraving, gift wrap, fitting, warranties, made-to-order options. When such a variant carries a large placeholder quantity so that it never sells out, any report that multiplies quantity by cost counts it as stock. One service held at 9,999 units with a $2.00 cost adds $19,998.00 of stock that does not exist, and every reset of that count moves cost of goods sold.

  • In Shopify: you can stop tracking quantity for a product (Shopify Help) or let a variant keep selling when it is out of stock (Shopify Help). Either removes the need for a placeholder count.
  • When the count has to stay, for example because a channel or a point-of-sale setup relies on it, the costing layer must leave the product out: no stock value, no cost of goods, no line in the month's close. And a month already closed must keep the list it was closed with, even if you change it later.

Bring opening costs over without a receipt

Moving to Shopify from another system, whether Stocky, a separate inventory platform or a spreadsheet, means bringing two things across: quantities and costs. The order matters.

  1. Quantities first, into Shopify. The costing layer reads Shopify's on-hand count; it should not set it.
  2. Opening average costs next. Import each variant's current weighted average as a revaluation of the quantity already on hand: no units move and no purchase is recorded. Your opening stock value is then what your old system said it was.
  3. Then receive. Every delivery from then on blends into that opening average.

An opening import made after receipts have started resets the average, so do it once, before the first delivery. Stores leaving Stocky can also bring in Stocky's purchase orders with their dates as cost history; see replacing Stocky's average unit cost.

Close each month on COGS

cost of goods sold = opening inventory + purchases (landed) + revaluations − closing inventory

Illustrative month. A revaluation changes stock value without a purchase, such as a corrected price.
Example month, at costAmount
Inventory on the 1st$41,200.00
+ Purchases received, landed$12,480.00
+ Revaluations−$310.00
− Inventory on the last day$40,950.00
= Cost of goods sold$12,420.00

A close records these figures once. After that, a cost you learn late, such as a freight bill that arrives in the next month, belongs to the month it was recorded in, as a prior-period adjustment; the closed month does not move. Your accountant should be able to check a closed month again later and get the same figures from the same records. Inventory valuation and COGS at month-end explains why this figure differs from the sum of costs on your sales.

A checklist for any inventory costing tool

Whatever you choose, ask these ten questions of it:

  1. Is the average worked out again on every receipt, or once a day or once a period?
  2. Is the result written to Shopify's Cost per item, so Shopify's own reports use it?
  3. Are freight and duty split into each unit's cost, and can you choose the basis (units, weight, value)?
  4. Is a purchase order received in several batches costed once per batch, never twice?
  5. Can services and placeholder quantities be left out of value and COGS?
  6. Can opening costs be imported without being counted as purchases?
  7. Is every price kept with its date, so you can see which delivery changed a cost?
  8. Can a month be closed, and checked again later against the records?
  9. Can purchase prices be in another currency than your store's?
  10. Does it support FIFO as well as weighted average, if your accountant asks?

How True COGS does inventory costing

True COGS is a Shopify app for inventory costing, built by Nexus Logic Systems. Shopify stays your inventory system; True COGS records the cost.

  • Every receipt is costed. When you receive a Shopify purchase order, each line's price is recorded for the units received and blended into the moving weighted average, which is written to Cost per item. Stock that arrives without a price, such as a transfer, waits in one list until you add it. See adding stock from a supplier invoice and purchase orders and Cost per item.
  • Freight and duty (paid plans): enter a shipment's freight and its duties and fees; freight is split by units, weight or value, duty and fees by value, and each line's cost keeps its parts.
  • Weighted average or FIFO. Moving weighted average on every plan; FIFO on paid plans.
  • Not stock is left out. Tag a product truecogs-exclude in Shopify and it is left out of stock value, COGS and the month's close. The app also asks about products that never ship or that hold 900 units or more, and the tag is added only when you answer.
  • Opening costs (every plan): import a CSV of current costs, matched to each variant by variant ID, SKU, barcode or title. The import changes no quantity and records no purchase.
  • Month-end close (paid plans): opening stock, purchases at landed cost, revaluations, COGS and closing stock, recorded once, with a check you can run again later, a certificate and the ledger file for your accountant.
  • History. Every price is kept with its date in an append-only record. A corrected cost is a new entry; the old one stays.

Plans: free for up to 25 variants with a cost on record; Starter $29, Growth $49 and Scale $79 a month, each with a 14-day free trial. Comparing options? See Shopify apps for cost of goods sold compared.

Questions merchants ask

Does Shopify do inventory costing?

Not on its own. Shopify tracks quantities and keeps one Cost per item for each variant, which stays fixed when you receive a purchase order or transfer. For weighted-average costing or landed cost allocation, Shopify Help points to a third-party app.

How do I calculate a moving weighted average cost with freight and duty?

Landed unit cost = price paid + (the line's share of freight and duty) ÷ units received. New average = (units on hand × current average + units received × landed unit cost) ÷ (units on hand + units received). Example: 80 units at $21.40 plus 120 units landed at $20.70 gives $20.98.

How do I keep services with placeholder quantities out of inventory value and COGS?

Stop tracking quantity for the product in Shopify, or let it keep selling when out of stock, so it needs no placeholder count. If the count has to stay, leave the product out in your costing tool. In True COGS, tag the product truecogs-exclude.

Can I leave products out by SKU, product type or collection?

In True COGS the tag works per product and covers every variant of it. For a product type or a collection, add the tag to those products in bulk in Shopify. A single variant cannot be left out on its own.

Will importing my opening weighted-average costs count as a new receipt?

Not in True COGS. The import revalues the quantity already on hand at the imported cost: no quantity changes and no purchase is recorded. Import once, before the first delivery, because an import after receipts resets the average.

What is the difference between moving and periodic weighted average?

A periodic average is worked out once at the end of a period over everything bought in it. A moving average is worked out again on every receipt, so each sale is costed at the average of the stock on hand that day.

Is weighted average cost accepted by accountants?

Yes. FIFO and weighted average are accepted under both IFRS and US GAAP; LIFO is not permitted under IFRS. Check with your accountant which method your business uses.

Try True COGS free. True COGS is an inventory costing app for Shopify by Nexus Logic Systems. It records the price you paid on every delivery (a received purchase order or a transfer), with its share of freight and duty on paid plans, keeps every price with its date, and writes your moving weighted average cost, or FIFO cost on a paid plan, to Shopify's Cost per item. It is free for up to 25 variants with a cost on record; paid plans start at $29 a month or $290 a year.

Install from the App Store

Sources