Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

delivery-tracker

egg-567MIT2.8.3

delivery-tracker is delivery tracking library for Node.js

package, delivery, parcel, tracker, tracking, shipping, shipment, ems, koreapost, ecargo, fedex, australia post, auspost, pantos, rincos, royalmail, usps, cj, cjkoreaexpress, pos laju, yello express, efs, ups, tnt, cesco, xpost, kerry, kerryexpress, sicepat, xioexpress, eparcel, lbc, j&t, jnt, dhl, canada post, paxel

readme

delivery-tracker

version download status status Standard - JavaScript Style Guide

delivery-tracker is delivery tracking library for Node.js

Courier List

Name Contributor Link
Korea Post @egg- http://www.koreapost.go.kr/
Ecargo @egg- http://ecargo.asia/script/users/main.php
FedEx @egg- https://www.fedex.com/
Australia Post @egg- https://auspost.com.au/
Pantos @egg- http://www.epantos.com/
Rincos @egg- http://www.rincos.co.kr/
Royal Mail @egg- http://www.royalmail.com/
USPS @egg- https://www.usps.com/
CJ Korea Express (Korea) @egg- http://cjkoreaexpress.co.kr/ (https://www.doortodoor.co.kr)
POS Laju @egg- http://www.poslaju.com.my
Yello Express @egg- https://www.yello-express.com
EFS @egg- http://efs.asia/
UPS @egg- https://www.ups.com
TNT @egg- https://www.tnt.com
CESCO @egg- https://www.cesco-logistics.com/
XPOST @egg- https://www.xpost.ph/
KERRYTHAI @egg- https://th.kerryexpress.com
SICEPAT @egg- http://sicepat.com/
XIOExpress @egg- https://xioexpress.com/
eParcel @egg- https://eparcel.kr/
LBC @egg- https://www.lbcexpress.com/
J&T (PH) @egg- https://www.jtexpress.ph/
DHL @carstenschwede https://www.dhl.com/
Canada Post @egg- https://www.canadapost-postescanada.ca/
PAXEL @egg- https://paxel.co/

Installation

$ npm install delivery-tracker

Usage

var tracker = require('delivery-tracker')
var courier = tracker.courier(tracker.COURIER.KOREAPOST.CODE)

courier.trace('TRACE_NUMBER', function (err, result) {
  console.log(result)
})

Command Line

$ npm install -g delivery-tracker
$ delivery-tracker -h

Usage: index [options] <tracecode>

  Options:

    -h, --help               output usage information
    -c, --courier <courier>  Courier Namespace
    -k, --apikey <apikey>  Courier API key

$ delivery-tracker -c EMS EBXXXXXXXXXKR

Response

Attribute Type Description
courier Courier Object courier information
number String tracking number
status String delivery status
checkpoints Array of Checkpoint Object Array of the checkpoint information.

Courier Object

Attribute Type Description
code String Unique code of courier.
name String Courier name

Checkpoint Object

Attribute Type Description
courier Courier Object courier information
location String Location info of the checkpoint provided by the courier.
message String Checkpoint message
time String The date and time of the checkpoint provided by the courier. The values can be:
Empty string,
YYYY-MM-DD,
YYYY-MM-DDTHH:mm:ss
YYYY-MM-DDTHH:mm:ss+Timezone

CODE

COURIER

tracker.COURIER.{NAMESPACE}

NAMESPACE CODE NAME
KOREAPOST koreapost Korea Post
ECARGO ecargo Ecargo
FEDEX fedex FedEx
AUSPOST auspost Australia Post
PANTOS pantos Pantos
RINCOS rincos Rincos
ROYALMAIL royalmail Royal Mail
USPS usps USPS
CJKOREAEXPRESS cjkoreaexpress CJ Korea Express
POSLAJU poslaju POS Laju
YELLOEXPRESS yelloexpress Yello Express
EFS efs EFS
UPS ups UPS
TNT tnt TNT
CESCO cesco CESCO
XPOST xpost XPOST
KERRYTHAI kerrythai KERRYTHAI
SICEPAT sicepat SICEPAT
XIOEXPRESS xioexpress XIOExpress
EPARCEL eparcel eParcel
LBC lbc LBC
JNT jnt J&T
DHL dhl DHL
CANADAPOST canadapost Canada Post
PAXEL paxel Paxel

