Find a variant ID

You can use variant IDs for several reasons. This article will show you how to locate the ID of a specific variant.

  1. From your Shopify admin, click Products (or press G P P):

    Products

  2. Click on a product.

  3. Look at your URL bar on the product page. You should see something like this:

    http://my-shop-name.myshopify.com/admin/products/1234567
    

    At the end of this URL you want to add ".xml"

    So your product's admin URL will looks something like this:

    https://my-shop-name.myshopify.com/admin/products/1234567.xml
    
  4. Press the Enter key.

You will then see an XML file that contains all of the variant information for that product. It may look intimidating at first, but don't let it scare you! You can see that each variant has its own "block", and within each block you'll find a single line for "id". The number between the <id type="integer"> and </id> is the variant id that you want to grab.

Sample xml

Want to discuss this page?

Visit the Shopify Community