May 19, 2021 WeChat Mini Program Development Document
This interface should be called on the server side, as detailed in the Service Side API.
This interface supports cloud calls. Developer tool version required . . . 1.02.1904090 (latest stable download)
wx-server-sdk >= 0.4.0
Get all bound logistics accounts
How to call:
GET https://api.weixin.qq.com/cgi-bin/express/business/account/getall?access_token=ACCESS_TOKEN
Property | Type | The default | Required | Description |
---|---|---|---|---|
access_token | string | Is | The interface calls the credentials |
Property | Type | Description |
---|---|---|
errcode | number | Error code |
errmsg | number | The error message |
count | number | Number of accounts |
list | Array.<Object> | The list of accounts |
The legal value of errcode
Value | Description | The lowest version |
---|---|---|
0 | Success | |
-1 | The system failed |
The structure of the list
Property | Type | Description |
---|---|---|
biz_id | string | Courier company customer code |
delivery_id | string | Courier company ID |
create_time | number | Account binding time |
update_time | number | Account update time |
status_code | number | The binding state |
alias | string | Account alias |
remark_wrong_msg | string | Error message for account binding failure (EMS audit results) |
remark_content | string | Notes when account binding (submitted for EMS review required) |
quota_num | number | The balance of the electronic face list |
quota_update_time | number | Electronic bill balance update time |
service_type | Array.<Object> | The type of service supported by the binding account |
list.status_code legal value of the data
Value | Description | The lowest version |
---|---|---|
0 | The binding was successful | |
1 | under review | |
2 | Binding failed | |
3 | Tied |
List.service_type structure
Property | Type | Description |
---|---|---|
service_type | number | Service type ID |
service_name | string | The name of the service type |
{
"count": 1,
"list": [
{
"biz_id": "123456789",
"delivery_id": "YUNDA",
"create_time": 1555482786,
"update_time": 1556594799,
"status_code": 0,
"alias": "",
"remark_wrong_msg": "",
"remark_content": "",
"quota_num": 55,
"quota_update_time": 1556594799
}
]
}
Cloud call is the ability provided by the small program Cloud Development to call WeChat open interfaces in cloud functions and need to be used in cloud functions via wx-server-sdk.
openapi.logistics.getAllAccount
Permissions for the logistics.getAllAccount API need to be configured in config.json, details
Property | Type | Description |
---|---|---|
errCode | number | Error code |
errMsg | number | The error message |
count | number | Number of accounts |
list | Array.<Object> | The list of accounts |
The legal value of errCode
Value | Description | The lowest version |
---|---|---|
0 | Success |
The structure of the list
Property | Type | Description |
---|---|---|
bizId | string | Courier company customer code |
deliveryId | string | Courier company ID |
createTime | number | Account binding time |
updateTime | number | Account update time |
statusCode | number | The binding state |
alias | string | Account alias |
remarkWrongMsg | string | Error message for account binding failure (EMS audit results) |
remarkContent | string | Notes when account binding (submitted for EMS review required) |
quotaNum | number | The balance of the electronic face list |
quotaUpdateTime | number | Electronic bill balance update time |
serviceType | Array.<Object> | The type of service supported by the binding account |
The legal value of list.statusCode
Value | Description | The lowest version |
---|---|---|
0 | The binding was successful | |
1 | Under review | |
2 | The binding failed | |
3 | Untied |
The structure of list.serviceType
Property | Type | Description |
---|---|---|
serviceType | number | Service type ID |
serviceName | string | The name of the service type |
The exception thrown
Property | Type | Description |
---|---|---|
errCode | number | Error code |
errMsg | number | The error message |
The legal value of errCode
Value | Description | The lowest version |
---|---|---|
-1 | The system failed |
const cloud = require('wx-server-sdk')
cloud.init()
exports.main = async (event, context) => {
try {
const result = await cloud.openapi.logistics.getAllAccount({})
return result
} catch (err) {
return err
}
}
{
"count": 1,
"list": [
{
"alias": "",
"bizId": "123456789",
"deliveryId": "YUNDA",
"createTime": 1555482786,
"updateTime": 1556594799,
"statusCode": 0,
"remarkWrongMsg": "",
"remarkContent": "",
"quotaNum": 55,
"quotaUpdateTime": 1556594799
}
],
"errMsg": "openapi.logistics.getAllAccount:ok"
}