Exporting and importing inventory with a CSV file
You can export an inventory CSV file to download your current inventory quantities. You can use the exported CSV file to update the inventory amounts, and then import the CSV file to update your inventory quantities for your products in each location in your Shopify admin.
Consider using this inventory management method when you need to update large amounts of inventory in bulk.
The inventory CSV file contains information that uniquely identifies products, product variants, and their inventory quantities at your location or specified locations. You can download and view a sample inventory CSV file to use as a template.
On this page
Exporting inventory
You can export inventory from one location or all locations to create a template for bulk updates or to use the data in other systems. The export includes product identification details and current inventory levels.
You can choose to export your inventory with all inventory states or only with the available quantities:
- All states (recommended): Contains separate rows for each location with columns for all inventory states. This CSV format provides a complete inventory view and protection against accidental overwrites.
- Available: Contains location names as column headers with available quantities listed below. This is a simpler CSV format for basic inventory updates, and includes only your available inventory. This CSV format doesn't provide protection against accidental overwrites.
Review the following examples of how the CSV displays based on the CSV format that you select.
Example of the All states CSV export
| Handle | Title | Location | Bin name | Incoming (not editable) | Unavailable (not editable) | Committed (not editable) | Available (not editable) | On hand (current) | On hand (new) |
|---|---|---|---|---|---|---|---|---|---|
| strbry-jam | Strawberry Jam | Ottawa | A-2-3 | 20 | 3 | 5 | 10 | 18 | |
| strbry-jam | Strawberry Jam | New York | A-7-3 | 0 | 1 | 10 | 50 | 61 | |
| rspbry-jam | Raspberry Jam | Ottawa | A-9-3 | 15 | 0 | 3 | 25 | 28 | |
| rspbry-jam | Raspberry Jam | New York | A-3-5 | 0 | 5 | 6 | 35 | 46 |
Example of the Available CSV export
| Handle | Title | Ottawa | New York |
|---|---|---|---|
| strbry-jam | Strawberry Jam | 10 | 50 |
| rspbry-jam | Raspberry Jam | 25 | 35 |
Export inventory to a CSV file
You can export your inventory based on quantity type for specific locations and products.
Steps:
From your Shopify admin, go to Products > Inventory.
Click Export.
Optional: From the Export from dropdown menu, select a location that you want to export inventory from, or select All locations to export inventory from all of your locations.
In the Inventory states shown section, choose whether you want your CSV to contain all inventory states with protection against accidental overwrites or just the Available state:
- To export only the available inventory quantities, select Available.
- To export all inventory states, select All states.
In the Export section, choose which product variants you want to export inventory for:
- To export variants from the current page, select Current page.
- To export all variants, select All variants.
- To export selected variants, select Selected: variants.
- To export variants that match your search, select variants matching your search.
- In the Export as section, select the file format that you want to export your inventory to.
- Click Export inventory.
Update inventory quantities in a CSV file
After you export the inventory CSV file, you can make bulk inventory changes. The CSV includes product identification columns to ensure that updates are applied to the correct products and variants.
When you update inventory quantities, make sure that you use only whole numbers and not decimals, such as 1.5. You can use positive numbers, negative numbers, or 0. Use not stocked for products never stocked at that location.
Steps:
- Open your exported CSV file in a spreadsheet program.
- Update the quantities based on your export format:
- If you exported the All states CSV file option, then update the
On hand (new)inventory quantities. - If you exported the Available CSV file option, then update the available inventory quantities for each location name.
- If you exported the All states CSV file option, then update the
- Save the file.
Import inventory from a CSV file
Before you import inventory, make sure that you create a CSV file in the correct file format. Your inventory CSV file can't exceed 15 MB.
When your CSV includes both On hand (current) and On hand (new) columns, Shopify uses safety validation to prevent accidental overwrites. Your expected inventory levels are compared with current levels before making changes. If your inventory changes after your export, then the affected rows don't import and you get an email with details about the validation failures. This protects you from accidentally overwriting recent inventory changes.
Steps:
From your Shopify admin, go to Products > Inventory.
Click Import.
Click Add file, and then select your updated CSV file.
Click Upload file.
Review your import summary, and then click Start import.
Optional: If some rows fail validation, then you receive an email with details about the failed rows. Review the information in the email, update your CSV file, and then import your CSV file again.
Inventory CSV file format
The inventory CSV file contains columns to identify products and their variants, and inventory data for each location. Understanding these columns helps ensure that your imports work correctly.
The following columns are required in your inventory CSV file:
- Handle: Unique product identifier.
- Location: Location name to specify where the inventory is located.
- Option1 Value: Required to identify the specific product variant. If the product uses additional options, then Option2 Value and Option3 Value are also required.
Review the following table to learn more about the inventory CSV file format, columns, and their descriptions.
| Column | Description |
|---|---|
| Handle |
The unique name for each product. Handles can contain letters, dashes, and numbers, but no spaces. A handle is used in the URL for each product. |
| Title | The product title. This column is optional and can be blank. |
| Option 1 Name | The first option name, such as Color. If a product has no options, then enter Title. This column is optional and is used for human readability only. It doesn't update the option name. |
| Option 1 Value | The first option value, such as Blue. If a product has no options, then enter Default Title. This column is required to identify the variant. It doesn't update the option value. |
| Option 2 Name | The second option name when a product has multiple options. This column is optional and is used for human readability only. |
| Option 2 Value | The second option value when a product has multiple options. This column is required when the variant uses a second option, to identify the variant. |
| Option 3 Name | The third option name when a product has multiple options. This column is optional and is used for human readability only. |
| Option 3 Value | The third option value when a product has multiple options. This column is required when the variant uses a third option, to identify the variant. |
| SKU | The product identifier for inventory tracking. This column isn't required. It doesn't update the SKU of the variant. You need to use the product CSV instead to update SKU. |
| HS Code | The Harmonized System code for estimating duties and taxes for international customers (optional) |
| COO | The country of origin using ISO country codes for international shipping (optional) |
| Location |
The names of each of your locations. The location name is case sensitive and must match your Shopify location name exactly. For each variant, include a row for each location where you want to update inventory. Remove any other location rows. |
| Bin name |
The specific shelves, racks, or compartments of your inventory within your physical location. |
| Incoming (not editable) | Inventory that's on its way to your location. Incoming inventory isn't available to sell until it's been received. |
| Unavailable (not editable) | Inventory that's not available for sale. For example, you might make inventory unavailable when it's been damaged, being reviewed for quality control, reserved as safety stock, or other reasons. |
| Committed (not editable) | The number of units that are part of a placed order but aren't yet fulfilled. |
| Available (not editable) | Inventory that you can sell. Available inventory isn't committed to any orders or reserved for draft orders. |
| On hand (current) |
The number of units that you had at a location when you exported the CSV file. This column provides a snapshot of your inventory levels at the time of export and ensures safety validation during import. When importing your CSV file with both On hand (current) and On hand (new) values, your current inventory levels are compared with the On hand (current) values to prevent accidental overwrites. |
| On hand (new) | The new inventory quantity that you want to set. Leave empty when you don't want to change quantities. |
Example scenarios of updating inventory using a CSV file
Review the following scenarios and their results when updating inventory using a CSV file. Each scenario displays an example CSV file.
Scenario 1: Daily inventory adjustment after sales
- Scenario: You sell 8 red T-shirts and you want to update your inventory count.
- Result: Your inventory quantity for the red T-shirts is updated from 150 to 142.
| SKU | Location | Bin name | On hand (current) | On hand (new) |
|---|---|---|---|---|
| TSHIRT-RED-M | Warehouse-A | A-2-3 | 150 | 142 |
Scenario 2: Importing an outdated CSV
- Scenario: You exported the CSV file yesterday, but forgot to import it to your Shopify admin. You received new sales after the export.
- Result: Your inventory update is rejected, because your actual inventory quantity is 140, not 142. You need to export your newest inventory data.
| SKU | Location | Bin name | On hand (current) | On hand (new) |
|---|---|---|---|---|
| TSHIRT-RED-M | Warehouse-A | A-2-3 | 150 | 140 |
Scenario 3: Opening a new retail location
- Scenario: You're stocking your new NYC store with 50 lavender candles. Your NYC store location is inactive during the export.
- Result: Your NYC store is stocked with 50 lavender candles. Your location remains inactive.
| SKU | Location | Bin name | On hand (current) | On hand (new) |
|---|---|---|---|---|
| CANDLE-LAVENDER | Store-NYC | R-1-1 | Not stocked | 50 |
Scenario 4: Warehouse reorganization
- Scenario: You're moving laptop cases to aisle C for better organization.
- Result: Your laptop cases are moved to aisle C. Inventory quantity stays the same.
| SKU | Location | Bin name | On hand (current) | On hand (new) |
|---|---|---|---|---|
| LAPTOP-CASE | Warehouse-A | C-5-2 | 75 |
Scenario 5: Preparing inventory for BFCM
- Scenario: You're setting up bins for gaming consoles that arrive next week and you want to prepare the bins to receive the new items. Your location is inactive during the export.
- Result: Your bin is set up for gaming consoles. Your location remains inactive.
| SKU | Location | Bin name | On hand (current) | On hand (new) |
|---|---|---|---|---|
| CONSOLE-GAMING | Warehouse-B | BF-1-1 | Not stocked |
Scenario 6: Preparing to expand to the European Union
- Scenario: You're preparing customs codes for your EU warehouse before shipments arrive from China. Your location is inactive during the export.
- Result: Your product metadata, such as country of origin and HS codes, are updated for your inventory. Your location remains inactive.
| SKU | Location | Bin name | HS Code | COO | On hand (current) | On hand (new) |
|---|---|---|---|---|---|---|
| WIDGET-STEEL | Warehouse-EU | 7326.90.98 | CN | Not stocked |
Scenario 7: Accidental blank row in a CSV file
- Scenario: You accidentally leave a blank row in your CSV file.
- Result: No action is taken and this update is ignored.
| SKU | Location | Bin name | HS Code | COO | On hand (current) | On hand (new) |
|---|---|---|---|---|---|---|
| EMPTY-ROW | Warehouse-A | Not stocked |