0

我一直在测试货物跟踪,我正在通过我的控制器获取信息。但是,当我在其他地方添加一行 javascript 代码时,跟踪总是返回未知。我不确定跟踪是否正确并且总是返回未知数或我的代码有问题。我存储了跟踪器 ID,因此我可以随时在 easypost 上对其进行测试。

这是状态未知的订单的详细信息之一。

{
  "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"
}

这是我的一些正常订单状态。

{
  "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": []
}

4

1 回答 1

0

即使提供了跟踪代码,USPS 也不会立即开始跟踪。通常,您必须等到包裹进入邮件流才能看到任何有用的status/ tracking_details

在您的情况下(在本文发布时),USPS 也没有状态:https ://tools.usps.com/go/TrackConfirmAction?tLabels=9470136897846111103191

于 2017-08-02T19:11:19.053 回答