Shopify COGS Setup: Step by Step Guide for 2026

Most Shopify stores never set a real cost on a single product. Cost per item stays blank, Shopify Analytics quietly assumes zero, and every margin number the merchant sees is wildly optimistic. This guide walks through the entire Shopify COGS setup process: where Shopify stores unit cost, how to enter it for one product, how to bulk update hundreds of variants, and what your costs should actually include if you want margin reporting that reflects reality.

Where Shopify Stores Unit Cost

Shopify keeps unit cost on the inventory item, not the product or the variant. Every variant has a linked InventoryItem object, and that object holds a single field called unitCost. It is stored as a money value in the shop's primary currency, with one cost per variant regardless of which location stocks the item.

This matters because the cost field lives one layer deeper than most merchants expect. When you edit a variant in the admin, Shopify reaches through to the inventory item to update unitCost. When an app reads cost through the Admin API, it queries InventoryItem.unitCost directly. If you ever script bulk updates, that is the field name you need.

One important limitation: Shopify stores a single cost per variant, not a cost history. Change the value today and yesterday's number is gone forever. Apps that need a true cost trail have to capture the value at order time and persist it themselves. For a deeper look at why that snapshot matters, see how to calculate true profit on Shopify.

Setting Cost on a Single Product

For a one off product or a quick fix, the admin UI is the fastest path:

  1. Open Products in the Shopify admin and select the product.
  2. Scroll to the Variants section and click the variant you want to update. If the product has no variants, scroll to the Pricing section on the main product page.
  3. Find the Inventory block and locate the Cost per item field.
  4. Enter the landed cost in your shop currency. Shopify will auto calculate margin and profit on the same screen so you can sanity check.
  5. Click Save. The value is written to InventoryItem.unitCost and is now visible to apps and reports.

That is it for a single SKU. The problem is doing this for 500 variants. Nobody clicks through 500 variant pages.

Bulk Updating Costs

Three reliable methods, ordered from free to flexible.

1. CSV export and import

From Products, click Export and choose all products as CSV. Open the file in a spreadsheet and fill in the Cost per item column for every variant row. Save as CSV, then use Import and tick Overwrite existing products with same handle. Shopify matches on handle plus variant SKU and updates the cost field in place. Best for one off large updates from a supplier price list.

2. Shopify Bulk Editor

From the Products list, select the variants you want to edit, click Bulk edit, and add the Cost per item column. You get a spreadsheet style editor inside the admin with no CSV round trip. Great for editing 20 to 200 variants quickly, less ideal beyond that because the UI gets slow.

3. Matrixify, ImportYeti, or a custom script

For ongoing supplier feeds or multi thousand SKU catalogues, an app like Matrixify or a small script hitting inventoryItemUpdate over the GraphQL Admin API is the right tool. You can schedule recurring updates, diff against last week's prices, and avoid the manual CSV dance entirely.

What COGS Should Actually Include

This is where most setups go wrong even after the field is populated. Merchants enter the wholesale price they paid the supplier and stop. That is not COGS. Real landed cost for a product unit includes:

For an item with a $4 wholesale cost, $0.80 of freight, $0.40 of duty, and $0.30 of packaging, the real cost per item is $5.50, not $4. Plugging in the lower number understates COGS by 38% and overstates margin by exactly the same amount on every single order. That gap compounds fast when you start running promotions. For more on how that interacts with discounts, see why discount codes quietly destroy your margin.

Per Order vs Per Period COGS

Two costing approaches are common in accounting and they behave very differently on Shopify.

Per order COGS uses whatever unitCost was set at the moment the order was placed. Shopify itself uses this snapshot model: the cost shown on a historical order reflects the value of unitCost when the order was created, not the value today. That is the right model for per order profit reporting and is what serious margin tools rely on.

Per period COGS is what your accountant calculates monthly using FIFO, LIFO, or weighted average cost across the whole inventory. It tells you cost of goods sold for the period as a single aggregate number, useful for tax and financial statements but useless for spotting a single unprofitable order in real time.

You want both. The snapshot model drives operational decisions like flagging bad orders and reviewing margin by SKU. The period model feeds the books. Do not let your accountant's monthly average overwrite your per variant unitCost field, and do not try to do tax accounting off snapshot data. They are different jobs.

When You Don't Have a Real Cost

Sometimes you genuinely cannot enter a real cost. Maybe you sell print on demand and the cost varies per order, or you are dropshipping with supplier prices that change weekly, or you inherited a 4000 SKU catalogue and populating every cell is a six month project.

In those cases the common fallback is a ratio: assume cost equals a fixed percentage of selling price, often 40% to 60%. Profit Guard supports this as a Free tier fallback. It is better than zero, but it is not actually true. A clearance item sold at 80% off still cost what it cost: the ratio model assumes COGS scales down with the sale price, which is exactly the bug that makes deep discounts look profitable when they are not.

Use ratios as a stopgap, not a destination. Prioritise entering real unitCost values for your top 50 SKUs by revenue first, since those drive most of your margin variance. Then work down the long tail as time allows. And once real costs are in, you will start seeing the other line items eating your margin too, the ones that have nothing to do with COGS. We catalogue those in ten hidden costs eating your Shopify margin, and the operational follow up is how to identify unprofitable orders before they ship.

Stop guessing at COGS

Profit Guard reads your real InventoryItem.unitCost on every order, snapshots it at order time, and flags the orders that fall below your margin threshold. Free plan available, Pro is $9 per month.

Install Profit Guard