How to get product ID and variant ID with bulk editor

These were all helpful but not quite what I needed, which was everything from the typical export BUT with product IDs. What worked for me was combining the data

  1. Grabbing the admin/variants.json, downloading, converting to csv (just google json to csv there is a free converter)

  2. Typical full product export

  3. Bring both into Google Sheets and sort both by SKU (the best unique field that is in both exports from above), then combine the columns into one sheet, do a visual check to make sure it all lines up.

I would suggest using the Shopify ID Export program in combination with xsv:

shopify_id_export -t access-token your-shop.myshopify.com

This will output a file named your-shop.csv. You can take this file and the product export from the Shopify Admin and combine them via the xsv program:

xsv join 'Variant SKU' export-from-shopify.csv SKU your-shop.csv > with-product-and-variant-ids.csv

with-product-and-variant-ids.csv will have a 2 SKU columns (SKU and Variant SKU). If this is a problem one can be filtered out using xsv:

xsv join 'Variant SKU' export-from-shopify.csv SKU your-shop.csv | xsv select '!SKU' > with-product-and-variant-ids.csv.  

This will remove the SKU column, leaving Variant SKU

Xamy’s solution using the built-in reports worked very well

Works great! Thank you.

Thanks a lot! I think this is the most efficient way if you are not comfortable with json or any coding like I am. I have 530 ids in my store and edit the product ID with google sheet takes less than 10 seconds.

This did not work. I created an app and created access token and have api key and API secret key. I entered that into the variables above and nothing came of it.

hi thanks for this code.

$pageurl = 'https://apikey:password@your-store.myshopify.com/admin/products.json?limit=250&page='.$i;

i am on 2023-10 and i have the API Access Token, Api Key and Api Secret Key.

Ive tried combinations but to no avail.

Also im trying this from an external server that has php support. I get the following error:
Warning: file_get_contents(https://…@mystore.myshopify.com/admin/products.json?limit=250&page=1 :disappointed_face: Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in**/storage/ssd3/482/21709482/public_html/Product-ID.php** on line 7

Thank you!!!

You are a hero! Thank you!

Genius

Yeah. It’s 2024 now, and this is still missing. That’s like a car that’s missing a steering wheel.

The hero we needed, Thanks!

It helped A LOT, what a simple and straightforward solution! Thanks! :grinning_face_with_smiling_eyes:

I’m struggling to find out how to do this, perhaps because Shopify has changed how the interface looks, or maybe I’m missing something very simple. Step 3 is where I don’t know what to do.