STATUS

tracker.STATUS.{CODE}

Code Value Description
INFO_RECEIVED InfoReceived The carrier received a request from the shipper and wants to start shipping.
PENDING Pending New pending shipment to track or a new shipment without tracking information added.
IN_TRANSIT InTransit The carrier has received or received the carrier. Shipment is in progress.
DELIVERED Delivered The shipment was successfully delivered.
RETURNED Returned The shipment was returned.
EXCEPTION Exception Custom hold, undeliverable, shipper has shipped or shipped an exception.
FAIL_ATTEMPT FailAttempt The courier tried to send but failed, but usually reminds and tries again.

ERROR

tracker.STATUS.{CODE}

Code Value Description
UNKNOWN -1 Unknow error
NOT_SUPPORT_SHIPMENT 20 shipment does not support.
INVALID_NUMBER 10 invalid trace number.
INVALID_NUMBER_LENGTH 11 invalid trace number.
INVALID_NUMBER_HEADER 12 invalid trace number.
INVALID_NUMBER_COUNTRY 13 invalid trace number.

Sample

// KOREAPOST
{
  "courier": {
    "code": "koreapost",
    "name": "Korea Post"
  },
  "number": "EBCOMPLETE0KR",
  "status": "Delivered",
  "checkpoints": [
    {
      "courier": {
        "code": "koreapost",
        "name": "Korea Post"
      },
      "location": "MY4332",
      "message": "Delivery complete\nRecipient : K*NG()\nResult : Delivery complete",
      "time": "2016-07-04T11:40:00"
    },
    // ...
  ]
}

// FEDEX
{
  "courier": {
    "code": "fedex",
    "name": "FedEx"
  },
  "number": "DELIVEREDNUM",
  "status": "Delivered",
  "checkpoints": [
    {
      "courier": {
        "code": "fedex",
        "name": "FedEx"
      },
      "location": "SOUTH JORDAN, UT",
      "message": "Package delivered by U.S. Postal Service to addressee",
      "status": "Delivered",
      "time": "2016-12-14T13:17:00-07:00"
    },
    // ...
  ]
}

// PANTOS
{
  "courier": {
    "code": "pantos",
    "name": "Pantos"
  },
  "number": "DELIVEREDNUM-AUSPOST",
  "status": "Delivered",
  "checkpoints": [
    {
      "courier": {
        "code": "auspost",
        "name": "Australia Post"
      },
      "location": "Canning Vale, WA",
      "message": "Delivered",
      "status": "Delivered",
      "time": "2017-01-03T15:24:00+08:00"
    },
    // ...
    {
      "courier": {
        "code": "pantos",
        "name": "Pantos"
      },
      "location": "KRICN",
      "message": "Pick-Up (Pick-Up)",
      "status": "InfoReceived",
      "time": "2016-12-20T11:25"
    }
  ]
}

Test

Test with mocha

$ grunt

like watch

$ grunt watch

Contributing

Bug reports and pull requests are welcome on Github at https://github.com/egg-/delivery-tracker

  1. Fork it
  2. Create your feature branch.
  3. Commit your changes.
  4. Push to the branch.
  5. Create a new Pull Request.

Release History

See the CHANGELOG.md

License

delivery-tracker is licensed under the MIT license.

changelog

2.8.0

  • add paxel

2.7.3

  • fixed an issue in USPS is not working

2.7.2

  • fixed an issue in JNT is not working

2.7.1

  • fixed an issue in JNT is not working

2.7.0

  • add canada post

2.6.1

  • add courier namespace for DHL.

2.6.0

  • add DHL.

2.5.8

  • add an exception logic for internal server error in JNT.

2.5.7

  • add an exception logic for internal server error in SICEPAT.

2.5.6

  • add an exception logic in SICEPAT.

2.5.5

  • fixed an issue in SICEPAT is not working.

