Sitebuilder +

Case study 8: Updating product stock with import

This article is part of the catalog import and export section and tells you how to mass update inventory levels in your store with a CSV file.

You can update any attribute of a product that already exists in your store with import (except for the ID). For that, you’ll need to import a file that contains a product identifier column (SKU or ID, or both) and columns with the attributes that you want to update.

In this section, you’ll learn how to update product stock in your store (say, you had a restock).

In our example, we’ll update product stock for the product from Case study 1 that already exists in your store: a black dress with SKU “A0001”.

Currently its quantity is set to “Unlimited”. Let’s perform two tasks:

  1. First, enable stock tracking for this product: set the product's quantity to “30” and (optionally) the number of items left in stock at which you want to receive the Low Stock notice to “5”.
  2. Second, update the product's quantity so that it becomes “50”.
You can compile your file in any spreadsheet editor (or in a plain text editor). In our example, we’ll use Google Sheets.

Example 1. Enabling stock tracking and setting the initial product quantity

To create an import file:

  1. Open your spreadsheet editor.
  2. Enter “type” in the first cell. Then enter “product” in the row below it:

    create an import file (3).png

  3. In the next column, enter “product_sku” and the SKU of the product (“A0001”):

    Catalog import case studies (8).png

    Now the attribute values in this row will be added to a product with this specific SKU.
    Optionally, you can add “product_internal_id” and the ID of the product, or you can use both the ID and SKU columns to specify the product your attributes must be assigned to.
  4. Now add the “product_is_inventory_tracked” column to the file header and enter “TRUE” as its value for the “product” row:

    Catalog import case studies (21).png

    This way, you specify that this product needs stock tracking.
  5. Then add the “product_quantity” column to the file header and enter “30” as its value for the “product” row.
    This way, you set the product quantity to 30.
  6. (optional) Next, add the “product_low_stock_notification_quantity” column to the file header and enter “5” as its value.
    This way, you set the number of items left in stock at which you want to receive the Low Stock notice to 5.
  7. 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 that enables stock tracking for the existing “Black Dress” product in your store (you can find the “enabling_stock_tracking” file in the article attachments):

Catalog import case studies (30).png

After you upload this file on the Catalog → Data Import & Export page, the stock tracking data will be added to your product. Here’s how it will look on the General tab in your store admin:

Catalog import case studies (5).png

Example 2. Updating product quantity

To update product quantity when stock tracking is already enabled in your store, you need only three columns in your import file: “type”, “product_sku” (or “product_internal_id”), and “product_quantity”.

To create an import file:

  1. Open your spreadsheet editor.
  2. Enter “type” in the first cell. Then enter “product” in the row below it.
  3. Add the “product_sku” column to the file header and enter the SKU of the product (“A0001” in our example).
  4. Then add the “product_quantity” column to the file header and enter the new product quantity as its value for the “product” row (“50” in our example).

That’s it! You’ve compiled a CSV file with a quantity update for the existing “Black Dress” product in your store (you can find the “updating_stock” file in the article attachments):

Catalog import case studies (6).png

After you upload this file on the Catalog → Data Import & Export page, product quantity in your store will be updated. Here’s how it will look on the General tab in your store admin:

Catalog import case studies (27).png

Now you can choose any products from your catalog and follow these instructions step by step to compile your own CSV files.

See the list of available quantity columns

If you need to update stock information for several items, simply add rows with data on them to the same file:

Catalog import case studies (31).png

Was this article helpful?
0 out of 0 found this helpful