Latest update time:2020.04.30 Release notes
The Close Order API should be called when a new order No. needs to be generated to initiate the payment again if the merchant order payment failed, to avoid duplicate payments. This API is also required when the order has been placed by the system but the user failed to pay in time, and the system exited automatically to stop the transaction.
1. The Close Order API cannot be called immediately after the order is generated. The minimum call interval is 5 minutes.
Request URL:
Request method: POST
Applicable object:Common modeInstitutional mode
API Rules: https://wechatpay-api.gitbook.io/wechatpay-api-v3
path parameter is a path parameter.
query parameter needs to be passed in the request URL.
body parameter needs to be passed in the request JSON.
Name | Variable Name | Type | Required | Description |
---|---|---|---|---|
WeChat Pay order No. | transaction_id | string(32) | Choose one | path WeChat order No. corresponding to the original payment transaction Example:1217752501201407033233368018 |
Merchant order No. | out_trade_no | string(32) | path Order No. corresponding to the original payment transaction Example:1217752501201407033233368018 |
|
Merchant ID | mchid | string(32) | Yes | body Merchant ID assigned by WeChat Pay Note: Only forCommon mode Example:1900000109 |
Sub-merchant ID | sub_mchid | string(32) | Yes | body Merchant ID assigned to sub-merchants by WeChat Pay Note: Only forInstitutional mode Example:1900000109 |
Institution's Merchant ID | sp_mchid | string(32) | Yes | body Institution's Merchant ID assigned by WeChat Pay Note: Only forInstitutional mode Example:1900000100 |
{
"sp_mchid": "10000100",
"sub_mchid": "20000100"
}
Name | Variable Name | Type | Required | Description |
---|---|---|---|---|
Returned status code | code | string(32) | Yes | Error code. See the error code list for the enumerated values. Example:INVALID_REQUEST |
Returned information | message | string(256) | Yes | Returned message. It indicates the reason for the error if not empty. Example:Parameter format verification error |
+ Detailed error description | detail | object | No | It is returned when code is PARAM_ERROR. Details will be described below. |
No data (HTTP status code is 204)
{
"code":"INVALID_REQUEST",
"message":"Parameter format verification error",
"detail":{
"field":"#/properties/payer",
"value":"1346177081915535577",
"issue":"It is different from ALLOF schema",
"location":"body"
}
}
Name | Description | Solution |
---|---|---|
ORDERPAID | Order paid | The order is paid and cannot be closed. Handle it as a normal paid transaction. |
SYSTEMERROR | System error | System error. Call this API again. |
ORDERCLOSED | Order closed | The order is closed and this API cannot be called. |
REQUIRE_POST_METHOD | Use post method. | Check whether the request parameter is submitted via post method. |
Customer Service Tel
Business Development
9:00-18:00
Monday-Friday GMT+8
Technical Support
WeChat Pay Global
ICP证