Latest update time:2020.04.30 Release notes
After submitting a refund request, check the refund status by calling this API. There may be a delay in refund. The refund paid by balance will be received within 20 minutes. For refunds paid by bank cards, check the refund status after 3 business days.
1. This API is applicable to multiple partial refunds of the original transaction. You can view all refund details under the original transaction.
2. The transaction_id in the URL refers to the value of the original WeChat Pay order No. out_trade_no refers to the original merchant order No., either of which is called.
Request URL: https://api.mch.weixin.qq.com/hk/v3/refunds
Request method: GET
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 | query Merchant ID assigned by WeChat Pay Note: Only forCommon mode Example:1900000109 |
Sub-merchant ID | sub_mchid | string(32) | Yes | query Merchant ID assigned to sub-merchants by WeChat Pay Note: Only forInstitutional mode Example:1900000109 |
Institution's Merchant ID | sp_mchid | string(32) | Yes | query Merchant ID assigned to merchants by WeChat Pay Note: Only forInstitutional mode Example:1900000100 |
Record the start position | offset | int | Yes | query Paging function. Start position Example:0 |
Number of transactions on each page | count | int | Yes | query Paging feature. Number of returned results per page. The maximum is 20. Example:10 |
https://api.mch.weixin.qq.com/hk/v3/refunds?transaction_id=1217752501201407033233368018&count=10&offset=0&sp_mchid=1900000100&sub_mchid=1900000109
https://api.mch.weixin.qq.com/hk/v3/refunds?out_trade_no=1217752501201407033233368018&count=10&offset=0&sp_mchid=1900000100&sub_mchid=1900000109
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. |
Name | Variable Name | Type | Required | Description |
---|---|---|---|---|
WeChat Pay transaction order No. | id | string(32) | Yes | WeChat Pay transaction order No. Example:1217752501201407033233368018 |
Merchant ID | mchid | string(32) | Yes | Merchant ID assigned by WeChat Pay Note: Only forCommon mode Example:1900000109 |
Sub-merchant ID | sub_mchid | string(32) | Yes | Merchant ID assigned to sub-merchants by WeChat Pay Note: Only forInstitutional mode Example:1900000109 |
Institution's Merchant ID | sp_mchid | string(32) | Yes | Merchant ID assigned to merchants by WeChat Pay Note: Only forInstitutional mode Example:1900000100 |
Original merchant transaction order No. | out_trade_no | string(64) | Yes | The returned original transaction order No. Example: 1217752501201407033233368018 |
+ Order amount | amount | object | Yes | Information on the original order amount. For more information, see the description below. |
+ Refund order list | data | array | Yes | Returned refund list. For more information, see the description below. |
Total number of refunds under the order | total_num | int | Yes | Total number of refunds under the order Example:0 |
Number of refund orders returned this time | current_total_num | int | Yes | Number of refund orders returned this time Example: 10 |
{
"id": "1008450740201411110005820873",
"sp_mchid": "10000100",
"sub_mchid": "20000100",
"out_trade_no": "20150806125346",
"amount" : {
"total": 528800,
"currency":"HKD",
"payer_total": 518799,
"payer_currency": "HKD",
},
"total_num": 1,
"current_total_num": 1,
"data": [
{
"id": "2008450740201411110000174436",
"out_refund_no": "R20150806125346",
"channel": "ORIGINAL",
"amount": {
"refund": 50,
"currency": "CNY",
"payer_refund": 49,
"payer_currency": "HKD",
"exchange_rate" : {
"type": "SETTLEMenT_RATE",
"rate": 8000000
}
},
"status": "SUCCESS",
"recv_account": "China Merchants Bank Credit Card 0403",
"fund_source": "REFUND_SOURCE_RECHARGE_FUNDS",
"success_time": "2018-06-08T10:34:56+08:00",
"create_time": "2018-06-08T10:34:56+08:00",
"detail": [
{
"promotion_id":"109519",
"scope":"GLOBAL",
"type":"COUPON",
"amount": 1,
"refund_amount": 1,
"currency": "HKD"
}
]
}
]
}
Name | Description | Solution |
---|---|---|
SYSTEMERROR | Errors returned from the API | Try call the API again. |
REFUNDNOTEXIST | Failed to view the refund order | Check whether the order No. and the order status (e.g. unpaid and paid but not refunded) are correct. If there is no refund order under the order, this error code is returned, and no other information will be returned. |
INVALID_TRANSACTIONID | Invalid transaction_id | Invalid request parameter. Check whether the original transaction No. exists and whether the API for initiating payment transaction returns failure. |
PARAM_ERROR | Invalid parameter | Invalid request parameter. Re-check the parameter and then call the refund request again. |
APPID_NOT_EXIST | APPID does not exist. | Check whether APPID is correct. |
MCHID_NOT_EXIST | MCHID does not exist. | Check whether MCHID is correct. |
REQUIRE_POST_METHOD | Use post method. | Check whether the request parameter is submitted via post method. |
SIGNERROR | Signature error | Check if signature parameters and methods meet the algorithm requirements. |
XML_FORMAT_ERROR | Incorrect XML format | Check whether the format of the XML parameter is correct. |
Customer Service Tel
Business Development
9:00-18:00
Monday-Friday GMT+8
Technical Support
WeChat Pay Global
ICP证