Using an inventory_item_id to look up a product_id

Highlighted
Shopify Partner
9 1 2

Hello: 

 

I would like to be able to take an inventory_item_id received via a webhook, and determine what the product_id is for that inventory_item_id.  Is there a way to do this via the APIs?

 

Best regards

1 Like
Highlighted
New Member
1 0 0

Hello, I am looking to do the exact same thing right now. Have you found a solution? 

 

If I do first I'll be sure to post it here.

 

Cheers!

0 Likes
Highlighted
Shopify Partner
9 1 2

This will work using the graph api:

 

{
                inventoryItem(id: "gid://shopify/InventoryItem/<your_inventory_item_id>") {
                    variant {
                    id
                    product {
                        id
                        createdAt
                        }
                    }
                }
            }

 

1 Like