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

WeChat small programs Small programs use getQuota


May 19, 2021 WeChat Mini Program Development Document


Table of contents


logistics.getQuota

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:

  • HTTPS call
  • Cloud calls

HTTPS call

The request address

POST https://api.weixin.qq.com/cgi-bin/express/business/quota/get?access_token=ACCESS_TOKEN

Request parameters

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

Returns a value

Object

Property Type Description
quota_num number The balance of the electronic face list

An example of requesting data

{
  "delivery_id": "YTO",
  "biz_id": "xyz"
}

Return an example of the data

{
  "quota_num": 210
}

Cloud calls

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.

The interface method

openapi.logistics.getQuota
Permissions for the logistics.getQuota API need to be configured in config.json, details

Request parameters

Property Type The default Required Description
deliveryId string Is Courier company ID, getAllDelivery
bizId string Is Courier company customer code

Returns a value

Object

Property Type Description
quotaNum number The balance of the electronic face list

An example of requesting data

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

Return an example of the data

{
  "quotaNum": 210,
  "errMsg": "openapi.logistics.getQuota:ok"
}