Large numbers of empty shipments clogging up webhooks/API

Hi,

I’ve been working with shipment data for a couple of weeks here, and I keep running into the issue that most of the shipments contained in our data (about 9 out of 10) are devoid of data and items. They don’t seem to appear on the dashboard, although we do get webhooks for them. Here’s an example query for a specific order that has one “real” shipment and 9 more empty ones, which is pretty typical:

query {
  order(id: "T3JkZXI6MTQyNTc2NDIx") {
    request_id
    complexity
    data {
      id
      order_number
      partner_order_id
      order_date
      shipments {
        id
        created_date
        shipping_labels {
          status
          tracking_number
          carrier
          shipping_method
          shipping_name
          created_date
        }
      }
    }
  }
}

The above query produces the following response:

{
  "data": {
    "order": {
      "request_id": "5f3da9a560e457b6e8618d58",
      "complexity": 1,
      "data": {
        "id": "T3JkZXI6MTQyNTc2NDIx",
        "order_number": "32214",
        "partner_order_id": "17806",
        "order_date": "2020-08-18T16:56:03+00:00",
        "shipments": [
          {
            "id": "U2hpcG1lbnQ6OTUxMDAyNDk=",
            "created_date": "2020-08-18T21:39:03+00:00",
            "shipping_labels": [
              {
                "status": "valid",
                "tracking_number": "92055901755477000224297949",
                "carrier": "shippo__usps",
                "shipping_method": "usps_priority",
                "shipping_name": "US Mail - Priority Mail 3-Day",
                "created_date": "2020-08-18T21:39:03+00:00"
              }
            ]
          },
          {
            "id": "U2hpcG1lbnQ6OTUxMDA5NTI=",
            "created_date": "2020-08-18T21:40:53+00:00",
            "shipping_labels": []
          },
          {
            "id": "U2hpcG1lbnQ6OTUxMDU4ODM=",
            "created_date": "2020-08-18T21:56:24+00:00",
            "shipping_labels": []
          },
          {
            "id": "U2hpcG1lbnQ6OTUxMDgwMzY=",
            "created_date": "2020-08-18T22:11:15+00:00",
            "shipping_labels": []
          },
          {
            "id": "U2hpcG1lbnQ6OTUxMTMxOTM=",
            "created_date": "2020-08-18T22:41:22+00:00",
            "shipping_labels": []
          },
          {
            "id": "U2hpcG1lbnQ6OTUxMTczOTc=",
            "created_date": "2020-08-18T23:14:41+00:00",
            "shipping_labels": []
          },
          {
            "id": "U2hpcG1lbnQ6OTUxMjQ2NTc=",
            "created_date": "2020-08-18T23:55:11+00:00",
            "shipping_labels": []
          },
          {
            "id": "U2hpcG1lbnQ6OTUxMjc4OTI=",
            "created_date": "2020-08-19T00:36:56+00:00",
            "shipping_labels": []
          },
          {
            "id": "U2hpcG1lbnQ6OTUxMjg5Nzk=",
            "created_date": "2020-08-19T00:51:34+00:00",
            "shipping_labels": []
          },
          {
            "id": "U2hpcG1lbnQ6OTUxMzAxNzY=",
            "created_date": "2020-08-19T01:11:49+00:00",
            "shipping_labels": []
          }
        ]
      }
    }
  }
}

I’m fairly certain that these empty shipments aren’t a result of anything we’re doing in our warehouse, as a lot of them show up outside our working hours. I don’t think they’re due to my API manipulations either, because they’ve been happening since before I started doing anything with shipment data via the API.

Any insights? I’d like to get rid of all this extra data if possible, because it slows down API pagination quite considerably, and the extra webhooks are a bit annoying as well.

For what it’s worth, these empty shipments seem to show up mostly during the late afternoon and evening for us (Pacific time.)

Hi @jfmontanaro
It looks like those shipment attempts where made from outside of ShipHero, but I cannot seem to find the exact call.
Is there any chance they were made via the Rest API?
I see you have two connections at https://app.shiphero.com/dashboard/settings/api
I will continue to check if I can find the exact call
Thanks in advance!
Tom

Hi Tomas,

That’s odd, I’m not aware of anything that could be using the REST API to create shipments.

I’ve removed one of the connections. However, the “API Secret” for the one remaining is what’s currently being used to sign the webhooks we are receiving and actively using. I’m guessing deleting that will screw up our webhooks? Or does the signing secret exist independently of the API token?

Hi @jfmontanaro
That shouldn’t be an issue (removing the connections) because those connections will be removed as well when the Rest API gets deprecated and Webhooks should continue to work as expected. In other words, webhooks already registered should not be deleted or affected.

However, right now, we don’t have a way of seeing the Secret in order to use the HMAC verification other than using the secret from https://app.shiphero.com/dashboard/settings/api

If you are going to register a new webhook, in that case, you can use the Public API for that, no need to use any secret or api_key
Let me know if that doesn’t answer your question
Thanks again!
Tom

Actually let me confirm this, for now, don’t remove that connection

Any update on this? I’d be happy to remove that extra connection if it won’t break webhooks, but I don’t want to do that if it removes out ability to authenticate webhooks. We don’t want anyone in the world to be able to make updates to our storefront by just hitting the right URL with correctly-formatted data.

Hi @jfmontanaro!
I asked for an update to our engineering team and will let you know as soon as I have more info about it.
For the time, you can use that Secret and don’t remove the connection at https://app.shiphero.com/dashboard/settings/api
Thanks again for the patience and I will provide an update asap
Tom