AfterShip/aftership-sdk-python

get_tracking with only tracking_number

bobort opened this issue · 3 comments

When I call this:
aftership.tracking.get_tracking(tracking_number=tracking_number)

I get this error:
ValueError: You must specify the tracking number of tracking id

Which doesn't make any sense. All I have is the tracking number; can't I retrieve information just based on that?

Maybe it is too late to reply, you have to use either tracking id or tracking number + slug.
tracking id: A unique identifier generated by AfterShip for the tracking.
tracking number: Tracking number
slug: Unique code of courier

image

You need to create tracking first and that will generate the tracking id tied to the tracking number. You can refer to the documentation https://docs.aftership.com/api/4/trackings/

Hi there, I have the same issue with this too. If I understand correctly from the documentation, /couriers/detect are meant to get the possible list of courier slugs. So, it would be nice if the API can return a candidate list of couriers before creating a new tracking object. Is there any workaround for this? Right now I am using https://track.aftership.com/api/courier-detect/ to get the list of possible courier slugs.