How do I track Amazon packages by the "TBA" number?
Asked Answered
I

2

6

I have a tracking number from Amazon that starts with TBA that I'd like to track via their API. I've seen their getPackageTrackingDetails endpoint but it takes an integer as input and I get an error when I try to use a TBA number on that endpoint. I know it is possible somehow, since AfterShip can do it (just enter a valid tracking number that starts with TBA). I cannot find in Amazon's docs how to do it and Amazon customer support doesn't know how to do it, either.

Implead answered 28/8, 2021 at 18:3 Comment(5)
It looks like this question fails at the "asking for docs" hurdle for SO. Is the "TBA number" being presented in the wrong format, perhaps?Bilk
I've seen their getPackageTrackingDetails endpoint but it takes an integer as input. I've also asked their customer support but, somehow, Aftership can do it so I ask here.Implead
Could it be as simple as not sending the "TBA" prefix? Maybe using Network Monitor on the AfterShip site could reveal the API parameters.Bilk
Does aftership really do this? They claim to, but I just tried tracking an amazon shipment that's out for delivery by its TBA number, and aftership said it was not found.Blazon
I was able to do it with a number of TBA packages. Weird that it doesn't work for you.Implead
M
1

You have to distinguish between the packageNumber (which is an integer) and the trackingNumber (which is a string). When creating your shipment, you will get the packageNumber. With that number you can call getPackageTrackingDetails.

The Shipping-Api seems to be the right endpoint to use. See https://github.com/amzn/selling-partner-api-docs/blob/main/references/shipping-api/shipping.md#get-shippingv1trackingtrackingid

The getTrackingInformation operation accepts a tracking number as an input parameter.

Martita answered 3/9, 2021 at 13:25 Comment(2)
That isn't my question.Implead
You can't use getPackageTrackingDetails with your Tracking Number. You have to use the package number. So you have to get this number first. How do you get the tracking number at the moment? Via Api or via Seller Central?Eos
C
1

Looking through the API documentation, there doesn't seem to be a good way to go from TBA number (if you can't just cut off those first three letters) to Package ID.

My order of operations on fixing this problem:

  1. Chop the first three letters off the TBA variable you have, convert to integer, try it. Per Andrew Morton's comment.

  2. What AfterShip may also be doing is going from the order ID. If the TBA is closely related to the order ID, the Amazon API will give you the information to go from Order ID -> Fulfillment Shipment -> Fulfillment Package -> Package ID. You could then use the Package ID to get your package information. So I'd look at Order ID's as well as Package ID's to see if you could convert one to another.

Given Stevish's comment, it's possible that the TBA can be cut off the TBA number and used as a package number if there is only one package in the order, but things get more complicated in other situations.

If you're working on a site that has the seller Order ID stored on your side, that seems to be the intent they have for getting it through the API.

Cadge answered 8/9, 2021 at 13:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.