Thailand Post SDK
An unofficial Node SDK for Thailand Post that consumes the official API.
WARNING
This project contains information that was obtained from reverse-engineering.
In order to legally use the official API, you must send a request to Thailand Post.
Installation
$ [sudo] npm install thailand-post
Usage
First, you need to import the module and create an instance of the service.
var TrackService = TrackService; var trackService = lang: "EN" // either EN or TH; trackService;
Track an Item
Single item
var barcode = "EN331755897TH"; serv;
Multiple items
var barcodes = "EN331755897TH" "RI598984676CN"; serv;
Get shipping rates
var country = "TH"; // Thailandvar weight = 30; // 30g serv;
Get all branches
serv;
Search for a branch
var keyword = "คลอง"; serv;
Get nearby locations
var latitude = 1311143;var longitude = 101154250;var numOfResults = 10; serv;
Get countries
You can then use the country code to find shipping rates.
serv;
Advanced Usage
This is for anyone who would like to access the SOAP API directly.
Visit the official Thailand Post SOAP API documentation for more information on each operation.
Track items
var args = user: servdefaultArgsuser password: servdefaultArgspassword lang: servdefaultArgslang Barcodes: "EN331755897TH,RI598984676CN"; servclient;