# logistics.getQuota

Call this API at the server side. For more information, see Server API.

This API supports Cloud Calls. The WeChat DevTools version must be 1.02.1904090 or later (download the latest stable version here), and the wx-server-sdk version must be 0.4.0 or later.

Obtains the balance of the electronic waybill. It is called only when a franchising express company provides the express delivery service.

Calling methods:

# HTTPS Call

# Request Address

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

# Request Parameters

Attribute Type Default Required Description
access_token string Yes Credentials to call API
delivery_id string Yes The ID of the express company. See getAllDelivery.
biz_id string Yes The customer code of the express company

# Return Value

# Object

Property Type Description
quota_num number The balance of the electronic waybill

# Request Data Example

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

# Return Data Example

{
  "quota_num": 210
}

# Cloud Call

Cloud call is a capability provided by Mini Program·Cloud Base that allows you to call WeChat APIs in a cloud function. It must be used via wx-server-sdk in the cloud function.

# API Calling Method

openapi.logistics.getQuota

You need to configure the permissions for the logistics.getQuota API via config.json. Details

# Request Parameters

Attribute Type Default Required Description
deliveryId string Yes The ID of the express company. See getAllDelivery.
bizId string Yes The customer code of the express company

# Return Value

# Object

Property Type Description
quotaNum number The balance of the electronic waybill

# Request Data Example

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'
      })
      console.log(result)
      return result
    } catch (err) {
      console.log(err)
      return err
    }
  }

# Return Data Example

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