Shipments with Multiple Labels in API but Single in UI

Hello! I’ve been trying to gather some data on shipments that go out in multiple packages, and I’ve run into a few situations where the API reports multiple valid labels being in a shipment, but when viewing the same shipment in the UI, it only shows one label.

For example, running this query:

query {
	shipment (id: "U2hpcG1lbnQ6MzYzMDI1MTI4") {
		request_id
		data {
			id
			total_packages
			shipping_labels {
				id
				legacy_id
				package_number
				box_name
				tracking_number
				tracking_status
				cost
				status
				dimensions {
					weight
					length
					width
					height
				}
			}
		}
	}
}

Gives back this result:

{
  "data": {
    "shipment": {
      "request_id": "64de1c726d6108bc3f8c2cc9",
      "data": {
        "id": "U2hpcG1lbnQ6MzYzMDI1MTI4",
        "total_packages": 2,
        "shipping_labels": [
          {
            "id": "U2hpcHBpbmdMYWJlbDoyNjA1MTAyMzE=",
            "legacy_id": 260510231,
            "package_number": 1,
            "box_name": "8x4x4",
            "tracking_number": "redacted_for_privacy20078",
            "tracking_status": "DELIVERED",
            "cost": "6.22",
            "status": "valid",
            "dimensions": {
              "weight": "1.0275 lb",
              "length": "8.00 inch",
              "width": "4.00 inch",
              "height": "4.0000 inch"
            }
          },
          {
            "id": "U2hpcHBpbmdMYWJlbDoyNjA1MTAyMzI=",
            "legacy_id": 260510232,
            "package_number": 1,
            "box_name": "8x4x4",
            "tracking_number": "redacted_for_privacy20078",
            "tracking_status": "UNKNOWN",
            "cost": "6.22",
            "status": "valid",
            "dimensions": {
              "weight": "1.0275 lb",
              "length": "8.00 inch",
              "width": "4.00 inch",
              "height": "4.0000 inch"
            }
          }
        ]
      }
    }
  },

Interestingly, they both have the same tracking number, weight and label cost, and they both have a “valid” status, but the IDs and legacy_ids are different. The really strange part is that they both say “package_number: 1”. But when go to the order details (Orders > Manage Orders) or to the Shipments Report (Reports > Shipments) in the UI, they both only show 1 label.

My question is why would it be showing this, and how do I know when a “valid” label is not actually valid?

Thanks,
Jeremy

Hey @jeremyw,

I’ll look into this and get back to you shortly!
Please let me know if you have any questions or concerns.

Best,
RayanP

Hey @jeremyw,

Thanks for hanging in there!

More than likely going to escalate this one to our Engineering Team to take a look at but I wanted to ask if you were able to provide any more examples?

Please let me know if you have any questions or concerns.

Best,
RayanP

Thanks @sh-agent . Here are more request_ids for shipments that have the same issue:

64e37d2fd45ce3122c63f7db
64e37dc9466ffce97d951edb
64e37e0dbef015602d9fc909
64e37eee566f9f9059a336e9
64e37f3fc5db7ff8dcf89bdf
64e37f772757351a490baa72
64e37fda5f6023df2477f0ee
64e3800e6398051830df53b4

We don’t do a lot of multi-label shipments, so that’s for everything between Jul 11 and Aug 10 where the UI shows only a single label, but the API is reporting multiple labels.

Thanks,
Jeremy

1 Like

Hello @sh-agent ! I was wondering if you’ve been able to get any info about this. I know it’s not a large number of orders, but it’s affecting our ability to do some cost savings analysis on orders that actually do have multiple shipments/labels. Even if I just had a way of determining which label is truly invalid in spite of the status showing “valid”, that would be incredibly helpful.

Thanks,
Jeremy

Hey @jeremyw,

Apologies for the late update here and thank you for the extra examples.

I believe this issue is somehow connected to merged orders, and I’ve passed that information along to our Engineers via the ticket.

I can’t say for certain in every case, but in the examples I looked at the first label returned was the “real” one.

I’ll update you here as soon as updates come in from the Engineering Ticket.

Please let me know if there’s anything I can do to assist in the meantime.

Best,
RayanP

Thanks, @sh-agent !

I think you may be right about the merged orders. I updated the query to get the merged_orders, the order_id associated with the shipping_label, and the order ID associated with the shipment, like so:

query {
  shipment (id: "U2hpcG1lbnQ6MzYzMDI1MTI4") {
    request_id
    data {
      id
      total_packages
      order {
        id
        merged_orders {
          order_id
          is_master
        }
      }
      shipping_labels {
        id
        legacy_id
        order_id
        package_number
        status
      }
    }
  }
}

And I got back this:

{
  "data": {
    "shipment": {
      "request_id": "64e662140af87604229cc687",
      "data": {
        "id": "U2hpcG1lbnQ6MzYzMDI1MTI4",
        "total_packages": 2,
        "order": {
          "id": "T3JkZXI6MzczNDY5MDMy",
          "merged_orders": [
            {
              "order_id": "T3JkZXI6MzczNDc2Mjkw",
              "is_master": false
            }
          ]
        },
        "shipping_labels": [
          {
            "id": "U2hpcHBpbmdMYWJlbDoyNjA1MTAyMzE=",
            "legacy_id": 260510231,
            "order_id": "T3JkZXI6MzczNDY5MDMy",
            "package_number": 1,
            "status": "valid"
          },
          {
            "id": "U2hpcHBpbmdMYWJlbDoyNjA1MTAyMzI=",
            "legacy_id": 260510232,
            "order_id": "T3JkZXI6MzczNDc2Mjkw",
            "package_number": 1,
            "status": "valid"
          }
        ]
      }
    }
  }
}

As you can see, the main order ID (5MDMy) and the merged id (2Mjkw) are reflected in the order_id field of the shipping stats. The first label matches the main order ID, and the second matches the merged one.

In contrast, if I run one that legitimately has multiple packages, they seem to match the main order ID:

{
  "data": {
    "shipment": {
      "request_id": "64e6649759536a4da69b3ac2",
      "data": {
        "id": "U2hpcG1lbnQ6MzY5ODM2NTk4",
        "total_packages": 3,
        "order": {
          "id": "T3JkZXI6MzgwOTM2MzEx",
          "merged_orders": []
        },
        "shipping_labels": [
          {
            "id": "U2hpcHBpbmdMYWJlbDoyNjY2NjIwODU=",
            "legacy_id": 266662085,
            "order_id": "T3JkZXI6MzgwOTM2MzEx",
            "package_number": 1,
            "status": "valid"
          },
          {
            "id": "U2hpcHBpbmdMYWJlbDoyNjY2NjIwOTE=",
            "legacy_id": 266662091,
            "order_id": "T3JkZXI6MzgwOTM2MzEx",
            "package_number": 2,
            "status": "valid"
          },
          {
            "id": "U2hpcHBpbmdMYWJlbDoyNjY2NjIwOTQ=",
            "legacy_id": 266662094,
            "order_id": "T3JkZXI6MzgwOTM2MzEx",
            "package_number": 3,
            "status": "valid"
          }
        ]
      }
    }
  }
}

I don’t know if I have any examples where there were legitimate multi-package orders that also involved merged orders to see what those look like. My guess would be “bad” shipping_labels would have an order_id that matches the merged_order ID where is_master is set to false.

It kind of sounds like that’s essentially what you’re waiting to confirm. I’ll be interested to hear what you get back from the Engineering Ticket.

Edit: I was talking to some of my coworkers about this, and I found something that may be applicable. This won’t necessarily mean anything for other companies using ShipHero, but in our case we’re using it in conjunction with Shopify, but… For us, when we merge orders, we do it in ShipHero only. On the Shopify side, both orders still exist separately. We were talking about how ShipHero seems to generate the labels at the final stage of packing, which would be long after the order merge. It occurred to us that maybe ShipHero generates the second label in the background so that it can feed the tracking info back upstream to Shopify (or other ordering systems) so that both orders get the same tracking number. In that case, it seems to make sense that the second label is generated. If that’s what is in fact going on, maybe it would be good to have an additional field in the shipping_labels that identifies it as such, like “merged_order_label” or something.

Thanks for your help!
Jeremy

1 Like

Hey @jeremyw,

Thanks for taking the time to share that!

It sounds extremely plausible to me that, that’s what’s occurring here. I’m going to share this information to our team and the Engineers via the ticket.

Thanks!

Please let me know if you have any questions or concerns.

Best,
RayanP

1 Like