How can we get warehouse id from generate label webhook

Hi!
we have few generate webhook labels registered and now we have a requirement where we need to get the warehouse from where this particular label is being generated.
I could not find any information related to warehouse in the webhook body.
How can we access this information.
Thanks

Hi @saif_storage
I am not sure I understand, did you want to say that you have a few generate label webhooks registered? If so, can you send the request-id and the error that you are receiving? I will be happy to take a look.

Hello @theresa
Yes the webhook is registered, and actually am not getting any error. I am looking for a way to find the warehouse from where the label is being generated.
Let me try to explain.
We have 2 warehouses in location A and location B from where orders with shipping method X are processed. When we generate the label a webhook request is received on our url.com webhook. In this webhook we are getting all data as mentioned in the documentation. Now what i want is to find out whether the request is coming from warehouse in location A or warehouse in location B.
is there any way to find out?
I hope its clear now

Hi @saif_storage !
Thank you for the details in the explanation. The warehouse information is contained in the shipment data.

This will get you the warehouse id and the name:

query {
  shipment(id: "<shipment id here>") {
    request_id
    complexity
    data {
      warehouse {
        id
        identifier
      }
    }
  }
}

okay… in the webhook i will have to make a request to get the order details from order query and then from shipment i can get the warehouse… It seems to bit of extra work but i dont think there is another way to do this.
Thanks for your help

1 Like