# logistics.getAllDelivery

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 list of supported express companies.

Calling methods:

# HTTPS Call

# Request Address

GET https://api.weixin.qq.com/cgi-bin/express/business/delivery/getall?access_token=ACCESS_TOKEN

# Request Parameters

Attribute Type Default Required Description
access_token string Yes Credentials to call API

# Return Value

# Object

Property Type Description
count number The quantity of express companies.
data Array.<Object> The list of express company information.

data is composed as follows

Property Type Description
delivery_id string The ID of the express company
delivery_name string The name of the express company

# Return Data Example

{
  "count": 8,
  "data": [
    {
      "delivery_id": "BEST",
      "delivery_name": "Best Express"
    },
    {
      "delivery_id": "EMS",
      "delivery_name": "China Postal Express and Logistics"
    },
    {
      "delivery_id": "OTP",
      "delivery_name": "OTP Express"
    },
    {
      "delivery_id": "PJ",
      "delivery_name": "Pinjun Express"
    },
    {
      "delivery_id": "SF",
      "delivery_name": "SF Express"
    },
    {
      "delivery_id": "YTO",
      "delivery_name": "YTO Express"
    },
    {
      "delivery_id": "YUNDA",
      "delivery_name": "Yunda Express"
    },
    {
      "delivery_id": "ZTO",
      "delivery_name": "ZTO Express"
    }
  ]
}

# 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.getAllDelivery

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

# Return Value

# Object

Property Type Description
count number The quantity of express companies.
data Array.<Object> The list of express company information.

data is composed as follows

Property Type Description
deliveryId string The ID of the express company
deliveryName string The name of the express company

# Request Example

const cloud = require('wx-server-sdk')
  cloud.init()
  exports.main = async (event, context) => {
    try {
      const result = await cloud.openapi.logistics.getAllDelivery({})
      console.log(result)
      return result
    } catch (err) {
      console.log(err)
      return err
    }
  }

# Return Data Example

{
  "count": 8,
  "data": [
    {
      "deliveryId": "BEST",
      "deliveryName": "Best Express"
    },
    {
      "deliveryId": "EMS",
      "deliveryName": "China Postal Express and Logistics"
    },
    {
      "deliveryId": "OTP",
      "deliveryName": "OTP Express"
    },
    {
      "deliveryId": "PJ",
      "deliveryName": "Pinjun Express"
    },
    {
      "deliveryId": "SF",
      "deliveryName": "SF Express"
    },
    {
      "deliveryId": "YTO",
      "deliveryName": "YTO Express"
    },
    {
      "deliveryId": "YUNDA",
      "deliveryName": "Yunda Express"
    },
    {
      "deliveryId": "ZTO",
      "deliveryName": "ZTO Express"
    }
  ],
  "errMsg": "openapi.logistics.getAllDelivery:ok"
}