Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

WeChat small programs Small programs use onPathUpdate


May 19, 2021 WeChat Mini Program Development Document



logistics.onPathUpdate

This document describes messages or events received on the server side, see Message Push for details.

The ticket track update event. W hen the ticket track is updated, the following packets are generated. Once you receive the event, reply to the success or empty string.

The message parameter

Object

Property Type Description
ToUserName string The original ID of the applet
FromUserName string The sender's openid
CreateTime number Message creation time (integer)
MsgType string Fixed event
Event string Fixed add_express_path
DeliveryID string Courier company ID
WayBillId string The ticket ID
OrderId string The order ID
Version number Track version number (integer)
Count number Number of track nodes (integer)
Actions Array.<Object> The list of tracks

The structure of Actions

Property Type Description
ActionTime number Track node Unix timestamp
ActionType number The type of track node
ActionMsg string Track node details

The legal value of ActionType

Value Description The lowest version
100001 Tout stage - Touting success
100002 Tout phase - Tout failed
100003 Tout phase - assign salesman
200001 Transport Phase - Update the transport track
300002 Delivery Phase - Start delivery
300003 Delivery Phase - Signed successfully
300004 Delivery phase - sign-off failed
400001 Abnormal Stage - Order Cancellation
400002 Abnormal phase - order stranded

An example of a message packet

XML format

<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>

JSON format

{
  "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": "运往目的地"
    }
  ]
}