# 运单轨迹更新事件

本文档描述服务器端接收的消息或事件,详细说明参见消息推送

事件英文名:logistics.onPathUpdate

运单轨迹更新事件。当运单轨迹有更新时,会触发此事件并产生数据包。

# 1. 消息参数

# 请求体 Request Payload

参数名类型说明
ToUserNamestring小程序的原始ID
FromUserNamestring发送者的openid
CreateTimenumber消息创建时间(整型)
MsgTypestring固定 event
Eventstring固定 add_express_path
DeliveryIDstring快递公司ID
WayBillIdstring运单ID
OrderIdstring订单ID
Versionnumber轨迹版本号(整型)
Countnumber轨迹节点数(整型)
Actionsobjarray轨迹列表

# Body.Actions(Array) Object Payload

轨迹列表

参数名类型说明枚举
ActionTimenumber轨迹节点 Unix 时间戳-
ActionTypenumber轨迹节点类型枚举值
ActionMsgstring轨迹节点详情-

# 2. 消息返回

# 返回体 Response Payload

回复 success 或空字符串(无需加密)

# 3. 枚举信息

# Body.Actions(Array).ActionType Enum

轨迹节点类型

枚举值描述
100001揽件阶段-揽件成功
100002揽件阶段-揽件失败
100003揽件阶段-分配业务员
200001运输阶段-更新运输轨迹
300002派送阶段-开始派送
300003派送阶段-签收成功
300004派送阶段-签收失败
400001异常阶段-订单取消
400002异常阶段-订单滞留

# 4. 注意事项

本事件无特殊注意事项

# 5. 代码示例

# 5.1 XML 示例

请求示例

<xml>
  <ToUserName><![CDATA[toUser]]></ToUserName>
  <FromUserName><![CDATA[fromUser]]></FromUserName>
  <CreateTime>1546924844</CreateTime>
  <MsgType><![CDATA[event]]></MsgType>
  <Event><![CDATA[add_express_path]]></Event>
  <DeliveryID><![CDATA[SF]]></DeliveryID>
  <WayBillId><![CDATA[123456789]]></WayBillId>
  <OrderId><![CDATA[123456]]></OrderId>
  <Version>3</Version>
  <Count>3</Count>
  <Actions>
    <ActionTime>1546924840</ActionTime>
    <ActionType>100001</ActionType>
    <ActionMsg><![CDATA[小哥A揽件成功]]></ActionMsg>
  </Actions>
  <Actions>
    <ActionTime>1546924841</ActionTime>
    <ActionType>200001</ActionType>
    <ActionMsg><![CDATA[到达广州集包地]]></ActionMsg>
  </Actions>
  <Actions>
    <ActionTime>1546924842</ActionTime>
    <ActionType>200001</ActionType>
    <ActionMsg><![CDATA[运往目的地]]></ActionMsg>
  </Actions>
</xml>

返回示例

success

# 5.2 JSON 示例

请求示例

{
  "ToUserName": "toUser",
  "FromUserName": "fromUser",
  "CreateTime": 1546924844,
  "MsgType": "event",
  "Event": "add_express_path",
  "DeliveryID": "SF",
  "WayBillId": "123456789",
  "OrderId": "123456789",
  "Version": 2,
  "Count": 3,
  "Actions": [
    {
      "ActionTime": 1546924840,
      "ActionType": 100001,
      "ActionMsg": "小哥A揽件成功"
    },
    {
      "ActionTime": 1546924841,
      "ActionType": 200001,
      "ActionMsg": "到达广州集包地"
    },
    {
      "ActionTime": 1546924842,
      "ActionType": 200001,
      "ActionMsg": "运往目的地"
    }
  ]
}

返回示例

success