Shipment information

delivery-tracking/shipment-info@1.1.1
Supported by 2 providers
D
S

Retrieve Shipment Status

Get the current shipment status.

Input
Shipment tracking number
Carrier
Result
Carrier
Status
Origin
Shipment tracking number
Destination
Events
Estimated delivery date

1.Choose a provider

2.Use ShipmentInfo with mock in your code

npm i @superfaceai/one-sdk
const { SuperfaceClient } = require('@superfaceai/one-sdk');

const sdk = new SuperfaceClient();

async function run() {
  // Load the profile
  const profile = await sdk.getProfile('delivery-tracking/shipment-info@1.1.1');

  // Use the profile
  const result = await profile
    .getUseCase('ShipmentInfo')
    .perform({
      trackingNumber: '00340434292135100148'
    }, {
      provider: 'mock'
    });

  // Handle the result
  try {
    const data = result.unwrap();
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

run();

Structure details

Input (object)

trackingNumber
The identifier of shipment.
carrier
The shipment carrier identification to narrow down the results.

Example

{
  "trackingNumber": "00340434292135100148"
}

Result (list of objects)

carrier
The name of the carrier responsible for delivery.
status
The latest shipment event.
origin
A postal address with the origin of the shipment.
trackingNumber
The identifier of shipment.
destination
A postal shipping address.
events
A list of delivery tracking events.
estimatedDeliveryDate
Estimated date and time of delivery.

Example

[
  {
    "carrier": "shippo",
    "destination": {
      "address": {
        "addressLocality": "Chicago",
        "countryCode": "US",
        "postalCode": "60611"
      }
    },
    "estimatedDeliveryDate": "2021-11-08T07:03:30.944Z",
    "events": [
      {
        "statusCode": "unknown",
        "statusText": "The carrier has received the electronic shipment information.",
        "timestamp": "2021-11-01T19:54:08.906Z"
      }
    ],
    "origin": {
      "address": {
        "addressLocality": "San Francisco",
        "countryCode": "US",
        "postalCode": "94103"
      }
    },
    "status": {
      "location": {
        "address": {
          "addressLocality": "Chicago",
          "countryCode": "US",
          "postalCode": "60611"
        }
      },
      "statusCode": "delivered",
      "statusText": "Your shipment has been delivered.",
      "timestamp": "2021-11-03T23:54:08.906Z"
    },
    "trackingNumber": "00340434292135100148"
  }
]

Implementation details

Provider
mock
Use case
ShipmentInfo
Author
@superface
Source
Verified