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.

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

All states CSV format with all inventory states
HandleTitleLocationBin nameIncoming (not editable)Unavailable (not editable)Committed (not editable)Available (not editable)On hand (current)On hand (new)
strbry-jamStrawberry JamOttawaA-2-320351018
strbry-jamStrawberry JamNew YorkA-7-301105061
rspbry-jamRaspberry JamOttawaA-9-315032528
rspbry-jamRaspberry JamNew YorkA-3-50563546

Example of the Available CSV export

Available CSV format showing location names as column headers
HandleTitleOttawaNew York
strbry-jamStrawberry Jam1050
rspbry-jamRaspberry Jam2535

Export inventory to a CSV file

You can export your inventory based on quantity type for specific locations and products.

Steps:

  1. From your Shopify admin, go to Products > Inventory.

  2. Click Export.

  3. 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.

  4. 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.
  5. 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.
  1. In the Export as section, select the file format that you want to export your inventory to.
  2. 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:

  1. Open your exported CSV file in a spreadsheet program.
  2. 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.
  3. 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:

  1. From your Shopify admin, go to Products > Inventory.

  2. Click Import.

  3. Click Add file, and then select your updated CSV file.

  4. Click Upload file.

  5. Review your import summary, and then click Start import.

  6. 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.

Complete list of CSV columns and their purposes
ColumnDescription
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.

TitleThe product title. This column is optional and can be blank.
Option 1 NameThe 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 ValueThe 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 NameThe second option name when a product has multiple options. This column is optional and is used for human readability only.
Option 2 ValueThe 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 NameThe third option name when a product has multiple options. This column is optional and is used for human readability only.
Option 3 ValueThe third option value when a product has multiple options. This column is required when the variant uses a third option, to identify the variant.
SKUThe 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 CodeThe Harmonized System code for estimating duties and taxes for international customers (optional)
COOThe 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.
Scenario that displays how to update inventory quantity after sales using inventory CSV
SKULocationBin nameOn hand (current)On hand (new)
TSHIRT-RED-MWarehouse-AA-2-3150142

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.
Scenario that displays an outdated CSV file import using the inventory CSV file.
SKULocationBin nameOn hand (current)On hand (new)
TSHIRT-RED-MWarehouse-AA-2-3150140

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.
Scenario that displays how to update inventory for a new retail location using the inventory CSV file.
SKULocationBin nameOn hand (current)On hand (new)
CANDLE-LAVENDERStore-NYCR-1-1Not stocked50

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.
Scenario that displays the warehouse reorganization task without updating inventory using the inventory CSV file.
SKULocationBin nameOn hand (current)On hand (new)
LAPTOP-CASEWarehouse-AC-5-275

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.
Scenario that displays how to prepare inventory for BFCM using the inventory CSV file.
SKULocationBin nameOn hand (current)On hand (new)
CONSOLE-GAMINGWarehouse-BBF-1-1Not 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.
Scenario that displays how to expand inventory to a new warehouse in the EU using the inventory CSV file.
SKULocationBin nameHS CodeCOOOn hand (current)On hand (new)
WIDGET-STEELWarehouse-EU 7326.90.98CNNot 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.
Scenario that shows what happens when there is an accidental blank row in a CSV file.
SKULocationBin nameHS CodeCOOOn hand (current)On hand (new)
EMPTY-ROWWarehouse-A Not stocked