Skip to content

Example: track by AWB ​

trackByAWB() is the most direct tracking flow supported by the SDK. It calls Shiprocket's order tracking endpoint with the AWB code and returns a TrackByAWBResponse.

ts
import { ShiprocketClient } from "open-logistics";

const sdk = new ShiprocketClient({
  email: process.env.SHIPROCKET_EMAIL!,
  password: process.env.SHIPROCKET_PASSWORD!,
});

const tracking = await sdk.trackByAWB("1234567890");

console.log(tracking.tracking_data.track_status);
console.log(tracking.tracking_data.shipment_status);
console.log(tracking.tracking_data.track_url);

Useful fields under tracking_data:

FieldNotes
track_statusNumeric tracking status
shipment_statusNumeric shipment status
shipment_trackShipment-level events
shipment_track_activitiesScan history with date, activity, and location
track_urlCustomer-facing tracking page

The same response shape is returned by trackByShipmentId() and trackByOrderId().