How to check if products belong to different inventory location?

New Member
1 0 0

Hi, I have one question about ShopifyAPI::InventoryItem data

I noticed that we can set products to different inventory locations

Screen Shot 2020-08-27 at 2.02.10 PM.png

And from Shopify API as I know, we need to do multiple requests to get all products under each locations


location_id_sku_mapping = do |location|
  inventory_item_ids = ShopifyAPI::InventoryLevel.where(location_ids:
  next if inventory_item_ids.blank?
  skus = ShopifyAPI::InventoryItem.where(ids: inventory_item_ids.join(',')).map(&:sku)

  [, skus]


I am wondering if we can get that info in a simpler way or from ShopifyAPI::Order data?