统一收单交易退款查询
开发环境
开发环境
POST
/v3/alipay/trade/fastpay/refund/query
\2. 如果退款未成功,商户可以调用退款接口重试,重试时请务必保证退款请求号和退款金额一致,防止重复退款。
\3. 发起退款查询接口的时间不能离退款请求时间太短,建议之间间隔10秒以上。
错误码
公共错误码
业务错误码
状态码 | 错误码 | 错误描述 | 解决方案 |
---|---|---|---|
400 | ACQ.ENTERPRISE_PAY_BIZ_ERROR | 因公付业务异常 | 重新发起查询请求,如果多次重试后仍返回同样的错误,请联系支付宝小二处理 |
400 | ACQ.INVALID_PARAMETER | 参数无效 | 请根据接口返回的错误信息,检查请求参数,修改后重新发起请求 |
400 | ACQ.SYSTEM_ERROR | 系统错误 | 重新发起查询请求,如果多次重试后还是返回系统错误,请联系支付宝小二处理 |
400 | ACQ.TRADE_NOT_EXIST | 交易不存在 | 请确认传入的外部订单号或交易号是否正确 |
400 | TRADE_NOT_EXIST | 查询退款的交易不存在 | 确认交易号是否为正确的支付宝交易号,修改后重新查询 |
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://dev-cn.your-api-server.com/v3/alipay/trade/fastpay/refund/query' \
--header 'authorization: ALIPAY-SHA256withRSA app_id=$appid,timestamp=$now,nonce=$uuid,expired_seconds=600,sign=$sign' \
--header 'alipay-request-id: $requestid' \
--header 'Content-Type: application/json' \
--data-raw '{
"trade_no":"2021081722001419121412730660",
"out_trade_no":"2014112611001004680073956707",
"out_request_no":"HZ01RF001",
"query_options":[
"refund_detail_item_list"
]
}'
响应示例响应示例
200 - 成功示例
{
"trade_no": "2014112611001004680073956707",
"out_trade_no": "20150320010101001",
"out_request_no": "20150320010101001",
"total_amount": 100.2,
"refund_amount": 12.33,
"refund_status": "REFUND_SUCCESS",
"refund_royaltys": [
{
"refund_amount": 10,
"royalty_type": "transfer",
"result_code": "SUCCESS",
"trans_out": "2088102210397302",
"trans_out_email": "alipay-test03@alipay.com",
"trans_in": "2088102210397302",
"trans_in_email": "zen_gwen@hotmail.com"
}
],
"gmt_refund_pay": "2014-11-27 15:45:57",
"refund_detail_item_list": [
{
"fund_channel": "ALIPAYACCOUNT",
"amount": 10,
"real_amount": 11.21,
"fund_type": "DEBIT_CARD"
}
],
"send_back_fee": "88",
"deposit_back_info": {
"has_deposit_back": "true",
"dback_status": "S",
"dback_amount": 1.01,
"bank_ack_time": "2020-06-02 14:03:48",
"est_bank_receipt_time": "2020-06-02 14:03:48"
},
"refund_hyb_amount": "10.24",
"refund_charge_info_list": [
{
"refund_charge_fee": 0.01,
"switch_fee_rate": "0.01",
"charge_type": "trade",
"refund_sub_fee_detail_list": [
{
"refund_charge_fee": 0.1,
"switch_fee_rate": "0.01"
}
]
}
]
}
请求参数
Header 参数
authorization
string
必需
示例值:
ALIPAY-SHA256withRSA app_id=$appid,timestamp=$now,nonce=$uuid,expired_seconds=600,sign=$sign
alipay-request-id
string
必需
示例值:
$requestid
Content-Type
string
必需
示例值:
application/json
Body 参数application/json
返回响应
修改于 2023-11-20 07:35:21