# Brief introduction of logistics message capability
Logistics message is a free logistics message notification interface provided by WeChat official for Mini Programs.
After access, you can use this interface to pass in the Mini Program order delivery information, WeChat background will track the status change of the waybill, in theItems solicited、In dispatch、SignedThese three key logistics nodes push the message notification to the user, and users can visit the merchant Mini Program through the message, improve the shopping experience.
Examples of application:
A Mini Program business for the United States self-run, need to mail to the user corresponding orders of goods. Before access to the message opening ability, the user often feedback after the order can not find the order information, not clear logistics statusAccess to the open ability of the message, the user in the Mini Program under the single, will receive WeChat under the express has been taken, sent, signed service notice, order information and logistics status at a glance.
Service notification/Landing page style:
# II. Access Requirements and Regulatory Penalties
Mini Programs that meet all of the following conditions can be applied for use
1, Mini Program has released on the line
2, the Mini Program has opened WeChat payment, and the number of transactions on the nearly 90 antenna is greater than 0
Frequency limitation
- Identity appid Up to 10w second/day
2, the same user is most called 50 times./day
3, the same user at the same time up to 100 binding Valid binding decision logic: The waybill number is in theLoading, transportation, delivery, to be signedState, is counted as a valid binding.
Supervision and penalties
1, only support the import of legal and compliant product pictures, product information, prohibit advertising/Pornographic/Politics, etc.
2, only support incoming Mini Program real order information, only to the actual order to send a message.
If you violate the regulation, WeChat official will be punished accordingly, including but not limited to reducing the interface call frequency, disable the interface ability and so on.
# III. Interface authentication
WeChat API interface default use access_Token for interface authentication. So you need to add the parameter access after all the API interface addresses_token。
For example:
The original call address is:https://api.weixin.qq.com/cgi-bin/test/api
Finally, the actual address of the call needs to add access_The token parameter, which is:https://api.weixin.qq.com/cgi-bin/test/api?access_Token = xxxxxx
Of which access_For the generation and management of tokens, seeBackground Interface Call Credential Dxplaination
# IV. Interface list
# 4.1. Interface for Waybill follow_waybill
- Description: Merchants use this interface to provide WeChat with a transaction number corresponding to the waybill number. The WeChat backstage will track the status change of the waybill and push a message to the ordering user at the key logistics node.
- Request method: POST application/json
- Address requested:https://api.weixin.qq.com/cgi-bin/express/delivery/open_msg/follow_waybill?access_token=XXX
- Request parameters
Parameter Name | type | Required | Remarks |
---|---|---|---|
openid | string | yes | User openid |
transmitter_phone | string | no | Sender's mobile phone number |
receiver_phone | string | yes | The recipient's mobile phone number, part of the capacity needs the user's phone number as the basis for checking |
waybill_id | string | yes | Waybill number |
goods_info | object | yes | Product information |
trans_id | string | yes | Transaction Number |
order_detail_path | string | no | Click the landing page product card jump path (recommended for order details page path), do not pass the default jump Mini Program home page. |
Among goods_Info is as follows:
Parameter Name | type | Required | Remarks |
---|---|---|---|
detail_list | array | yes | Product information |
Among goods_info.detail_Each item on the list reads as follows:
Parameter Name | type | Required | Remarks |
---|---|---|---|
goods_name | string | yes | Product name, up to 40 Chinese characters |
goods_img_url | string | yes | Product Image URL |
goods_desc | string | no | Description of product details, do not pass the default take "product name" value, up to 40 Chinese characters |
- Return parameters
Parameter Name | type | Required | Remarks |
---|---|---|---|
Errcode | number | yes | Return code |
errmsg | string | yes | Error message |
waybill_token | string | yes | Query id |
- Example
Request parameters
{
"openid":"ovtZW4yB7DIj3CxOb6ii-nk4HhFo",
"waybill_id":"WXTESTEXPRESS0000014",
"transmitter_phone":"12345678901" ,
"receiver_phone":"123456566" ,
"goods_info":{
"detail_list":[
{
"goods_Name ":" test name, "
"goods_img_url":"www.qq.com"
},
{
"goods_Name ":" Test Name 2, "
"goods_img_url":"www.qq.com"
}
]
}
}
Return parameters
{
"errcode": 0,
"errmsg": "ok",
"waybill_token": "the_ARWHaxIxzWHmdui-AIw9KBr8qNnbmc08V0KhDyXE-IMLo6AcOqJkPsNLcLzfTb"
}
# 4.2. Waybill interface query_follow_trace
- Description: the merchant calls in the end trace_Waybill interface, you can use this interface to query the details of the corresponding waybill
- Request method: POST application/json
- Address requested:https://api.weixin.qq.com/cgi-bin/express/delivery/open_msg/query_follow_trace?access_token=XXX
- Request parameters
Parameter Name | type | Required | Remarks |
---|---|---|---|
waybill_token | string | yes | Query id |
- Return parameters
Parameter Name | type | Required | Remarks |
---|---|---|---|
Errcode | number | yes | Return code |
errmsg | string | yes | Error message |
waybill_info | object | yes | Waybill information |
shop_info | object | no | Product information |
delivery_info | object | no | Capacity information |
Which waybill_The info is as follows:
Parameter Name | type | Required | Remarks |
---|---|---|---|
status | number | yes | Waybill status, seeWaybill Status |
waybill_id | string | yes | Waybill number |
Which shop_Info is as follows:
Parameter Name | type | Required | Remarks |
---|---|---|---|
goods_info | object | no | Product information |
Which shop_info.goods_Info is as follows:
Parameter Name | type | Required | Remarks |
---|---|---|---|
detail_list | array | yes | Product details |
Which shop_info.goods_info.detail_Each entry in the list is as follows
Parameter Name | type | Required | Remarks |
---|---|---|---|
goods_name | string | yes | Product Name |
goods_img_url | string | yes | Product Image URL |
Of which delivery_Info is as follows:
Parameter Name | type | Required | Remarks |
---|---|---|---|
delivery_id | string | yes | Transport Company id |
delivery_name | string | no | Name of Transport Company |
- Example
Request parameters
{
"waybill_token":"o_ARWHaxIxzWHmdui-AIw8SuE1QtaUZK8aUnZguAn1nsZ72ZjWlq8btV8j-wAc94",
"openid":"ovtZW4yB7DIj3CxOb6ii-nk4HhFo"
}
Return parameters
{
"errcode": 0,
"errmsg": "ok",
"waybill_info": {
"status": 0,
"waybill_id": "WXTESTEXPRESS0000014"
},
" shop_info": {
"goods_info": {
"detail_list": [
{
"goods_name": "Test name,"
"goods_img_url": "www.qq.com"
},
{
"goods_name": "Test Name 2,"
"goods_img_url": "www.qq.com"
}
]
}
}
}
# 4.3. Update Item Information Interface update_follow_waybill_goods
- Description: Update item information
- Request method: POST application/json
- Address requested:https://api.weixin.qq.com/cgi-bin/express/delivery/open_msg/update_follow_waybill_goods?access_token=XXX
- Request parameters
Parameter Name | type | Required | Remarks |
---|---|---|---|
waybill_token | string | yes | Query id |
goods_info | object | yes | Product information |
Among goods_Info is as follows:
Parameter Name | type | Required | Remarks |
---|---|---|---|
detail_list | array | yes | Product information |
Among goods_info.detail_Each item on the list reads as follows:
Parameter Name | type | Required | Remarks |
---|---|---|---|
goods_name | string | yes | Product Name |
goods_img_url | string | yes | Product Image URL |
- Return parameters
Parameter Name | type | Required | Remarks |
---|---|---|---|
Errcode | number | yes | Return code |
errmsg | string | yes | Error message |
- Example
Request parameters
{
"waybill_token":"o_ARWHaxIxzWHmdui-AIw8SuE1QtaUZK8aUnZguAn1nsZ72ZjWlq8btV8j-wAc94",
"openid":"ovtZW4yB7DIj3CxOb6ii-nk4HhFo",
"goods_info":{
"detail_list":[
{
"goods_Name ":" test update product " ,
"goods_img_url":"www.qq.com"
}
]
}
}
Return parameters
{
"errcode": 0,
"errmsg": "ok"
}
# Interface error code
Error code | Interpretation |
---|---|
-1 | System error |
9300560 | Maximum number of modifications reached |
40003 | Error in openid parameter |
9300534 | access_Token and openid parameters do not match |
9300513 | Maximum number of calls |
9300507 | waybill_Token parameter error |
9300559 | The waybill does not exist |
# VI. Status of Waybill
Waybill Status | Interpretation |
---|---|
0 | Waybill does not exist or is not collected |
1 | Items solicited |
2 | In transport |
3 | In dispatch |
4 | Signed |
5 | abnormal |
6 | Signature on behalf of |