Nello
Nello

Reputation: 1755

Easypost shipment tracking issue

I have been testing out the shipment tracking and I am getting info through my controller. However when I add a line of javascript code somewhere else the tracking always return unknown. I am not sure if the tracking is correct and unknown is always returned or something wrong with my code. I have the tracker id stored so I can always test it on easypost.

This is one of the details of the order that is unknown status.

{
  "id": "trk_884a31a503b745a7836c9fbed33212d5",
  "object": "Tracker",
  "mode": "test",
  "tracking_code": "9470136897846111103191",
  "status": "unknown",
  "status_detail": "unknown",
  "created_at": "2017-08-02T18:44:24Z",
  "updated_at": "2017-08-02T18:44:24Z",
  "signed_by": null,
  "weight": null,
  "est_delivery_date": null,
  "shipment_id": "shp_7bc893df86a94607b6d85a740a5ed3cb",
  "carrier": "USPS",
  "tracking_details": [],
  "fees": [],
  "carrier_detail": null,
  "public_url": "the url of the label"
}

This is some of my normal order status.

{
  "id": "trk_bbacef9dece94ced96e07a447021d9d9",
  "object": "Tracker",
  "mode": "test",
  "tracking_code": "9461236897846111100762",
  "status": "delivered",
  "status_detail": "arrived_at_destination",
  "created_at": "2017-08-02T18:43:39Z",
  "updated_at": "2017-08-02T18:46:39Z",
  "signed_by": "John Tester",
  "weight": null,
  "est_delivery_date": "2017-08-02T18:46:39Z",
  "shipment_id": "shp_c888e36c1c6b41418160d7d21bcd832a",
  "carrier": "USPS",
  "tracking_details": [
    {
      "object": "TrackingDetail",
      "message": "Pre-Shipment Info Sent to USPS",
      "status": "pre_transit",
      "status_detail": "status_update",
      "datetime": "2017-07-02T18:46:39Z",
      "source": "USPS",
      "carrier_code": null,
      "tracking_location": {
        "object": "TrackingLocation",
        "city": null,
        "state": null,
        "country": null,
        "zip": null
      }
    },
    {
      "object": "TrackingDetail",
      "message": "Shipping Label Created",
      "status": "pre_transit",
      "status_detail": "status_update",
      "datetime": "2017-07-03T07:23:39Z",
      "source": "USPS",
      "carrier_code": null,
      "tracking_location": {
        "object": "TrackingLocation",
        "city": "HOUSTON",
        "state": "TX",
        "country": null,
        "zip": "77063"
      }
    }
  ],
  "carrier_detail": {
    "object": "CarrierDetail",
    "service": "First-Class Package Service",
    "container_type": null,
    "est_delivery_date_local": null,
    "est_delivery_time_local": null,
    "origin_location": "HOUSTON TX, 77001",
    "origin_tracking_location": {
      "object": "TrackingLocation",
      "city": "NORTH HOUSTON",
      "state": "TX",
      "country": null,
      "zip": "77315"
    },
    "destination_location": "CHARLESTON SC, 29401",
    "destination_tracking_location": {
      "object": "TrackingLocation",
      "city": "CHARLESTON",
      "state": "SC",
      "country": null,
      "zip": "29407"
    },
    "guaranteed_delivery_date": null,
    "alternate_identifier": null,
    "initial_delivery_attempt": "2017-07-05T08:37:39Z"
  },
  "finalized": true,
  "is_return": false,
  "public_url": "label url",
  "fees": []
}

Upvotes: 0

Views: 1164

Answers (1)

KFunk
KFunk

Reputation: 3152

The USPS doesn't start tracking immediately, even if a tracking code is provided. Generally, you'll have to wait until the package enters the mailstream before you see any useful status/tracking_details.

In your case (at the time of this post), USPS doesn't have a status either: https://tools.usps.com/go/TrackConfirmAction?tLabels=9470136897846111103191

Upvotes: 1

Related Questions