@mia-burton/dhl-tracking-js
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

dhl-tracking-js

A Node.js module for tracking DHL by tracking number

Usage

First of all you need to register to DHL Develop portal and register an App in order to get the DHL-API-Key.

The tracking method accept optional fields SERVICE, ORIGIN_COUNTRY_CODE and REQUESTER_COUNTRY_CODE, refer to DHL documentation to see allowed values.

Javascript

var dhlTracking = require('@mia-burton/dhl-tracking-js')
var dhl = new dhlTracking(API_KEY, BASE_URL)

// Get tracking order information
dhl.tracking({
  trackingNumber: TRACKING_NUMBER,
  service: SERVICE?,
  originCountryCode: ORIGIN_COUNTRY_CODE?,
  requesterCountryCode: REQUESTER_COUNTRY_CODE?
})

Typescript

import dhlTracking from '@mia-burton/dhl-tracking-js'
const dhl = new dhlTracking(API_KEY, BASE_URL)

// Get tracking order information
dhl.tracking({
  trackingNumber: TRACKING_NUMBER,
  service: SERVICE?,
  originCountryCode: ORIGIN_COUNTRY_CODE?,
  requesterCountryCode: REQUESTER_COUNTRY_CODE?
})

Test

call npm run test

Readme

Keywords

none

Package Sidebar

Install

npm i @mia-burton/dhl-tracking-js

Weekly Downloads

5

Version

0.0.4

License

MIT

Unpacked Size

14.8 kB

Total Files

15

Last publish

Collaborators

  • rtmb
  • antoniocapizzi-miaburton
  • paologf
  • gdg-mb