How to Update Product Cost Prices in Shopify Using a CSV File
Adding or updating the Cost per item value on many Shopify products at once, from a CSV file of cost prices.
Shopify stores each variant's cost price in the Cost per item field. There is no import for cost prices on their own, so the method is to export your products, copy your cost prices into the export by matching on SKU, and import it back with overwrite turned on. This article walks through the five steps and the most common problems.
On this page- Before You Start
- Step 1: Export Your Products
- Step 2: Remove the Columns You Don't Need
- Step 3: Add Your Cost Prices
- Step 4: Check and Save the File
- Step 5: Test, Then Import
- Troubleshooting
Before You Start
You need three things before starting:
- A CSV file of cost prices with at least two columns: the variant SKU and its cost price.
- Shopify admin access with permission to export and import products.
- A spreadsheet program. We recommend Google Sheets, but Excel and Numbers work too.
Shopify recognises existing products by their handle — the product's name as it appears in its web address — not by SKU. That is why you cannot import your cost file on its own. Instead, you export your products from Shopify, copy the cost prices into that export by matching on SKU, and import the export back.
NOTE: Cost per item is stored on each variant, not on the product. A product with five sizes has five cost prices, one per row in the export. Variants with no SKU in Shopify cannot be matched to your cost file and must be updated by hand.
If you only need to update a handful of products, Shopify's bulk editor is quicker: select the products on the Products page, click Bulk edit, add the Cost per item column and type the costs in directly.
Step 1: Export Your Products
In your Shopify admin, go to Products and click Export. Choose All products, select CSV as the format, and click Export products. Shopify emails you the file, or downloads it straight away for smaller catalogues.
Open the file in your spreadsheet program. Each row is one variant, and the Cost per item column holds its current cost price.
CAUTION: Save an untouched copy of this export before you edit anything. If an import goes wrong, it is your record of how your products looked beforehand.
Step 2: Remove the Columns You Don't Need
Delete every column except the ones below. Shopify only updates the columns that are in the file you import, so anything you delete stays exactly as it is in your store. Removing the image columns matters most — importing them again can duplicate product images.
| Column | Why you keep it |
|---|---|
Handle |
Tells Shopify which product the row belongs to. Do not edit it. |
Title |
The product name. It is only filled in on the first row of each product — leave it as it is. |
Option1 Name, Option1 Value (and Option2, Option3) |
Tell Shopify which variant the row belongs to. Do not edit them. A product with no variants shows Title and Default Title here. |
Variant SKU |
Used to look up each variant's cost in your cost file. |
Cost per item |
The cost price. This is the only column you change. |
Once the image columns are gone, any rows that only held extra images are left with nothing but a handle. Delete every row where Option1 Value is empty.
Step 3: Add Your Cost Prices
Add a new tab to the spreadsheet and name it Costs. Paste your cost file into it, with SKUs in column A and cost prices in column B.
Back on the products tab, the steps below assume Variant SKU is in column E and Cost per item is in column F. Adjust the letters if your columns sit elsewhere.
- In cell K2, enter this formula:
=IFERROR(VLOOKUP(E2, Costs!A:B, 2, FALSE), F2)
- Fill the formula down to the last row. Each row now shows the cost from your file, or the current cost where the SKU was not found.
- Copy column K and paste it over column J using Paste values only (Paste special in Excel).
- Delete column K.
NOTE: The formula falls back to the current cost rather than leaving the cell empty. This matters: an empty cell in Cost per item wipes the cost price on import.
To see which variants did not find a match, use this version of the formula in column K before step 3, then filter for NO MATCH:
=IFERROR(VLOOKUP(E2, Costs!A:B, 2, FALSE), "NO MATCH")
Step 4: Check and Save the File
Before saving, check the Cost per item column:
- Plain numbers only — no currency symbols and no thousands separators.
- A full stop as the decimal separator, for example
12.50. - Prices in your store's default currency.
Save the products tab as a CSV file. In Google Sheets, use File > Download > Comma-separated values; only the tab you are viewing is downloaded, so the Costs tab is left out. In Excel, use Save As and choose CSV UTF-8.
NOTE: If your computer uses a comma as the decimal separator — common with Danish, Norwegian, Swedish and German settings — Excel may save costs as 12,50 or separate columns with semicolons. Open the saved file in a plain text editor and check that values read 12.50 and columns are separated by commas.
Step 5: Test, Then Import
Make a copy of the file containing only a few products, including at least one with several variants. Import that first using the steps below, then open those products in Shopify and check their cost prices before importing the full file.
- Go to Products and click Import.
- Upload your CSV file.
- Tick Overwrite products with matching handles.
- Click Upload and preview, check the preview, then click Import products.
Shopify emails you when the import has finished. Open a few products and check the Cost per item field on their variants (within the Price section).
CAUTION: Without the overwrite box ticked, Shopify skips every product that already exists. The import still reports as successful, but nothing changes.
Troubleshooting
| Symptom | Check |
|---|---|
| Import finished but no cost prices changed | The Overwrite products with matching handles box was not ticked. Import the file again with it ticked. |
| Duplicate products appeared | A handle in the file was edited or does not match an existing product, so Shopify created a new one. Delete the duplicates and import again using handles exactly as exported. |
| Some variants kept their old cost | Their SKU was not found in your cost file. Use the NO MATCH formula to find them. Look for extra spaces, leading zeros removed by the spreadsheet, or SKUs that differ between Shopify and your cost file. |
| Cost prices were wiped | The Cost per item cells were empty in the imported file. Fill them in and import again, or re-import the cost column from your backup copy. |
| Cost prices look wrong, e.g. 1250 instead of 12.50 | The file used a decimal comma or thousands separators. Check the file in a plain text editor and fix the number format. |
| Import is rejected as an invalid file | The file was not saved as a comma-separated CSV, or is over Shopify's 15 MB limit. Save it as CSV UTF-8, and split large catalogues into several files. |
| A cost landed on the wrong variant | The option name or value columns were edited or removed. Re-export, keep those columns untouched, and repeat the steps. |