Case study 1: Importing a product
This article is part of the catalog import and export (opens in a new tab) section and guides you through adding products to your store with a CSV file.
In this section, you’ll learn how to import a new product into your store. It’s a basic sample product with only a couple of attributes to help you understand how building an import file works.
In our example, we’ll use the following product:
A black dress from this season’s collection that costs $25, weighs 1 lb, and already has an SKU (A0001).
The “Black Dress” product has these attributes:
- A name (“Black Dress”)
- An SKU (“A0001”)
- An image (one main product image in our example)
- Price ($25)
- Weight (1 lb)
- And description (“This season’s collection”)
While creating the file, you’ll need to assign each of these attributes to a specific column.
You can compile your file in any spreadsheet editor (or in a plain text editor). In our example, we’ll use Google Sheets.
To create an import file:
-
Open your spreadsheet editor.
-
Enter “type” in the first cell. Then enter “product” in the row below it:
Now you’ve specified that the second row is about a product (and not a store category or a product file).
-
In the next column, enter “product_name” and the name of your product – “Black Dress”:
-
Then add “product_sku” in column C and “A0001” below (as you remember, A0001 is the SKU of your product):
-
Next, similarly, enter “product_media_main_image_url” and a link to this image on the web (in our example, it’s https://d2j6dbq0eux0bg.cloudfront.net/default-store/black\_dress\_1500px.jpg (opens in a new tab)).
You cannot give links to images stored on your device – the image has to be hosted somewhere on the internet (e.g., on Imgur (opens in a new tab) or in a folder on your hosting account).
-
In the following column, enter “product_price” and “25” to specify the product's price.
-
Next, enter “product_weight” and “1”, to specify the product's weight.
-
And finally, “product_description” and “This season’s collection”:
-
Now save/download the file as .csv to your device. In Google Sheets, you can do it by going to File → Download → Comma Separated Values (.csv).
That’s it! You’ve compiled a CSV file for the “Black Dress” product (you can find the “new_product” file in the article attachments (opens in a new tab)).
After you upload this file on the Catalog → Data Import & Export page, the product will be added to your store. Here’s how it will look in your store admin:
As you can see, this new product will contain all the product details from the initial attribute list.
Product quantity was set to “Unlimited” as we didn’t specify product stock. See Case study 8 to learn how you can enable stock tracking and update quantity for existing products →
The product was imported as “Disabled” as the file does not contain the “product_is_available” column that manages product availability. You can either enable your product manually later, or include the column with the corresponding value (“TRUE”) into your CSV file from the start.
Now you can choose any product from your catalog and follow these instructions step by step to compile your own import file. If you need to import several products, simply add data on them to the same file (one product per row):
If later you need to update your products, you can do it by importing a new file with data. In this file, “product_sku” and/or “product_internal_id” columns must be present, along with the columns for product attributes that you want to update.
See the list of available product columns →