2.5.4

  • fixed RTS issue in JNT.

2.5.3

  • fixed an issue in EPARCEL is not working.

2.5.2

  • updating dependencies

2.5.1

  • change the error type when an unexpected error occurs. (string -> object)

2.5.0

  • add j&t express

2.4.5

  • fixed an issue in UPS is not working.

2.4.4

  • fixed an issue in CJKOREAEXPRESS is not working.

2.4.3

  • fixed an issue of UPS that always marked as InTransit

2.4.2

  • update eparcel check point area

2.4.1

  • disable strictSSL for CJ

2.4.0

  • added courier LBC

2.3.11

  • sicepat: add 'rejectUnauthorized' option to ignore ssl error.

2.3.10

  • sicepat: updated the changed date time format.

2.3.9

  • kerrythai: changed tracking endpoint

2.3.8

  • sicepat: apply updated return value

2.3.7

  • sicepat: fixed delivery status check issue.

2.3.6

  • eparcel: fixed delivery status check issue and change test dummy data.

2.3.5

  • eparcel: fixed delivery status check issue.

2.3.4

  • sicepat: add status for INFO_RECEIVED

2.3.3

  • sicepat: add apikey for option

2.3.2

  • sicepat: change to work without apikey

2.3.1

  • fit to standard format

2.3.0

  • add eparcel express
  • fixed ups tracker

2.2.3

  • update xpost api endpoint

2.2.0

  • add xio express

2.1.3

2.1.2

  • add handle for sicepat unknown error.

2.1.1

  • update sicepat error.

2.1.0

  • add sicepat.

2.0.4

  • add error auspost

2.0.3

  • add message cesco tracking information.

2.0.2

  • change cesco host

2.0.1

  • change cesco host (disable ssl)

2.0.0

  • add KERRY THAI

1.9.1

  • fixed XPOST pending state. (for pickup)

1.9.0

  • add XPOST.

1.8.0

  • add CESCO.

1.7.2

  • fixed PANTOS not exist tracking number.

1.7.1

  • fixed UPS time format bug

1.7.0

  • add TNT.

1.6.3

  • fixed UPS time format bug

1.6.2

  • update UPS time format

1.6.1

  • sort UPS checkpoints.

1.6.0

  • add UPS.

1.5.5

  • update cj korea express.
  • fixed can not load external courier (pantos)

1.5.4

  • add exception courier error message.

1.5.3

  • add external courier to pantos.

1.5.2

  • add exception courier error message.

1.5.1

  • fixed can not load pantos data.

1.5.0

  • add Air Bridge.

1.4.4

  • update USPS site changes.

1.4.3

  • update CJ Korea Express timezone.

1.4.2

  • update yello express, rincos delivery message

1.4.0

  • add EFS.

1.3.1

  • update yello express state

1.3.0

  • add Yello Express.

1.2.1

  • add POS Laju delivery complete message type.

1.2.0

  • add POS Laju.

1.1.0

  • update rincos pending status.

1.0.0

  • add CJ Korea Express.

0.9.4

  • Added exception logic for unaligned shipping information.

0.9.3

  • add a status value to the rincos checkpoint message information.

0.9.2

  • Added USPS description text to README.md.

0.9.1

  • Added rincos delivery complete message type.

0.9.0

  • added USPS.

0.8.5

  • fixed timeout pantos.

0.8.4

  • update pantos shiment error handle.

0.8.0

  • add royalmail.

0.7.3

  • add koreapost shipping completion condition.

0.7.2

  • checking the style of all javascript files.

0.7.1

  • added exception logic when wrong number is entered. (rincos)

0.7.0

  • add rincos.

0.6.1

  • add courier to commander

0.6.0

  • add exception logic when one package is shipped via multiple carriers. (Pantos)
  • update test logic.

0.5.0

  • add australia post.
  • add pantos.

0.4.1

  • add a status value to the fedex checkpoint message information.
  • change the delimiter of checkpoint message.

0.4.0

  • add command line.

0.3.0

  • add fedex.

0.2.0

  • add ecargo.

0.1.0

  • add korea post.