Determine customer account on Shipment Update webhook

Hi,

We have a 3PL account and we just set up the Shipment Update webhook (thanks for your help with that @tomasw ).

Now how do we determine which customer account the order that triggered the webhook is from? We need to set up the webhook for all our customer accounts but we need to know which customer it is from. I don’t see any way to determine that from the data received. The Generate Label webhook does provide the Company Name in the From Address but I don’t see anything like that from the Shipment Update webhook.

I really hope that it’s something simple that I missed.

Thanks.

The other fields we need in the Shipment Update webhook are customs value and price. Strangely, there’s customs description but no customs value.

Hi @afroznissar
Glad it is working!

You should be able to determine that with one of the fields included on the Webhook

"account_id": 7556

This ID should be the one from the customer account.

These fields should be displayed inside the line items array, like for example:

"line_items": [
                {
                    "sku": "1111111112222333",
                    "tariff_code": "00.00.00.000",
                    "price": 10.00,
                    "customs_description": "Paint Black",
                    "customs_value": "10.00",
                    "line_item_id": 4818261,
                    "quantity": 1,
                    "weight": 3.53,
                    "partner_line_item_id": "1612802371-5",
                    "id": "16120371-5",
                    "country_of_manufacture": "",
                    "product_name": "Paint Black",
                    "name": "Paint Black",
                    "ignore_on_customs": false
                }

Let us know if you are not receiving them.
Thanks in advance!
Tom

Hi @tomasw ,

Unfortunately, I don’t see those fields come through. Here’s what we receive:

It would be great if we could get the account_id as well as all the additional details in line_items. IIRC we get all that info from the Generate Label webhook which is why I was surprised that we’re not getting it on Shipment Update.

Thanks Tomas!

Hi @afroznissar!
Ohh I see what you are referring to. Any chance this might be the Shipment Update Webhook instead of the Generate Label Webhook? I got that part wrong, sorry about that!

If that is the case, the Shipment Update doesn’t have those fields, that is correct

Hi @tomasw ,

Yes, it’s the Shipment Update webhook, not the Generate Label one.

Can we get the account id, price and customs value added in? Or, even better, have all the same fields (where applicable) as the Generate Label webhook?

Thanks!

Hi @tomasw ,

Just following up here - would it be possible to get those fields added in? That would save us the need to call the API multiple times to get that data. The savings would be significant on bulk shipments when we generate labels for 100s of orders at a time.

That said, I’m not even sure how I’d go about identifying which customer account this order is for so I can set the appropriate customer_account_id to query the additional data we need. If you can’t add in those fields to the webhook data, how can we achieve this?

Thanks!

Hi @afroznissar
We apologize for the delayed response about this!

We submitted a Feature Request for those items to be added and will let you know as soon as we get a resolution on the request.

To be able to see the IDs on the webhook and which customer it belongs to you can use the account query, something like this:

query {
  account {
    request_id
    complexity
    data {
      customers {
        edges {
          node {
            id
            legacy_id
            email
          }
        }
      }
    }
  }
}

This should return you the associated email and legacy_id (ID on the Webhook)

Thanks again!
Tom

Hi @tomasw ,

Sorry for the late response. And thank you for submitting the Feature Request!

Forgive me as I’m not too familiar with GraphQL yet. Are you saying that I can use that query to pull just the single customer account record that is associated with the shipment that just came through? If so, how/where do I specify the ID of the account to pull?

And, more importantly, I don’t see a unique account ID in the data from the Shipment Update webhook that I can use to pull the account data. How can I get the ID of just the one account for whom the shipment was made?

Thank you!

Hi @afroznissar!

Not one actually, you won’t be able to filter. But you should be able to pull them all at once, and those will never change, so you can store them and each time you get the webhook compare to which child account it belongs to

Correct, it is not available yet, I apologize for my confusion. But that is what the Feature Request is going to add to the webhook.

Let me know if I can provide a better explanation!
Thanks again!
Tom

Hi @tomasw ,

Got it, thank you for the clarification.

One (hopefully) last thing - let’s say I store the accounts locally as you suggested. You mentioned that every time we get the webhook, we can compare it to see which child account it belongs to.

You mean when we get the Shipment Update webhook, we can compare the data in there to the locally stored accounts to determine which one it belongs to, right? But which piece of data do we compare if there are no account IDs in the Shipment Update webhook?

Thanks!
Afroz

Hey @afroznissar !

That is correct. So let’s assume the request gets approved and build, then the field will probably be something like "account_id":6334 and that you can compare it to your info taken from the Public API legacy_id:6334 and if they match, the order comes in from that Customer account

Thanks again!
Tom

Ok that’s what I was afraid of. So, as a 3PL, there’s absolutely no way for us to associate shipments from the Shipment Update webhook with their corresponding accounts, right @tomasw ?

If so, this has just become a major roadblock in integrating our systems with Shiphero. Do you have an ETA to get a response as to whether the feature request will be implemented?

There could be a workaround though!

If when you get the shipment you use this Query:

query{
  shipment(id: "137328758"){
    request_id
    complexity
    data {
      order {
        account_id
      }
    }
  }
}

Being 137328758 the shipment ID from the webhook.
You could get the account_id from the customer that the order is for. This account ID should match the ID from the previous Query

query {
  account {
    request_id
    complexity
    data {
      customers {
        edges {
          node {
            id
            legacy_id
            email
          }
        }
      }
    }
  }
}

@tomasw thanks for that!

With this option, every time we receive the Shipment Update webhook, we’d need to query the shipment to get the account_id. There are 2 issues here:

  1. It’s an additional API call which slows down the process and, more importantly, adds a new point of failure (we might receive the webhook but an intermittent network issue might result in the query not running successfully).
  2. During bulk shipments, we’d be hitting the API pretty hard which might result in us hitting out API rate limits.

In any case, this workaround is better than nothing so thank you for that! I’d really appreciate it if you could push on the feature request though.

Thanks Tomas!

1 Like

Hi @afroznissar!
My apologies for the delayed update about this.
Unfortunately, the request has been rejected. We will keep this open in case there is a possibility of adding this in the future while doing some work on the webhooks.
Thanks again for the patience and we apologize for any inconvenience
Tom

Can i get the request for store details using account_id or legacy_id ?

Hi @arpita.rath!
Are you looking to get a list of the stores that you see on the UI at ShipHero - Simplify How You Pick and Pack Your Orders - ShipHero by using a Query?
In that case, unfortunately, we don’t have a Store’s Query.
Thanks in advance!
Tom

Hi @tomasw


Can i know how to get the dropdown list for In store showing in screen shot ?
Thanks in advance

We do not have a direct way to get that information and the only place I see shop_name is in the order query.