# Weixin Mini Program Delivery Letter Management Service

According to the [Merchant-Owned Weixin Mini Program operating specification]]](https://developers.weixin.qq.com/miniprogram/product/jiaoyilei/yunyingguifan.html#%E5%95%86%E5%AE%B6%E8%87%AA%E8%90%A5%E7%B1%BB%E5%B0%8F%E7%A8%8B%E5%BA%8F%E8%BF%90%E8%90%A5%E8%A7%84%E8%8C%83) , certain types of Mini Programs need to complete the shipping information entry and confirmation process on the platform before they can settle funds.

Developers can use this access service to complete the item shipping information entry, remind users to confirm receipt, and call the confirmation receipt component in Weixin Mini Program to improve the efficiency of shipping information entry and optimize the user experience.

# Shipping Receipt Management Service API Capabilities:

I. Entry of shipping information into the interface

II. Entry of shipping information contracts into the interface

III. Checking the status of the order shipment

IV. Query Order List

V. Confirming the shipping reminder interface

VI. Message Jump Path Settings Interface

VII. Inquire whether Weixin Mini Program has opened delivery letter management services

VIII. Inquire whether Weixin Mini Program has completed the transaction settlement management confirmation

IX. Relevant Messaging

X. Special shipment notification

# Confirmation of receipt within Weixin Mini Program

Weixin Mini Program Confirmation of receiving component access instructions

# I. Entry of shipping information into the interface

After a user makes a transaction, the default funds will be frozen, and after a developer makes their shipment, they need to enter the shipment information on the Weixin Mini Program platform, which will push the shipment info as a message to the purchased WeChat user.

If you have entered shipping information, you can modify the shipping information through this interface when the user has not confirmed the receipt, but a payment order can only update the shipping information once, so be cautious.

If you have not completed the relevant API docking development work, you can also login Weixin Mini Program background, through the delivery of the message management page manually input shipping information.

# Note

  1. Depending on the type of order number specified, different parameters are used to upload logistics information to the specified order:

    (1). In the form of merchant side order number (enumeration value 1), an order is determined by the merchant side number where the order is placed and the merchantside order number

    (2). WeChat Payment form (enumeration value 2), confirm an order through Weixin Pay single number

  2. Shipping mode is selected based on specific shipping conditions:

    (1). Unified shipment (enumeration value 1). A single order is shipped unified, with only one logistics number.

    (2). Separate shipment (enumeration value 2). A single order is separated and includes multiple logistics order numbers.

  3. WuLu code, see to get the list of delivery ids get_delivery_list .

  4. Upload time, used to identify the order of the request, if you want to update the logistics information, upload time must be updated than the previous request, please fill in the RFC 3339 format.

  5. Split shipping is only supported using logistics courier, and a payment order can be split into up to 10 parcels.

  6. The following cases will be considered re-shipment and there is only one re-shipement opportunity per payment.

    (1). Call the API again on the payment slip that has completed the shipment.

    (2). Use the API to modify the shipping mode or logistics mode.

# How to call

# HTTPS calls

POST https://api.weixin.qq.com/wxa/sec/order/upload_shipping_info?access_token=ACCESS_TOKEN

# Third party invocation

  • The invocation method and entry and exit parameters are the same as HTTPS, only the calling token is different

  • This interface belongs to a permission set id: 142

  • Once authorized by one of the permission sets, a service provider can make a call on behalf of the merchant using authorizer_access_token

# Request parameters

attribute type Required to fill in Introductions
access_token string yes The interface invokes a credential that is a URL parameter, not a Body parameter.Use getAccessToken or authorizer_access_token
order_key object yes Orders, orders that need to upload logistics information
attribute type Required to fill in Introductions
order_number_type number yes Order number type, used to confirm orders that require the upload of details. The enumeration value 1 uses the next order merchant number and the merchant side order number;Enumeration value 2, using WeChat payment order number.
transaction_id string no The WeChat order number corresponding to the original payment transaction
mchid string no The merchant number of the payment order merchant is generated and issued by WeChat payment.
out_trade_no string no `_- *`and unique under the same merchant
 <i class="toggle-children-table"></i> logistics_type
    number

yes Logistics mode, shipping method enumerate value: 1. Physical logistics distribution uses courier companies to carry out physical logistics distribution form 2. Same-town distribution 3. Virtual goods, virtual goods, such as call up, card counting, etc., no physical distribution form 4. User self-pickup delivery_mode number yes Delivery mode, delivery mode enumeration value: 1, UNIFIED_DELIVERY (unified delivery) 2, SPLIT_DELIVERY (split delivery) Example value: UNIFIED_DELIVERY

 <i class="toggle-children-table"></i> is_all_delivered
    boolean

no It is necessary to fill in the split shipping mode to identify whether all shipments have been completed under the split shipping model, and only if all shipments are completed will the shipment completion notification be pushed to the user. Example value: true / false

 <i class="toggle-children-table"></i> shipping_list
    array<object>

yes Logistics information list, shipping logistics list, supports two modes of unified shipping (single logistics list) and split shipping (multiple logistics list). Multipleness: [1, 10]

 <i class="toggle-children-table"></i> <table class="have-children-table"> 
             <thead> 
                 <tr> 
                    <th></th>
                    <th>attribute</th>
                    <th>type</th>
                    <th>Required to fill in</th>
                    <th>Introductions</th>
                 </tr>  </thead>  </table> 
            
             <i class="toggle-children-table"></i> tracking_no
                    string
                    否
                    物流单号,物流快递发货时必填,示例值: 323244567777 字符字节限制: [1, 128] <i class="toggle-children-table"></i> express_company
                    string
                    否
                    物流公司编码,快递公司ID,参见 <a href="https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/express/business/express_search.html#%E8%8E%B7%E5%8F%96%E8%BF%90%E5%8A%9Bid%E5%88%97%E8%A1%A8get-delivery-list">「获取运力 id 列表get_delivery_list」</a> ,物流快递发货时必填,
                        示例值: DHL
                        字符字节限制: [1, 128] <i class="toggle-children-table"></i> item_desc
                    string
                    是
                    商品信息,例如:微信红包抱枕*1个,限120个字以内 <i class="toggle-children-table"></i> contact
                    object
                    否
                    联系方式,当发货的物流公司为顺丰时,联系方式为必填,收件人或寄件人联系方式二选一 <i class="toggle-children-table"></i> <table class="have-children-table"> 
                             <thead> 
                                 <tr> 
                                    <th></th>
                                    <th>attribute</th>
                                    <th>type</th>
                                    <th>Required to fill in</th>
                                    <th>Introductions</th>
                                 </tr> 
                             </thead> 
                             <tbody> 
                                 <tr> 
                                    <td> <i class="toggle-children-table"></i> </td>
                                    <td>consignor_contact</td>
                                    <td>string</td>
                                    <td>no</td>
                                    <td>The sender's contact information, the sender''s contact details, is transmitted with a mask, the last 4 digits cannot be masked

Example values:189****1234, 021-****1234,****1234, 0 **2-***1234, 0** 2-******23-10, **** 123-8008Value limit: 0 ≤ value ≤ 1024

receiver_contact string no Recipient contact information. Recipient contact details are transmitted using a mask and the last 4 digits cannot be masked Example values:189****1234, 021-****1234,****1234, 0 **2-***1234, 0** 2-******23-10, **** 123-8008Value limit: 0 ≤ value ≤ 1024

 <i class="toggle-children-table"></i> upload_time
    string

yes Upload time, used to identify the order of requests Example value:2022-12-15T13: 29: 35.120 + 08: 00 payer object yes Payers, Payer Information

 <i class="toggle-children-table"></i> <table class="have-children-table"> 
             <thead> 
                 <tr> 
                    <th></th>
                    <th>attribute</th>
                    <th>type</th>
                    <th>Required to fill in</th>
                    <th>Introductions</th>
                 </tr>  </thead>  </table> 
            
             <i class="toggle-children-table"></i> openid
                    string

yes User ID, the user's unique identity under Weixin Mini Program AppID.Get the user's Openid before placing an order Example value: oUpF8uMuAJO_M2pxb1Q9zNjWeS6o Character byte limit: [1, 128]

# Return Parameters

attribute type Introductions
errcode number Error code
errmsg string Reasons for the Error

# Example call

# Example of request data

{
    "order_key": {
        "order_number_type": 2,
        "transaction_id": "fake-transid-20221214190427-1"
    },
    "delivery_mode": 1,
    "logistics_type": 1,
    "shipping_list": [
        {
            "tracking_no": "fake-trackingno-2022121419042711",
            "express_company": "STO",
            "item_desc": "微信气泡狗集线器*1",
            "contact": {
                "consignor_contact": "+86-177****1234"
            }
        }
    ],
    "upload_time": "2022-12-15T13:29:35.120+08:00",
    "payer": {
        "openid": "ogqztkPsejM9MQAFfwCQSCi4oNg3"
    }
}

# Return data example

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

# Error code

Error code Error code values Solutions
-1 system error The system is busy, so the developer is asked to try again in a few minutes.
10060001 The payment slip does not exist. Please check WeChat The transaction_id field in the form of payment order number or the mchid, out_trade_no fields in the form of merchant order number.
10060002 The payment order has been shipped and cannot be continued Please check the shipping status of the payment order
10060003 The payment order has been used for a re-shipment opportunity Invoking the API when the payment sheet is in the shipped state is considered as re-shipping, and only once can be re-shipped, please check the status of the payment sheet shipment
10060004 The payment order is in non-shipable condition Please check the status of the payment slip
10060005 The type of logistics was incorrect. Fill this field according to the logistics type enumeration in the document
10060006 Shipments are not allowed to be split when not delivered by courier. Discrete shipments are not allowed when non-express shipping, please check the request parameters
10060007 The is_all_delivered field must be filled in in split delivery mode Please check the is_all_delivered field in the request parameter
10060008 Item_desc field cannot be empty The item description field cannot be empty when the shipment information is entered in the scene
10060009 The item_desc field is too long Please check the product description field
10060012 A system error The system is busy, so the developer is asked to try again in a few minutes.
10060014 Parameter Error Describe the modification parameter based on the cause of the error
10060019 A system error The system is busy, so the developer is asked to try again in a few minutes.
10060020 This payment note does not allow for the completion of the shipment without any description of the goods Please add a description item_desc
10060023 Shipping information has not been updated Payment slip information remains unchanged
10060024 The list of logistics information is too long The length of the payment order logistics information list must not be greater than 10
10060025 Logistics companies code too long Please check the logistics company's coding for errors
10060026 The logistics number is too long. Please check the shipping number for errors
10060031 The payout does not belong to the user specified by openid Please check whether the payment slip number or openid is wrong
268485216 The upload time is illegal, please fill in RFC 3339 format Upload time must meet RFC 3339 format, such as 2022-12-15 T13: 29: 35.120 + 08: 00
268485224 The shipping pattern is illegal. Set this field according to the shipping mode enumeration in the document
268485195 WeChat The transaction_id field cannot be empty in the form of payment order number WeChat The transaction_id field must be set in the form of payment order number
268485196 The mchid field cannot be empty under the merchant side single number form The mchid field must be set under the merchant side single number form
268485197 The out_trade_no field cannot be empty in the form of merchant side single number The out_trade_no field must be set under the merchant side single number form
268485194 The type of order number is illegal. Fill this field according to the type of order number in the document
268485228 Under the unified shipping mode, the length of the logistics information list must be 1 Under the unified shipping mode, the length of the logistics information list must be 1
268485226 The logistics number cannot be empty The logistics number must be filled when a logistics courier is shipped
268485227 Logistics company codes cannot be blank When a logistics courier is shipped, the logistics company's code must be filled in

# II. Entry of shipping information contracts into the interface

After a user makes a transaction, the default funds will be frozen, and after a developer makes their shipment, they need to enter the shipment information on the Weixin Mini Program platform, which will push the shipment info as a message to the purchased WeChat user.

If you have entered shipping information, you can modify the shipping information through this interface when the user has not confirmed the receipt, but a payment order can only update the shipping information once, so be cautious.

If you have not completed the relevant API docking development work, you can also log in the background of Weixin Mini Program and manually enter the shipping information through the shipping information entry page.

# Note

  1. Depending on the specified order number type, use different parameters to upload logistics information to the specified Order. Note that the order number type of the sub-order and main order must be consistent:

    (1). In the form of merchant side order number (enumeration value 1), an order is determined by the merchant side number where the order is placed and the merchantside order number

    (2). WeChat Payment form (enumeration value 2), confirm an order through Weixin Pay single number

  2. Shipping mode is selected based on specific shipping conditions:

    (1). Unified shipment (enumeration value 1). A single order is shipped unified, with only one logistics number.

    (2). Separate shipment (enumeration value 2). A single order is separated and includes multiple logistics order numbers.

  3. WuLu code, see to get the list of delivery ids get_delivery_list .

  4. Upload time, used to identify the order of the request, if you want to update the logistics information, upload time must be updated than the previous request, please fill in the RFC 3339 format.

  5. Split shipping is only supported using logistics courier, and a payment order can be split into up to 10 parcels.

  6. The following cases will be considered re-shipment and there is only one re-shipement opportunity per payment. (1). Call the API again on the payment slip that has completed the shipment.

    (2). Use the API to modify the shipping mode or logistics mode.

# How to call

# HTTPS calls

POST https://api.weixin.qq.com/wxa/sec/order/upload_combined_shipping_info?access_token=ACCESS_TOKEN

# Third party invocation

  • The invocation method and entry and exit parameters are the same as HTTPS, only the calling token is different

  • This interface belongs to a permission set id: 142

  • Once authorized by one of the permission sets, a service provider can make a call on behalf of the merchant using authorizer_access_token

# Request parameters

attribute type Required to fill in Introductions
access_token string yes The interface invokes a credential that is a URL parameter, not a Body parameter.Using getAccessToken Or authorizer_access_token
order_key object yes Consolidated orders, those that need to upload logistics details, choose one based on the type of order
attribute type Required to fill in Introductions
order_number_type number yes Order number type, used to confirm orders that require the upload of details. The enumeration value 1 uses the next order merchant number and the merchant side order number;Enumeration value 2, using WeChat payment order number.
transaction_id string no The WeChat order number corresponding to the original payment transaction
mchid string no The first class merchant number of the payment merchant, generated and issued by WeChat payment.
out_trade_no string no `_- *`and unique under the same merchant
 <i class="toggle-children-table"></i> sub_orders
    array<object>

no Sub-List Logistics Details

 <i class="toggle-children-table"></i> <table class="have-children-table"> 
             <thead> 
                 <tr> 
                    <th></th>
                    <th>attribute</th>
                    <th>type</th>
                    <th>Required to fill in</th>
                    <th>Introductions</th>
                 </tr>  </thead>  </table> 
            
             <i class="toggle-children-table"></i> order_key
                    object
                    是
                    需要上传物流详情的子单订单,订单类型与合单订单保持一致 <i class="toggle-children-table"></i> <table class="have-children-table"> 
                             <thead> 
                                 <tr> 
                                    <th></th>
                                    <th>attribute</th>
                                    <th>type</th>
                                    <th>Required to fill in</th>
                                    <th>Introductions</th>
                                 </tr> 
                             </thead> 
                             <tbody> 
                                 <tr> 
                                    <td> <i class="toggle-children-table"></i> </td>
                                    <td>order_number_type</td>
                                    <td>number</td>
                                    <td>yes</td>
                                    <td>Order number type, used to confirm orders that require the upload of details</td>
                                 </tr> 
                                 <tr> 
                                    <td> <i class="toggle-children-table"></i> </td>
                                    <td>transaction_id</td>
                                    <td>string</td>
                                    <td>no</td>
                                    <td>The WeChat order number corresponding to the original payment transaction</td>
                                 </tr> 
                                 <tr> 
                                    <td> <i class="toggle-children-table"></i> </td>
                                    <td>mchid</td>
                                    <td>string</td>
                                    <td>no</td>
                                    <td>The merchant number of the payment order merchant is generated and issued by WeChat payment.</td>
                                 </tr> 
                                 <tr> 
                                    <td> <i class="toggle-children-table"></i> </td>
                                    <td>out_trade_no</td>
                                    <td>string</td>
                                    <td>no</td>
                                    <td>`_- *`and unique under the same merchant</td>
                                 </tr> 
                             </tbody>  </table> 
                        
                    
                
                 <i class="toggle-children-table"></i> 
                logistics_type
                number
                yes
                Logistics mode, shipping method enumerate value: 1. Physical logistics distribution uses courier companies to carry out physical logistics distribution form 2. Same-town distribution 3. Virtual goods, virtual goods, such as call up, card counting, etc., no physical distribution form 4. User self-pickup
                 <i class="toggle-children-table"></i> delivery_mode
                    number

yes Delivery mode, delivery mode enumeration value: 1, UNIFIED_DELIVERY (unified delivery) 2, SPLIT_DELIVERY (split delivery) Example value: UNIFIED_DELIVERY

                 <i class="toggle-children-table"></i> is_all_delivered
                    boolean

no It is necessary to fill in the split shipping mode to identify whether all shipments have been completed under the split shipping model, and only if all shipments are completed will the shipment completion notification be pushed to the user. Example value: true / false

                 <i class="toggle-children-table"></i> shipping_list
                    array<object>

no List of Sub-List Logistical Information Multipleness: [1, 10]

                 <i class="toggle-children-table"></i> <table class="have-children-table"> 
                             <thead> 
                                 <tr> 
                                    <th></th>
                                    <th>attribute</th>
                                    <th>type</th>
                                    <th>Required to fill in</th>
                                    <th>Introductions</th>
                                 </tr>  </thead>  </table> 
                            
                             <i class="toggle-children-table"></i> tracking_no
                                    string
                                    否
                                    物流单号,物流快递发货时必填,示例值: 323244567777
                                        字符字节限制: [1, 128] <i class="toggle-children-table"></i> express_company
                                    string
                                    否
                                    物流公司编码,快递公司ID,参见 <a href="https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/express/business/express_search.html#%E8%8E%B7%E5%8F%96%E8%BF%90%E5%8A%9Bid%E5%88%97%E8%A1%A8get-delivery-list">「获取运力 id 列表get_delivery_list」</a> ,物流快递发货时必填,示例值: DHL
                                        字符字节限制: [1, 128] <i class="toggle-children-table"></i> item_desc
                                    string
                                    是
                                    商品信息,例如:微信红包抱枕*1个,限120个字以内 <i class="toggle-children-table"></i> contact
                                    object
                                    否
                                    联系方式,当发货的物流公司为顺丰时,联系方式为必填,收件人或寄件人联系方式二选一 <i class="toggle-children-table"></i> <table class="have-children-table"> 
                                             <thead> 
                                                 <tr> 
                                                    <th></th>
                                                    <th>attribute</th>
                                                    <th>type</th>
                                                    <th>Required to fill in</th>
                                                    <th>Introductions</th>
                                                 </tr> 
                                             </thead> 
                                             <tbody> 
                                                 <tr> 
                                                    <td> <i class="toggle-children-table"></i> </td>
                                                    <td>consignor_contact</td>
                                                    <td>string</td>
                                                    <td>no</td>
                                                    <td>The sender's contact information, the sender''s contact details, is transmitted with a mask, the last 4 digits cannot be masked

Example values:189****1234, 021-****1234,****1234, 0**2-***1234, 0 **2-******23-10,** **123-8008Value limit: 0 ≤ value ≤ 1024

receiver_contact string no Recipient contact information. Recipient contact details are transmitted using a mask and the last 4 digits cannot be masked Example values:189****1234, 021-****1234,****1234, 0**2-***1234, 0 **2-******23-10,** **123-8008Value limit: 0 ≤ value ≤ 1024

 <i class="toggle-children-table"></i> upload_time
    string

yes Upload time, used to identify the order of requests Example value:2022-12-15T13: 29: 35.120 + 08: 00 payer object yes Payers, Payer Information

 <i class="toggle-children-table"></i> <table class="have-children-table"> 
             <thead> 
                 <tr> 
                    <th></th>
                    <th>attribute</th>
                    <th>type</th>
                    <th>Required to fill in</th>
                    <th>Introductions</th>
                 </tr>  </thead>  </table> 
            
             <i class="toggle-children-table"></i> openid
                    string

yes User ID, the unique identity of the user under Merchant AppID.Get the user's Openid before placing an order Example value: oUpF8uMuAJO_M2pxb1Q9zNjWeS6o Character byte limit: [1, 128]

# Return Parameters

attribute type Introductions
errcode number Error code
errmsg string Reasons for the Error

# Example call

# Example of request data

{
    "order_key": {
        "order_number_type": 1,
        "mchid": "fake-mchid-123",
        "out_trade_no": "fake-tradeno-20221214190427-0"
    },
    "sub_orders": [
        {
            "order_key": {
                "order_number_type": 1,
                "mchid": "fake-mchid-123",
                "out_trade_no": "fake-tradeno-20221214190427-01"
            },
            "delivery_mode": 2,
            "logistics_type": 1,
            "is_all_delivered": true,
            "shipping_list": [
                {
                    "tracking_no": "fake-trackingno-202212141904271",
                    "express_company": "YD",
                    "item_desc": "微信气泡狗零钱包*1",
                    "contact": {
                        "consignor_contact": "021-**34-12"
                    }
                },
                {
                    "tracking_no": "fake-trackingno-202212141904272",
                    "express_company": "DHL",
                    "item_desc": "微信黄脸布艺胸针*1;微信气泡狗零钱包*1",
                    "contact": {
                        "consignor_contact": "021-**34-12"
                    }
                }
            ]
        },
        {
            "order_key": {
                "order_number_type": 1,
                "mchid": "fake-mchid-321",
                "out_trade_no": "fake-tradeno-20221214190427-02"
            },
            "delivery_mode": 1,
            "logistics_type": 1,
            "shipping_list": [
                {
                    "tracking_no": "fake-trackingno-202212141904273",
                    "express_company": "YTO",
                    "item_desc": "微信气泡狗双面钥匙扣*1",
                    "contact": {
                        "receiver_contact": "+86-123****4321"
                    }
                }
            ]
        }
    ],
    "upload_time": "2022-12-15T13:29:35.120+08:00",
    "payer": {
        "openid": "ogqztkPsejM9MQAFfwCQSCi4oNg3"
    }
}

# Return data example

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

# Error code

Error code Error code values Solutions
-1 system error The system is busy, so the developer is asked to try again in a few minutes.
10060001 The payment slip does not exist. Please check WeChat The transaction_id field in the form of payment order number or the mchid, out_trade_no fields in the form of merchant order number.
10060002 The payment order has been shipped and cannot be continued Please check the shipping status of the payment order
10060003 The payment order has been used for a re-shipment opportunity Invoking the API when the payment sheet is in the shipped state is considered as re-shipping, and only once can be re-shipped, please check the status of the payment sheet shipment
10060004 The payment order is in non-shipable condition Please check the status of the payment slip
10060005 The type of logistics was incorrect. Fill this field according to the logistics type enumeration in the document
10060006 Shipments are not allowed to be split when not delivered by courier. Discrete shipments are not allowed when non-express shipping, please check the request parameters
10060007 The is_all_delivered field must be filled in in split delivery mode Please check the is_all_delivered field in the request parameter
10060008 Item_desc field cannot be empty The item description field cannot be empty when the shipment information is entered in the scene
10060009 The item_desc field is too long Please check the product description field
10060012 A system error The system is busy, so the developer is asked to try again in a few minutes.
10060013 Sub-List Single Number Repeat The sub_orders list cannot contain duplicates. Check
10060014 Parameter Error Describe the modification parameter based on the cause of the error
10060019 A system error The system is busy, so the developer is asked to try again in a few minutes.
10060020 This payment note does not allow for the completion of the shipment without any description of the goods Please add a description item_desc
10060023 Shipping information has not been updated Payment slip information remains unchanged
10060024 The list of logistics information is too long The length of the payment order logistics information list must not be greater than 10
10060025 Logistics companies code too long Please check the logistics company's coding for errors
10060026 The logistics number is too long. Please check the shipping number for errors
10060031 The payout does not belong to the user specified by openid Please check whether the payment slip number or openid is wrong
268485216 The upload time is illegal, please fill in RFC 3339 format Upload time must meet RFC 3339 format, such as 2022-12-15 T13: 29: 35.120 + 08: 00
268485224 The shipping pattern is illegal. Set this field according to the shipping mode enumeration in the document
268485253 The order number type of the main order is inconsistent with the number type of sub-order The order number type of the main order must be the same as the number type of sub-order
268485195 WeChat The transaction_id field cannot be empty in the form of payment order number WeChat The transaction_id field must be set in the form of payment order number
268485196 The mchid field cannot be empty under the merchant side single number form The mchid field must be set under the merchant side single number form
268485197 The out_trade_no field cannot be empty in the form of merchant side single number The out_trade_no field must be set under the merchant side single number form
268485194 The type of order number is illegal. Fill this field according to the type of order number in the document
268485228 Under the unified shipping mode, the length of the logistics information list must be 1 Under the unified shipping mode, the length of the logistics information list must be 1
268485226 The logistics number cannot be empty The logistics number must be filled when a logistics courier is shipped
268485227 Logistics company codes cannot be blank When a logistics courier is shipped, the logistics company's code must be filled in

# III. Checking the status of the order shipment

You can check the shipping status of the payment order by either the transaction number or the merchant number + merchant number.

# Note

# How to call

# HTTPS calls

POST https://api.weixin.qq.com/wxa/sec/order/get_order?access_token=ACCESS_TOKEN

# Third party invocation

  • The calling method and access parameters are the same as HTTPS, only the calling token is different

  • This interface belongs to a permission set id: 142

  • Once authorized by one of the permission sets, a service provider can make a call on behalf of the merchant using authorizer_access_token

# Request parameters

attribute type Required to fill in Introductions
access_token string yes The interface invokes a credential that is a URL parameter, not a Body parameter.Use getAccessToken or authorizer_access_token
transaction_id string no The WeChat order number corresponding to the original payment transaction.
merchant_id string no The merchant number of the payment order merchant is generated and issued by WeChat payment.
sub_merchant_id string no Secondary merchant number.
merchant_trade_no string no The order number within the merchant system can only be numbers, upper and lower case letters`_- *`and unique under the same merchant number.

# Return Parameters

attribute type Introductions
errcode number Error code.
errmsg string The wrong reason.
order object Payment order information.
attribute type Introductions
transaction_id string The WeChat order number corresponding to the original payment transaction.
merchant_id string The merchant number of the payment order merchant is generated and issued by WeChat payment.
sub_merchant_id string Secondary merchant number.
merchant_trade_no string The order number within the merchant system can only be numbers, upper and lower case letters`_- *`and unique under the same merchant number.
description string All descriptions of goods of the payment order, connected by a semicolon, are automatically cut off when they exceed 120 words and end with "..."
paid_amount number Statement of payment Actual amount paid, in whole form, in units: installments.
openid string Payers openid.
trade_create_time number Transaction creation time, in the form of timestamp.
pay_time number Payment time, in timestamp form.
order_state number Order status enumerate: (1) pending shipment; (2) The shipment has been shipped; (3) confirm receipt of the goods; (4) The transaction is completed; (5) The money has been refunded; (6) The funds are pending settlement.
in_complaint boolean Are you in a transaction dispute?
shipping object Shipping information.
attribute type Introductions
delivery_mode number Delivery mode, delivery mode enumeration value: 1, UNIFIED_DELIVERY (unified delivery) 2, SPLIT_DELIVERY (split delivery) Example value: UNIFIED_DELIVERY
logistics_type number Logistics mode, shipping mode enumeration value: 1. Physical logistics distribution uses courier companies to conduct physical logistics distribution form 2. Same-town distribution Virtual goods, virtual goods, such as call ups, card subscriptions, etc., do not have physical delivery form 4. Users own their own supplies
finish_shipping boolean Have all shipments been completed?
goods_desc string In Weixin Mini Program back delivery information entry page entry description of goods.
finish_shipping_count number The number of times a full shipment has been completed is 0, when it is not completed, 1, when it has been finished, and 2 when it was re-shipped and completed.
shipping_list array Logistics information list, shipping logistics list, supports two modes of unified shipping (single logistics list) and split shipping (multiple logistics list).
attribute type Introductions
tracking_no string Logistics order number, example value: "323244567777."
express_company string The name of the same-town distribution company or logistics company code, the courier company ID, see "Get capacity id list get_delivery_list" Example value: "DHL."
goods_desc string A description of the goods entered using the Upload Logistics Information API.
upload_time number When the logistics information was uploaded, in timestamp form.
contact object Contact details.
attribute type Introductions
consignor_contact string The sender's contact information.
receiver_contact string Contact information for the recipient.

# Call Examples

# Example of request data

{
    "transaction_id": "fake-transid-20221209132531-44",
    "merchant_id": "fake-mchid-123",
    "merchant_trade_no": "fake-tradeno-20221209132531-44"
}

# Return data examples

{ 
    "errcode": 0,
    "errmsg": "ok",
    "order": {
        "transaction_id": "fake-transid-20221209132531-44",
        "merchant_trade_no": "fake-tradeno-20221209132531-44",
        "merchant_id": "fake-mchid-123",
        "sub_merchant_id": "",
        "description": "🍌*1",
        "paid_amount": 916,
        "openid": "ogqztkPsejM9MQAFfwCQSCi4oNg3",
        "trade_create_time": 1670563533,
        "pay_time": 1670563533,
        "in_complaint": false,
        "order_state": 2,
        "shipping": {
            "delivery_mode": 1,
            "logistics_type": 1,
            "finish_shipping": true,
            "finish_shipping_count": 1,
            "goods_desc": "🍌*1",
            "shipping_list": [
                {
                    "tracking_no": "JT1234567890",
                    "express_company": "JTSD",
                    "upload_time": 1670832735
                }
            ]
        }
    }
} 

# Error code

Error code Error code values Solutions
-1 system error The system is busy, so the developer is asked to try again in a few minutes.
10060001 The payment slip does not exist. Please check WeChat The transaction_id field in the form of payment order number or the mchid, out_trade_no fields in the form of merchant order number.
10060012 A system error The system is busy, so the developer is asked to try again in a few minutes.
10060014 The request parameter is illegal. Please check whether the transaction_id field in WeChat payment form has been filled in, or the merchant_id, merchant_trade_no fields have been filled in in the merchant side form

# IV. Query Order List

You can check the order list by time of payment, payer openid or order status.

# Note

# How to call

# HTTPS calls

POST https://api.weixin.qq.com/wxa/sec/order/get_order_list?access_token=ACCESS_TOKEN

# Third party invocation

  • The calling method and access parameters are the same as HTTPS, only the calling token is different

  • This interface belongs to a permission set id: 142

  • Once authorized by one of the permission sets, a service provider can make a call on behalf of the merchant using authorizer_access_token

# Request parameters

attribute type Required to fill in Introductions
access_token string yes The interface invokes a credential that is a URL parameter, not a Body parameter.Use getAccessToken or authorizer_access_token
pay_time_range object no The payment time belongs to the scope.
attribute type Required to fill in Introductions
begin_time number no The starting time, in the form of a time stamp, is deemed to start at 0 if not filled in.
end_time number no End date (inclusive), in timestamp form, without which the maximum value of a 32-bit unsigned integer is considered.
     <i class="toggle-children-table"></i> order_state
        number

no Order status enumerate: (1) pending shipment; (2) The shipment has been shipped; (3) confirm receipt of the goods; (4) The transaction is completed; (5) The money has been refunded; (6) The funds are pending settlement.

     <i class="toggle-children-table"></i> openid
        string

no Payers openid.

     <i class="toggle-children-table"></i> last_index
        string

no Use when turning pages, get the first page without passing in, if the query results in the has_more field is true, then passing in the last_index field returned in the query results can get the next page.

     <i class="toggle-children-table"></i> page_size
        number

no Use when turning the page to return the length of the list, which is 100 by default.

# Return Parameters

attribute type Introductions
errcode number Error code.
errmsg string The wrong reason.
last_index string Use this when you turn the page.
has_more boolean Are there any more payment orders available?
order_list array A list of payment order information.
attribute type Introductions
transaction_id string The WeChat order number corresponding to the original payment transaction.
merchant_id string The merchant number of the payment order merchant is generated and issued by WeChat payment.
sub_merchant_id string Secondary merchant number.
merchant_trade_no string The order number within the merchant system can only be numbers, upper and lower case letters`_- *`and unique under the same merchant number.
description string All descriptions of goods of the payment order, connected by a semicolon, are automatically cut off when they exceed 120 words and end with "..."
paid_amount number Statement of payment Actual amount paid, in whole form, in units: installments.
openid string Payers openid.
trade_create_time number Transaction creation time, in the form of timestamp.
pay_time number Payment time, in timestamp form.
order_state number Order status enumerate: (1) pending shipment; (2) The shipment has been shipped; (3) confirm receipt of the goods; (4) The transaction is completed; (5) The money has been refunded; (6) The funds are pending settlement.
in_complaint boolean Are you in a transaction dispute?
shipping object Shipping information.
attribute type Introductions
delivery_mode number Delivery mode, delivery mode enumeration value: 1, UNIFIED_DELIVERY (unified delivery) 2, SPLIT_DELIVERY (split delivery) Example value: UNIFIED_DELIVERY
logistics_type number Logistics mode, shipping mode enumeration value: 1. Physical logistics distribution uses courier companies to conduct physical logistics distribution form 2. Same-town distribution Virtual goods, virtual goods, such as call ups, card subscriptions, etc., do not have physical delivery form 4. Users own their own supplies
finish_shipping boolean Have all shipments been completed?
goods_desc string In Weixin Mini Program back delivery information entry page entry description of goods.
finish_shipping_count number The number of times a full shipment has been completed is 0, when it is not completed, 1, when it has been finished, and 2 when it was re-shipped and completed.
shipping_list array Logistics information list, shipping logistics list, supports two modes of unified shipping (single logistics list) and split shipping (multiple logistics list).
attribute type Introductions
tracking_no string Logistics order number, example value: "323244567777."
express_company string The name of the same-town distribution company or logistics company code, the courier company ID, see "Get capacity id list get_delivery_list" Example value: "DHL."
goods_desc string A description of the goods entered using the Upload Logistics Information API.
upload_time number When the logistics information was uploaded, in timestamp form.
contact object Contact details.
attribute type Introductions
consignor_contact string The sender's contact information.
receiver_contact string Contact information for the recipient.

# Call Examples

# Example of request data

{
    "pay_time_range": {
        "begin_time": 1670563531,
        "end_time": 1670563531
    },
    "page_size": 2
}

# Return data examples

{
    "errcode": 0,
    "errmsg": "ok",
    "order_list": [
        {
            "transaction_id": "fake-transid-20221209132531-0",
            "merchant_trade_no": "fake-tradeno-20221209132531-0",
            "merchant_id": "fake-mchid-123",
            "sub_merchant_id": "",
            "description": "",
            "paid_amount": 4353,
            "openid": "ogqztkPsejM9MQAFfwCQSCi4oNg3",
            "trade_create_time": 1670563531,
            "pay_time": 1670563531,
            "order_state": 1,
            "in_complaint": false,
            "shipping": {}
        },
        {
            "transaction_id": "fake-transid-20221209132531-1",
            "merchant_trade_no": "fake-tradeno-20221209132531-1",
            "merchant_id": "fake-mchid-123",
            "sub_merchant_id": "",
            "description": "",
            "paid_amount": 29767,
            "openid": "ogqztkPsejM9MQAFfwCQSCi4oNg3",
            "trade_create_time": 1670563531,
            "pay_time": 1670563531,
            "order_state": 1,
            "in_complaint": false,
            "shipping": {}
        }
    ],
    "last_index": "092dd3cecbc6926301",
    "has_more": true
}

# Error code

Error code Error code values Solutions
-1 system error The system is busy, so the developer is asked to try again in a few minutes.
10060001 The payment slip does not exist. Please check WeChat The transaction_id field in the form of payment order number or the mchid, out_trade_no fields in the form of merchant order number.
10060011 Last_index is illegal Check the last_index field for errors.
10060012 A system error The system is busy, so the developer is asked to try again in a few minutes.
10060014 The request parameter is illegal. Please check whether the transaction_id field in WeChat payment form has been filled in, or the merchant_id, merchant_trade_no fields have been filled in in the merchant side form

# V. Confirming the shipping reminder interface

If you have learned from your courier logistics service that the user has signed up for the relevant goods, you can use this interface to remind the user to confirm the receipt in time to improve the efficiency of financial settlement. Each order can only be invoked once.

# Note

  1. Specify an order by transaction number or merchant number + merchant number.
  2. Reminders can only be made when the type of logistics is a logistics courier.
  3. The receipt time is entered by the merchant and displayed when a reminder message is sent to the user. The receipt must be after the shipping time.

# How to call

# HTTPS calls

POST https://api.weixin.qq.com/wxa/sec/order/notify_confirm_receive?access_token=ACCESS_TOKEN

# Third party invocation

  • The calling method and access parameters are the same as HTTPS, only the calling token is different

  • This interface belongs to a permission set id: 142

  • Once authorized by one of the permission sets, a service provider can make a call on behalf of the merchant using authorizer_access_token

# Request parameters

attribute type Required to fill in Introductions
access_token string yes The interface invokes a credential that is a URL parameter, not a Body parameter.Use getAccessToken or authorizer_access_token
transaction_id string no The WeChat order number corresponding to the original payment transaction
merchant_id string no The merchant number of the payment order merchant, generated and issued by WeChat
sub_merchant_id string no Secondary merchant number
merchant_trade_no string no _- *and unique under the same merchant number
received_time number yes The time of delivery, in the form of a time stamp.

# Return Parameters

attribute type Introductions
errcode number Error code
errmsg string Reasons for the Error

# Call Examples

# Example of request data

{
    "transaction_id": "fake-transid-20221209132531-44",
    "merchant_id": "fake-mchid-123",
    "merchant_trade_no": "fake-tradeno-20221209132531-44",
    "received_time": 1670829139
}

# Return data examples

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

# Error code

Error code Error code values Solutions
-1 system error The system is busy, so the developer is asked to try again in a few minutes.
10060001 The payment slip does not exist. Please check WeChat The transaction_id field in the form of payment order number or the mchid, out_trade_no fields in the form of merchant order number.
10060012 A system error The system is busy, so the developer is asked to try again in a few minutes.
10060014 The request parameter is illegal. Please check whether the transaction_id field in WeChat payment form has been filled in, or the merchant_id, merchant_trade_no fields have been filled in in the merchant side form
10060028 The payment slip is not in shipment status Please check the status of the payment slip
10060029 The time of issuance was illegal. Please check whether the pickup time is after the shipping time
10060030 The payment slip has been used to remind the delivery opportunity No more reminders to take delivery.
10060032 Only when a logistics courier shipments are allowed to remind the user to confirm receipt Please check the shipping type of the payment order

# VI. Message Jump Path Settings Interface

If you have access to the confirmation receipt component provided by the platform in Weixin Mini Program, you can set the jump action of the delivery message and confirmation receipt message through the interface, When users click on the shipping message, they will go directly to your Mini Program order list page or details page to confirm the receipt, further optimizing the user experience.

# Note

  1. If the path is set to empty or a path that does not exist in Weixin Mini Program, it will still jump to the platform's default confirmation receipt page, and will not enter your Mini Program.

  2. After the path, the platform adds transaction_id, merchant_id, and merchant_trade_no of the payment order as query parameters, and if a second-tier merchant number exists, adds sub_merchant_id parameters, which developers can obtain in Weixin Mini Program by onLaunch.

  3. If you need to carry custom query parameters in the path, be careful to distinguish from the parameters above.

# How to call

# HTTPS calls

POST https://api.weixin.qq.com/wxa/sec/order/set_msg_jump_path?access_token=ACCESS_TOKEN

# Third party invocation

  • The calling method and access parameters are the same as HTTPS, only the calling token is different

  • This interface belongs to a permission set id: 142

  • Once authorized by one of the permission sets, a service provider can make a call on behalf of the merchant using authorizer_access_token

# Request parameters

attribute type Required to fill in Introductions
access_token string yes The interface invokes a credential that is a URL parameter, not a Body parameter.Use getAccessToken or authorizer_access_token
path string yes The merchant customizes the jump path.

# Return Parameters

attribute type Introductions
errcode number Error code
errmsg string Reasons for the Error

# Call Examples

# Example of request data

{
    "path": "pages/order/detail"
}

# Return data examples

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

# Error code

Error code Error code values Solutions
-1 system error The system is busy, so the developer is asked to try again in a few minutes.

# VII. Inquire whether Weixin Mini Program has opened delivery letter management services

# Features Description

Call this interface to query whether the Weixin Mini Program account has activated the Mini Program shipping information management service (those Mini Programs that have activated can access the shipping information management services API for shipping management).

# Note

The service provider can perform the query when it is authorized by 18 or 142 permissions sets.

# How to call

# HTTPS calls

POST https://api.weixin.qq.com/wxa/sec/order/is_trade_managed?access_token=ACCESS_TOKEN

# Request parameters

attribute type Required to fill in Introductions
access_token string yes The interface invokes a credential that is a URL parameter, not a Body parameter.Use getAccessToken or authorizer_access_token
appid string yes AppID to be queried by Weixin Mini Program, only this account can be queried by non-service providers

# Return Parameters

attribute type Introductions
errcode number Error code
errmsg string Reasons for the Error
is_trade_managed boolean Is Weixin Mini Program Shipping Receipt Management Service available?

# Call Examples

# Example of request data

{
    "appid": "wx0123456789abcdef"
}

# Return data examples

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

# Error code

Error code Error code values Solutions
-1 system error The system is busy, so the developer is asked to try again in a few minutes.
61003 The service provider is not authorized Check that Weixin Mini Program has authorized the 18 or 142 permission set.
61004 User IP is not authorized Check if the caller IP is in the vendor IP whitelist.
61011 The service provider is not legal. Please check access_token for errors
40013 AppID Illegal Please check AppID for errors
40097 The request parameter is illegal. Please check that AppID has been filled in
44990 Achieving the maximum frequency control The system is busy, so the developer is asked to try again in a few minutes.

# VIII. Inquire whether Weixin Mini Program has completed the transaction settlement management confirmation

# Features Description

Calling this interface can query whether the Weixin Mini Program account has completed the transaction settlement management confirmation (that is, all the merchants associated with the Mini Program have completed the order management authorization or untying).The merchant number that has completed the order management authorization, and the resulting orders need to be shipped through the shipping information management service.

# Note

The service provider can perform the query when it is authorized by 18 or 142 permissions sets.

# How to call

# HTTPS calls

POST https://api.weixin.qq.com/wxa/sec/order/is_trade_management_confirmation_completed?access_token=ACCESS_TOKEN

# Request parameters

attribute type Required to fill in Introductions
access_token string yes The interface invokes a credential that is a URL parameter, not a Body parameter.Use getAccessToken or authorizer_access_token
appid string yes AppID to be queried by Weixin Mini Program, only this account can be queried by non-service providers

# Return Parameters

attribute type Introductions
errcode number Error code
errmsg string Reasons for the Error
completed boolean Whether transaction settlement management confirmation has been completed

# Example call

# Example of request data

{
    "appid": "wx0123456789abcdef"
}

# Return data example

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

# Error code

Error code Error code values Solutions
-1 system error The system is busy, so the developer is asked to try again in a few minutes.
61003 The service provider is not authorized Check that Weixin Mini Program has authorized the 18 or 142 permission set.
61004 User IP is not authorized Check if the caller IP is in the vendor IP whitelist.
61011 The service provider is not legal. Please check access_token for errors
40013 AppID Illegal Please check AppID for errors
40097 The request parameter is illegal. Please check that AppID has been filled in
44990 Achieving the maximum frequency control The system is busy, so the developer is asked to try again in a few minutes.

# IX. Relevant Messaging

When a transaction or order is settled, the WeChat server receives messages and events from the developer server and Third Party Platform parties, and URL pushes the relevant events byPOST.Note that you need to access the Weixin Mini Program message push service to receive events.

# Type of event

Type of event Introductions
trade_manage_remind_access_api Reminder Access Shipping Credit Management Service API
trade_manage_remind_shipping Reminder that shipping information needs to be uploaded
trade_manage_order_settlement Orders are to be settled or have already been settled

# The timing of the message push

Trade_manage_remind_access_apiEvent:

  • Weixin Mini Program Upon completion of account authorization
  • Weixin Mini Program When the first transaction is generated
  • Weixin Mini Program that has generated a transaction but never shipped, once a day

Trade_manage_remind_shippingEvent:

  • Once shipped Weixin Mini Program, when the order has not been shipped for more than 48 hours

Trade_manage_order_settlementEvent:

  • When the order is completed and shipped
  • When the order is settled

# Field Dxplaination

Trade_manage_remind_access_apiEvent Field Dxplaination

parameter type Introductions
ToUserName string Original ID of Weixin Mini Program
FromUserName string Sender account (an OpenID, in which case the sender is the system account)
CreateTime number Message creation time (integer), time stamp
MsgType string Message type, a fixed value"event"
Event string Type of event
msg string Message Text Content

Trade_manage_remind_shippingEvent Field Dxplaination

parameter type Introductions
ToUserName string Original ID of Weixin Mini Program
FromUserName string Sender account (an OpenID, in which case the sender is the system account)
CreateTime number Message creation time (integer), time stamp
MsgType string Message type, a fixed value"event"
Event string Type of event
transaction_id string WeChat Payment Order Number
merchant_id string Merchant Number
sub_merchant_id string Sub-merchant number
merchant_trade_no string Merchant's Order Number
pay_time number Payment Success Time, Second Clock
msg string Message Text Content

Trade_manage_order_settlementEvent Field Dxplaination

parameter type Introductions
ToUserName string Original ID of Weixin Mini Program
FromUserName string Sender account (an OpenID, in which case the sender is the system account)
CreateTime number Message creation time (integer), time stamp
MsgType string Message type, a fixed value"event"
Event string Type of event
transaction_id string Payment Order Number
merchant_id string Merchant Number
sub_merchant_id string Sub-merchant number
merchant_trade_no string Merchant's Order Number
pay_time number Payment Success Time, Second Clock
shipped_time number Shipping time, second-rate timestamp
estimated_settlement_time number Estimated settlement time, second time stamp. You only have this field when you push it when you ship
confirm_receive_method number Method of confirming receipt: 1. Manually confirm receipt; 2. Automatically confirm the receipt. Only the field is pushed when settlement occurs
confirm_receive_time number Confirm delivery time, second time stamp. Only the field is pushed when settlement occurs
settlement_time number Order settlement time, second time stamp. Only the field is pushed when settlement occurs

# X. Special shipment notification

# Features Description

The interface can be invoked to make special shipment reports for undispatched orders, which are suitable for pre-sold goods orders and test orders. Orders with a shipping time limit of more than 15 days need to be reported as pre-sold goods orders. After reporting, the user will receive a notification of the estimated shipping time. After the test order is submitted, there is no need to ship, and the funds will be automatically returned to the user within a period of time.

# Note

  1. Order is specified by WeChat payment order number or merchant order number.
  2. The expected shipment time of an order for pre-sold goods must be 15 days after the time of payment of the order and must not exceed 330 days.

# How to call

# HTTPS calls

POST https://api.weixin.qq.com/wxa/sec/order/opspecialorder?access_token=ACCESS_TOKEN

# Third party invocation

  • The invocation method and entry and exit parameters are the same as HTTPS, only the calling token is different

  • This interface belongs to a permission set id: 142

  • Once authorized by one of the permission sets, a service provider can make a call on behalf of the merchant using authorizer_access_token

# Request parameters

attribute type Required to fill in Introductions
order_id string yes The order number that requires special delivery reporting can be passed into WeChat payment order number or merchant order number
type number yes Special shipment reporting types, 1 for pre-sold goods orders, 2 for test orders
delay_to number no Unix timestamp for the expected delivery time, type 1 required, type 2 omitted

# Return Parameters

attribute type Introductions
errcode number Error code
errmsg string Reasons for the Error

# Call Examples

# Example of request data

{
    "order_id": "123456",
    "type": 1,
    "delay_to": 1752035828
}

# Return data examples

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

# Error code

Error code Error code values Solutions
-1 system error The system is busy, so the developer is asked to try again in a few minutes.
268546000 Type Illegal Please check type
268546001 Delay_to illegal Please check the delay_to parameter
268546002 There is no such order number in the account. Please check the number for errors