统一收单交易查询
开发环境
开发环境
POST
/v3/alipay/trade/query
需要调用查询接口的情况:
当商户后台、网络、服务器等出现异常,商户系统最终未接收到支付通知;
调用支付接口后,返回系统错误或未知交易状态情况;
调用alipay.trade.pay,返回INPROCESS的状态;
调用alipay.trade.cancel之前,需确认支付状态;
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://dev-cn.your-api-server.com/v3/alipay/trade/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 '{
"out_trade_no":"20150320010101001",
"trade_no":"2014112611001004680 073956707",
"org_pid":"2088101117952222",
"query_options":[
"trade_settle_info"
]
}'
响应示例响应示例
200 - 成功示例
{
"trade_no": "2013112011001004330000121536",
"out_trade_no": "6823789339978248",
"buyer_logon_id": "159****5620",
"trade_status": "TRADE_CLOSED",
"total_amount": 88.88,
"trans_currency": "TWD",
"settle_currency": "USD",
"settle_amount": 2.96,
"pay_currency": "CNY",
"pay_amount": "8.88",
"settle_trans_rate": "30.025",
"trans_pay_rate": "0.264",
"buyer_pay_amount": 8.88,
"point_amount": 10,
"invoice_amount": 12.11,
"send_pay_date": "2014-11-27 15:45:57",
"receipt_amount": "15.25",
"store_id": "NJ_S_001",
"terminal_id": "NJ_T_001",
"fund_bill_list": [
{
"fund_channel": "ALIPAYACCOUNT",
"amount": 10,
"real_amount": 11.21
}
],
"store_name": "证大五道口店",
"buyer_user_id": "2088101117955611",
"industry_sepc_detail_gov": "{\"registration_order_pay\":{\"brlx\":\"1\",\"cblx\":\"1\"}}",
"industry_sepc_detail_acc": "{\"registration_order_pay\":{\"brlx\":\"1\",\"cblx\":\"1\"}}",
"charge_amount": "8.88",
"charge_flags": "bluesea_1",
"settlement_id": "2018101610032004620239146945",
"trade_settle_info": {
"trade_settle_detail_list": [
{
"operation_type": "replenish",
"operation_serial_no": "2321232323232",
"operation_dt": "2019-05-16 09:59:17",
"trans_out": "2088111111111111",
"trans_in": "2088111111111111",
"amount": 10,
"ori_trans_out": "2088111111111111",
"ori_trans_in": "2088111111111111"
}
],
"trade_unsettled_amount": 1.1
},
"auth_trade_pay_mode": "CREDIT_PREAUTH_PAY",
"buyer_user_type": "PRIVATE",
"mdiscount_amount": "88.88",
"discount_amount": "88.88",
"subject": "Iphone6 16G",
"body": "Iphone6 16G",
"alipay_sub_merchant_id": "2088301372182171",
"ext_infos": "{\"action\":\"cancel\"}",
"passback_params": "merchantBizType%3d3C%26merchantBizNo%3d2016010101111",
"hb_fq_pay_info": {
"user_install_num": "3"
},
"credit_pay_mode": "creditAdvanceV2",
"credit_biz_order_id": "ZMCB99202103310000450000041833",
"hyb_amount": "10.24",
"bkagent_resp_info": {
"bindtrx_id": "123412341234",
"bindclrissr_id": "01",
"bindpyeracctbk_id": "123123123123",
"bkpyeruser_code": "123451234512345",
"estter_location": "+37.28/-121.268"
},
"charge_info_list": [
{
"charge_fee": 0.01,
"original_charge_fee": 0.01,
"switch_fee_rate": "0.03",
"is_rating_on_trade_receiver": "Y",
"is_rating_on_switch": "Y",
"charge_type": "trade",
"sub_fee_detail_list": [
{
"charge_fee": 0.1,
"original_charge_fee": 0.2,
"switch_fee_rate": "0.03"
}
]
}
],
"biz_settle_mode": "PERIOD"
}
请求参数
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