How to find and change product and variant ID in Shopify

Tomas Janu


October 19, 2022

How to find and change product and variant ID in Shopify

Learn where to find and change product ID, variant ID, or inventory ID in Shopify. Step-by-step guide including screenshots.

How to find and change product and variant ID in Shopify

Finding the Shopify product and variant IDs is quite challenging, so we have created this guide for you. There are several ways how to do that, and you actually don't need admin access. You can find both on the Shopify storefront as a regular customer, too.

Shopify creates product ID and variant ID automatically – you can't define your own one or change its format. Variant ID is unique for each product and variant, while product ID is unique for each product, but if the product has multiple variants, the product ID is shared.

Please note that if a product doesn't have any variants, it still has both product ID and variant ID, which are different.

Upsell with Candy Rack

Option 1 – In the Product Details

This is probably the quickest and easiest way. Simply go to your Shopify store admin > Products > select a product. In the product details, click on Edit next to one of the variants.

The URL in your browser will be in the following format

Locating product ID and variant ID in the Shopify admin

You can see two IDs in the URL. The first one after products/ is a product ID which is the same for all variants. The second one after variants/ is the unique variant ID.

As you can imagine, this method is acceptable if you need to find one or two IDs quickly, but if you need dozens, we much rather recommend option #2 or option #4.

Option 2 – In the Variants List

Shopify has a list of all existing products and variant IDs on the store. The list is accessible on the following URL (once you are logged in to your store as admin) or (the XML file format is much easier to read in the browser)

The disadvantage of the file is that it doesn't include the product titles, only the variant names.

Locating product ID and variant ID in the variants.XML file

It also includes a lot of other information like inventory-item-id (another ID that is unique and different) which you can easily exclude by adding a parameter to the URL just like this,product-id,title

So it will list only three rows per product – product ID, variant ID, and variant title.

Option 3 – On the Storefront

Many people don't know that you can extract Shopify product ID and variant ID from the storefront without having any admin access.

Locating variant ID in the product URL

Simply go to the store as a regular customer, select a product, and on its product page, change the variant. Note the variant parameter is now part of the browser URL. The number after variant= is the variant ID.

Locating variant ID and product ID in the product page source code

But you still don't see the product ID. Open the page source code and look for texts like "product_id", "productid", or "id" and the number you get is the product ID.

The first two storefront approaches may work only in specific themes. However, the next one works on every Shopify store.

Add a product to the cart and go to cart page URL (i.e., and add .JSON (XML doesn't work in this case) at the of the URL in your browser, just like this

Locating product ID and variant ID in the cart.json file

For each product in the cart (line item), you will see an "id" parameter, which stands for product ID, and a "variant_id" parameter.

Option 4 – Using Third-party Export App

Alternatively, you can use some existing third-party apps that can export data from your store. There are many good and free ones. You can also take advantage of the free trial if you need just an ad hoc export.

One of the apps we have successfully tested is called Ultimate Product ID Exporter. It doesn't provide as much flexibility and features as other export solutions, but it's specifically designed for exporting product IDs. It has a free plan limited with 50 products per export and the paid unlimited plan is only $1.99 per month.

Exporting product ID and variant ID via the Ultimate Product ID Exporter app

This method is suitable for getting many variant IDs systematically.

What's really odd is that you won't see product ID nor variant ID in the standard Shopify product exports.

Bonus – How to Change Shopify Product or Variant ID

It's unfortunately not possible to change the existing product or variant ID. The only way to change it is to duplicate the product. The duplicate will get new IDs, but you still can't control their format or values.

Start your Shopify store for free and pay only $1 for the first monthStart your Shopify store for free and pay only $1 for the first month

Tomas Janu

Tom loves writing about upselling, conversion optimization, and e-commerce trends. He is one of our co-founders, and you can sometimes talk to him if you contact our support team. Make sure to follow him on LinkedIn for more Shopify-related tips and news.

Latest articles

All articles

Boost your Shopify business with our apps

All our apps are designed to help you grow your Shopify business. Check them out and take advantage of the free trial period.

Boost my Shopify