Easypost 货件追踪问题

Posted

技术标签:

【中文标题】Easypost 货件追踪问题【英文标题】:Easypost shipment tracking issue 【发布时间】:2017-08-02 18:55:06 【问题描述】:

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

【问题讨论】:

【参考方案1】:

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

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

【讨论】:

如果您在测试环境中进行测试,跟踪信息应该非常快。我的大部分测试就是这样进行的。我得到了所有结果,甚至在大约 5 分钟内交货 在测试环境中,您应该使用 EasyPost 提供的跟踪代码(例如:EZ4000000004)创建跟踪器,如下所述:easypost.com/docs/api#testing-specific-tracking-states

以上是关于Easypost 货件追踪问题的主要内容,如果未能解决你的问题,请参考以下文章

EasyPost USPS - 如何购买 Media Mail 货件?

Easypost webhook 发送大量“未知”状态

EasyPost:无法创建清单。指定货物中有 5 件已装单:

将Promise.all与easyPost API一起用于多个跟踪状态请求

应为字符串,但在第 1 行第 123 列路径 $.options 处为 BEGIN_OBJECT。在easypost发货中

如何使用 EasyPost 验证多个地址