# logistics.updatePath

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.

Updates the waybill trace.

Calling methods:

# HTTPS Call

# Request Address

POST https://api.weixin.qq.com/cgi-bin/express/delivery/path/update?access_token=ACCESS_TOKEN

# Request Parameters

Attribute Type Default Required Description
access_token string Yes Credentials to call API
token string Yes The Token field pushed in the Order Placement Event on the merchant side.
waybill_id string Yes The ID of the waybill.
action_time number Yes Unix timestamp of the trace change.
action_type number Yes The type of the trace change.
action_msg string Yes Detailed description of the trace change. It is displayed on the details page of the express delivery trace. If a mobile number is available, enter the 11-digit mobile number. Use the UTF-8 encoding scheme.

Valid values of action_type

Value Description Minimum Version
100001 Pick-up — Picked up successfully
100002 Pick-up — Pick-up failed
100003 Pick-up — Assigning the courier
200001 Transportation — Updating the transportation trace
300002 Delivery — Starting the delivery
300003 Delivery — Signed successfully
300004 Delivery — Signing failed
400001 Exception — Order canceled
400002 Exception — Order delayed

# Return Value

# Object

Property Type Description
errcode number Error code
errmsg string Error message

Valid values of errcode

Value Description Minimum Version
0 Succeeded
-1 System failure
40199 Incorrect waybill ID. The waybill is not found.
9300507 Incorrect token.

# Request Data Example

{
  "token": "TOKEN",
  "waybill_id": "12345678901234567890",
  "action_time": 1533052800,
  "action_type": 300002,
  "action_msg": "Denglijun [18666666666] is delivering your package"
}

# Return Data Example

{
  "errcode": 0,
  "errmsg": "ok"
}

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

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

# Request Parameters

Attribute Type Default Required Description
token string Yes The Token
field pushed in the Order Placement Event on the merchant side.
waybillId string Yes The ID of the waybill.
actionTime number Yes Unix timestamp of the trace change.
actionType number Yes The type of the trace change.
actionMsg string Yes Detailed description of the trace change. It is displayed on the details page of the express delivery trace. If a mobile number is available, enter the 11-digit mobile number. Use the UTF-8 encoding scheme.

Valid values of actionType

Value Description Minimum Version
100001 Pick-up — Picked up successfully
100002 Pick-up — Pick-up failed
100003 Pick-up — Assigning the courier
200001 Transportation — Updating the transportation trace
300002 Delivery — Starting the delivery
300003 Delivery — Signed successfully
300004 Delivery — Signing failed
400001 Exception — Order canceled
400002 Exception — Order delayed

# Return Value

# Object

Property Type Description
errCode number Error code
errMsg string Error message

Valid values of errCode

Value Description Minimum Version
0 Succeeded

# Exceptions

# Object

Thrown Exceptions

Property Type Description
errCode number Error code
errMsg string Error message

Valid values of errCode

Value Description Minimum Version
-1 System failure
40199 Incorrect waybill ID. The waybill is not found.
9300507 Incorrect token.

# Request Data Example

const cloud = require('wx-server-sdk')
  cloud.init()
  exports.main = async (event, context) => {
    try {
      const result = await cloud.openapi.logistics.updatePath({
        token: 'TOKEN',
        waybillId: '12345678901234567890',
        actionTime: 1533052800,
        actionType: 300002,
        actionMsg: 'Denglijun [18666666666] is delivering your package'
      })
      console.log(result)
      return result
    } catch (err) {
      console.log(err)
      return err
    }
  }

# Return Data Example

{
  "errCode": 0,
  "errMsg": "openapi.logistics.updatePath:ok"
}