ts-tracking-number
Version:
Detect and validate tracking numbers for USPS, UPS, FedEx, and other major couriers.
68 lines (67 loc) • 2.2 kB
JSON
{
"name": "DHL",
"courier_code": "dhl",
"tracking_numbers": [
{
"name": "DHL Express",
"id": "dhl_express",
"regex": "\\s*(?<SerialNumber>([0-9]\\s*){9,10})(?<CheckDigit>([0-9]\\s*))",
"validation": {
"checksum": {
"name": "mod7"
}
},
"tracking_url": "http://www.dhl.com/en/express/tracking.html?brand=DHL&AWB=%s",
"test_numbers": {
"valid": [
"3318810025",
"73891051146",
"8487135506",
"1099255990",
"3821724944",
"3318810036",
"3318810014"
],
"invalid": [
"3318810010",
"3318810034",
"3318810011"
]
}
},
{
"name": "DHL Express (Piece ID)",
"id": "dhl_express_piece_id",
"regex": "\\s*(J[A-Z]{2,3})(?<SerialNumber>([0-9]\\s*){9,10})",
"validation": {},
"tracking_url": "http://www.dhl.com/en/express/tracking.html?brand=DHL&AWB=%s",
"test_numbers": {
"valid": [
"JJD0099999999",
"JVGL0999999990"
],
"invalid": [
"XJD0099999998"
]
}
},
{
"name": "DHL E-Commerce",
"id": "dhl_ecommerce",
"regex": "\\s*((GM)|(LX)|(RX)|(UV)|(CN)|(SG)|(TH)|(IN)|(HK)|(MY))\\s*(?<SerialNumber>([0-9]\\s*){10,39})",
"validation": {},
"tracking_url": "http://www.dhl.com/en/express/tracking.html?brand=DHL&AWB=%s",
"test_numbers": {
"valid": [
"GM2951173225174494",
"GM 2 9 5 117 32 25 1 7 44 9 4",
"GM295117494011169042"
],
"invalid": [
"GS295117494011169041",
"GR295117494011169045"
]
}
}
]
}