Easypost 货件追踪问题

问题描述 投票:0回答:2

我一直在测试货运跟踪,并通过我的控制器获取信息。然而,当我在其他地方添加一行 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": []
}

easypost
2个回答
1
投票

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

status
/
tracking_details

就您而言(在撰写本文时),USPS 也没有状态:https://tools.usps.com/go/TrackConfirmAction?tLabels=9470136897846111103191


-1
投票

如果您在使用快件追踪系统时发现状态显示“未知”,这可能是由于以下原因之一造成的:

  • 确保您使用正确的跟踪代码。
  • 仔细检查添加的 JavaScript 代码,确保正确处理跟踪号码。
  • 快递公司可能尚未更新追踪信息。特别是在测试模式下,系统可能不会像真实环境中那样频繁更新。
  • 使用已知的有效追踪号码进行测试。这可以帮助确认 该问题是否普遍存在或仅与特定问题相关 追踪号码。
  • 使用浏览器的开发者工具查看网络请求并 应用程序发送的响应,这可以帮助识别 请求不正确。

如果问题仍然存在,请考虑更换API提供商或联系快递公司寻求更多帮助。

© www.soinside.com 2019 - 2024. All rights reserved.