取消运单
本接口应在后端服务器调用,详细说明参见后端API。
请求地址
POST https://api.weixin.qq.com/cgi-bin/express/business/order/cancel?access_token=ACCESS_TOKEN
请求数据示例
{
"order_id": "01234567890123456789",
"openid": "oABC123456",
"delivery_id": "SF",
"waybill_id": "123456789"
}
返回数据示例
{
"errcode": 0,
"errmsg": "ok"
}
获取支持的快递公司列表
本接口应在后端服务器调用,详细说明参见后端API。
请求地址
GET https://api.weixin.qq.com/cgi-bin/express/business/delivery/getall?access_token=ACCESS_TOKEN
返回数据示例
{
"count": 8,
"data": [
{
"delivery_id": "BEST",
"delivery_name": "百世快递"
},
{
"delivery_id": "EMS",
"delivery_name": "中国邮政速递物流"
},
{
"delivery_id": "OTP",
"delivery_name": "承诺达特快"
},
{
"delivery_id": "PJ",
"delivery_name": "品骏物流"
},
{
"delivery_id": "SF",
"delivery_name": "顺丰速运"
},
{
"delivery_id": "YTO",
"delivery_name": "圆通速递"
},
{
"delivery_id": "YUNDA",
"delivery_name": "韵达快递"
},
{
"delivery_id": "ZTO",
"delivery_name": "中通快递"
}
]
}
获取运单数据
本接口应在后端服务器调用,详细说明参见后端API。
请求地址
POST https://api.weixin.qq.com/cgi-bin/express/business/order/get?access_token=ACCESS_TOKEN
请求数据示例
{
"order_id": "01234567890123456789",
"openid": "oABC123456",
"delivery_id": "SF",
"waybill_id": "123456789"
}
返回数据示例
{
"print_html": "jh7DjipP4ul4CQYUh69cniskrQZuOPwa1inAbXIqKbU0t71c0s65Au54cdWBZW0QJY4LYeofdM",
"waybill_data": [
{
"key": "SF_bagAddr",
"value": "广州"
},
{
"key": "SF_mark",
"value": "101- 07-03 509"
}
]
}
查询运单轨迹
本接口应在后端服务器调用,详细说明参见后端API。
请求地址
POST https://api.weixin.qq.com/cgi-bin/express/business/path/get?access_token=ACCESS_TOKEN
请求数据示例
{
"order_id": "01234567890123456789",
"openid": "oABC123456",
"delivery_id": "SF",
"waybill_id": "123456789"
}
返回数据示例
{
"openid": "OPENID",
"delivery_id": "SF",
"waybill_id": "12345678901234567890",
"path_item_num": 3,
"path_item_list": [
{
"action_time": 1533052800,
"action_type": 100001,
"action_msg": "快递员已成功取件"
},
{
"action_time": 1533062800,
"action_type": 200001,
"action_msg": "快件已到达xxx集散中心,准备发往xxx"
},
{
"action_time": 1533072800,
"action_type": 300001,
"action_msg": "快递员已出发,联系电话xxxxxx"
}
]
}
获取打印员。若需要使用微信打单 PC 软件,才需要调用。
本接口应在后端服务器调用,详细说明参见后端API。
请求地址
GET https://api.weixin.qq.com/cgi-bin/express/business/printer/getall?access_token=ACCESS_TOKEN
返回数据示例
{
"count": 2,
"openid": ["oABC", "oXYZ"]
}
获取电子面单余额。仅在使用加盟类快递公司时,才可以调用。
本接口应在后端服务器调用,详细说明参见后端API。
请求地址
POST https://api.weixin.qq.com/cgi-bin/express/business/quota/get?access_token=ACCESS_TOKEN
请求数据示例
{
"delivery_id": "YTO",
"biz_id": "xyz"
}
返回数据示例
{
"delivery_id": "YTO",
"biz_id": "1234",
"quota_num": 210
}
本文档描述后端服务器接收的消息或事件,详细说明参见消息推送。
运单轨迹更新事件。当运单轨迹有更新时,会产生如下数据包。收到事件之后,回复success或者空串即可。
消息数据包示例
XML 格式
1546924844
3
3
1546924840
100001
1546924841
200001
1546924842
200001
JSON 格式
{
"ToUserName": "toUser",
"FromUserName": "fromUser",
"CreateTime": 1546924844,
"MsgType": "event",
"Event": "add_express_path",
"DeliveryID": "SF",
"WayBillId": "123456789",
"Version": 2,
"Count": 3,
"Actions": [
{
"ActionTime": 1546924840,
"ActionType": 100001,
"ActionMsg": "小哥A揽件成功"
},
{
"ActionTime": 1546924841,
"ActionType": 200001,
"ActionMsg": "到达广州集包地"
},
{
"ActionTime": 1546924842,
"ActionType": 200001,
"ActionMsg": "运往目的地"
}
]
}
生成运单
本接口应在后端服务器调用,详细说明参见后端API。
请求地址
POST https://api.weixin.qq.com/cgi-bin/express/business/order/add?access_token=ACCESS_TOKEN
请求数据示例
{
"order_id": "01234567890123456789",
"openid": "oABC123456",
"delivery_id": "SF",
"biz_id": "xyz",
"custom_remark": "易碎物品",
"sender": {
"name": "张三",
"tel": "18666666666",
"mobile": "020-88888888",
"company": "公司名",
"post_code": "123456",
"country": "中国",
"province": "广东省",
"city": "广州市",
"area": "海珠区",
"address": "XX路XX号XX大厦XX栋XX"
},
"receiver": {
"name": "王小蒙",
"tel": "18610000000",
"mobile": "020-77777777",
"company": "公司名",
"post_code": "654321",
"country": "中国",
"province": "广东省",
"city": "广州市",
"area": "天河区",
"address": "XX路XX号XX大厦XX栋XX"
},
"shop": {
"wxa_path": "/index/index?from=waybill&id=01234567890123456789",
"img_url": "https://mmbiz.qpic.cn/mmbiz_png/OiaFLUqewuIDNQnTiaCInIG8ibdosYHhQHPbXJUrqYSNIcBL60vo4LIjlcoNG1QPkeH5GWWEB41Ny895CokeAah8A/640",
"goods_name": "一千零一夜钻石包&爱马仕铂金包",
"goods_count": 2
},
"cargo": {
"count": 2,
"weight": 5.5,
"space_x": 30.5,
"space_y": 20,
"space_z": 20,
"detail_list": [
{
"name": "一千零一夜钻石包",
"count": 1
},
{
"name": "爱马仕铂金包",
"count": 1
}
]
},
"insured": {
"use_insured": 1,
"insured_value": 10000
},
"service": {
"service_type": 0,
"service_name": "标准快递"
}
}
返回数据示例
下单成功
{
"order_id": "01234567890123456789",
"waybill_id": "123456789",
"waybill_data": [
{
"key": "SF_bagAddr",
"value": "广州"
},
{
"key": "SF_mark",
"value": "101- 07-03 509"
}
]
}
下单失败
{
"errcode": 9300501,
"errmsg": "delivery logic fail",
"delivery_resultcode": 10002,
"delivery_resultmsg": "客户密码不正确"
}
更新打印员。若需要使用微信打单 PC 软件,才需要调用。
本接口应在后端服务器调用,详细说明参见后端API。
请求地址
POST https://api.weixin.qq.com/cgi-bin/express/business/printer/update?access_token=ACCESS_TOKEN
请求数据示例
{
"openid": "oJ4v0wRAfiXcnIbM3SgGEUkTw3Qw",
"update_type": "bind"
}
返回数据示例
{
"errcode": 0,
"errmsg": "ok"
}