Takealot Tracking Sensor?

ebendl

Executive Member
Joined
Sep 27, 2004
Messages
5,865
Reaction score
1,557
Location
Pretoria
Hi all,

So as many here, I receive a lot of packages from Takealot and I was wondering if there's an integration for Home Assistant (or an API, or an existing package tracking service that works with Takealot) to track packages?

I would love to know what packages are arriving today (Between me and my wife) and do some sort of automation on it.

Of course, it would be helpful if it covers other local e-retailers too...
 
The API follows:

https://api.takealot.com/rest/v-1-9-1/order/<ORDER NUMBER>/consignment/tracking/<WAYBILL NUMBER>

I haven't figured out a way to dynamically get the waybill number, previously you could just query the tracking details using the order number only.
 
The API follows:

https://api.takealot.com/rest/v-1-9-1/order/<ORDER NUMBER>/consignment/tracking/<WAYBILL NUMBER>

I haven't figured out a way to dynamically get the waybill number, previously you could just query the tracking details using the order number only.
Think I got it further as so:

Code:
curl 'https://api.takealot.com/rest/v-1-9-1/order/80570679/detail'   -H 'authority: api.takealot.com'   -H 'pragma: no-cache'   -H 'cache-control: no-cache'   -H 'accept: application/json'   -H 'x-csrf-token: 83388930'   -H 'x-tal-platform: www.takealot.com'   -H 'authorization: Bearer <<your own key here>>'   -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.67 Safari/537.36'   -H 'content-type: application/json'   -H 'origin: https://secure.takealot.com'   -H 'sec-fetch-site: same-site'   -H 'sec-fetch-mode: cors'   -H 'sec-fetch-dest: empty'   -H 'referer: https://secure.takealot.com/'   -H 'accept-language: en-US,en;q=0.9'   --compressed | jq '.response.consignments[]|{waybill_number:.waybill_number}'

Output looks like this:
Code:
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1864    0  1864    0     0   5037      0 --:--:-- --:--:-- --:--:--  5037
{
  "waybill_number": "MDX494515xx"
}
{
  "waybill_number": ""
}
 
Oh and you need to do the login POST to get the key to talk to the API. So its very possible to make this work actually...if you build your own custom home assistant integration. I would probably base it on the 17track module to automate it a bit, and store the login password in secrets.yaml or even better if you build a gui config for it.
 
Very cool! Thanks for looking into it!!

I guess if you want to include it in in the Home Assistant releases then it needs to be a full integration with a GUI, and not just some YAML config. But a custom component on Github is a good place to start...
 
Top
Sign up to the MyBroadband newsletter
X