Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

How to bulk get all inventoryItemIds from a store?

How to bulk get all inventoryItemIds from a store?

rank234
Excursionist
20 0 18

I have a lot of products and want to get all the inventoryItemIds from my store so I can use them for other operations.  Is there an easy way to do this?

Reply 1 (1)

HunkyBill
Shopify Partner
4853 60 569

Yes! Yes there is an easy way to do this. Here is the easiest way I know.

mutation{
  bulkOperationRunQuery(
    query:"""
        {
        products { 
         edges {
           node {
            id
             variants {
               edges {
                 node {
                   inventoryItem {
                     id
                   }
                 }
               }
             }
           }
         }
        }
      }
    """
  ) {
    bulkOperation {
      id
      status
    }
    userErrors {
      field
      message
    }
  }
}
Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com