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 the balance of the electronic bill of payment. You can call only when you are using a affiliate courier company.
How to call:
POST https://api.weixin.qq.com/cgi-bin/express/business/quota/get?access_token=ACCESS_TOKEN
Property | Type | The default | Required | Description |
---|---|---|---|---|
access_token | string | Is | The interface calls the credentials | |
delivery_id | string | Is |
Courier company ID,
getAllDelivery
|
|
biz_id | string | Is | Courier company customer code |
Property | Type | Description |
---|---|---|
quota_num | number | The balance of the electronic face list |
{
"delivery_id": "YTO",
"biz_id": "xyz"
}
{
"quota_num": 210
}
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.getQuota
Permissions for the logistics.getQuota API need to be configured in config.json, details
Property | Type | The default | Required | Description |
---|---|---|---|---|
deliveryId | string | Is |
Courier company ID,
getAllDelivery
|
|
bizId | string | Is | Courier company customer code |
Property | Type | Description |
---|---|---|
quotaNum | number | The balance of the electronic face list |
const cloud = require('wx-server-sdk')
cloud.init()
exports.main = async (event, context) => {
try {
const result = await cloud.openapi.logistics.getQuota({
deliveryId: 'YTO',
bizId: 'xyz'
})
return result
} catch (err) {
return err
}
}
{
"quotaNum": 210,
"errMsg": "openapi.logistics.getQuota:ok"
}