Fetch the warehouse location name/bin on product query

Hi,

I need to have product locations but a product can sometimes have 10 locations, and we need the name in order to pick the correct destination via API. That means we’ll have to query location 10 times in order to get their names - and with the credit ceiling, that’s not a good option.

query {
product(sku:“100442016032iii”) {
request_id
complexity
data {
warehouse_products {
locations {
edges {
node {
id
legacy_id
account_id
warehouse_id
name
location_id
type {
name
}
}
}
}
}
}
}
}

In this does ShipHero can include pickable status in the same query. So, It can be helpful for performance.

Hi @Venkatesh!
We have something like this on our radar, would a Query like this work for you?:

query {
  product(sku: "1122334458") {
    request_id
    data {
      sku
      name
      warehouse_products {
        warehouse_id
        locations {
          edges {
            node {
              name
              location_id
              legacy_id
              quantity
            }
          }
        }
      }
    }
  }
}

Another option would be (in the meantime) to get ALL locations once a day, store that information and be able to tell which bin is which and if it is pickable using:

query{
  locations(warehouse_id: "V2FyZWhvdXNlOjExNzkw"){
    request_id
    complexity
    data(first: 1000) {
      edges {
        node {
          id
          name
          pickable
        }
      }
    }
  }
}

That should allow you to get 1k locations.

We will keep you updated on the progress of that implementation.
Thanks in advance!
Tom

Hi @tomasw,

This query is not working for me to find the location name,

query {
product(sku: “1122334458”) {
request_id
data {
sku
name
warehouse_products {
warehouse_id
locations {
edges {
node {
name
location_id
legacy_id
quantity
}
}
}
}
}
}
}

I’m getting response as

{

"errors": [

    {

        "message": "Cannot query field \"name\" on type \"ItemLocation\".",

        "locations": [

            {

                "line": 12,

                "column": 15

            }

        ]

    }

]

}

Please let me know any other way to fetch location name and pickable status using product query.

That’s correct @Venkatesh, I apologize for the confusion.
It’s currently on our radar and looking to be implemented in the next few months, but not live yet.

Currently, there is no way of getting the location name and pickable using the product query, they need to be returned using the locations query, either by getting them all at once and storing the data, or getting them one by one filtering by location id.
We recommend getting all the locations at once and storing that information which should not consume many credits.

Thanks again!
Tom

Hi @tomasw ,

Do you have any query to fetch location name and pickable status in Inventory-DS – Developer Resources | ShipHero

I am able to fetch location id and quantity. I need pickable status to be included.

If not whether I can expect the same in
https://developer.shiphero.com/examples-inventory-ds#location-query

Thanks

Hi @tomasw ,

I need to add SKU in the locations query but it’s throwing an exception when I tried. I need mappings like which location is for which SKU.

In locations fetch query only less response I’m getting. How to fetch all the locations for a specific warehouse.

Hi @Venkatesh!
Would the inventory snapshot work for you?

https://developer.shiphero.com/inventory-snapshot/

Thanks again!
Tom