本接口提供喵街订单的查询的功能,商户可以通过本接口主动查询订单状态,完成下一步的业务逻辑。 商户系统应在两种场景下调用此接口: 1. 商户POS系统应该在调用[条码支付请求接口](create.md)并成功返回后,调用此接口查询订单的处理状态。 2. 商家财务系统应在交易成功后不断调用此接口,通过查询商户待收总额是否归零来完成系统间的自动化对账。
名称 | 类型 | 是否必须 | 示例值 | 更多限制 | 描述 |
---|---|---|---|---|---|
trade_no | String | 可选 | 2013112011001004330000121536 |
|
喵街交易凭证号。与喵街短订单号、商户订单号三者至少要填写一个。如果均有,优先级为喵街订单号 > 喵街短订单号 > 商户订单号。 |
out_trade_no | String | 可选 | 20150320010101001 |
|
原支付请求的商户订单号。与喵街订单号、喵街短订单号三者至少要填写一个。如果均有,优先级为喵街订单号 > 喵街短订单号 > 商户订单号。 |
short_trade_no | String | 可选 | 77778888 |
|
喵街短订单号,仅在30天内有效。与喵街订单号、商户订单号三者至少要填写一个。如果均有,优先级为喵街订单号 > 喵街短订单号 > 商户订单号。 |
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
onsite_trade_query_response | OnsiteTradeQueryResponse | onsiteTradeQueryResponse | 查询结果对象。必然返回 |
|
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret); AlibabaXlifeOnsiteTradeQueryRequest req = new AlibabaXlifeOnsiteTradeQueryRequest(); req.setTradeNo("2013112011001004330000121536"); req.setOutTradeNo("20150320010101001"); req.setShortTradeNo("77778888"); AlibabaXlifeOnsiteTradeQueryResponse rsp = client.execute(req, sessionKey); System.out.println(rsp.getBody());
<alibaba_xlife_onsite_trade_query_response> <onsite_trade_query_response> <buyer_id>2088102122524333</buyer_id> <buyer_nick>59****5620</buyer_nick> <gmt_payment>2015-11-27 15:45:57</gmt_payment> <buyer_total_fund_fee>50000</buyer_total_fund_fee> <buyer_total_promotion_fee>38888</buyer_total_promotion_fee> <invoice_amount>60000</invoice_amount> <payment_days>2015-12-05 15:45:57</payment_days> <out_trade_no>6823789339978248</out_trade_no> <buyer_promotion_bill_list> <promotion_bill> <amount>9000</amount> <extend_params>[{"abc":"123"}]</extend_params> <subject>阿香米线10元代金券</subject> <type>coupon</type> </promotion_bill> </buyer_promotion_bill_list> <gmt_query>2015-11-27 15:50:53</gmt_query> <store_name>炉鱼城西银泰店</store_name> <store_pending_fund_bill_list> <fund_bill> <amount>9000</amount> <sub_fund_channel>alipay_financeaccount</sub_fund_channel> <fund_channel>alipay</fund_channel> <extend_params>[{"abc":"123"}]</extend_params> <gmt_payment>2015-11-27 15:45:57</gmt_payment> <payment_seq_no>2013112011001004330000121536</payment_seq_no> </fund_bill> </store_pending_fund_bill_list> <store_received_fund_bill_list> <fund_bill> <amount>9000</amount> <sub_fund_channel>alipay_financeaccount</sub_fund_channel> <fund_channel>alipay</fund_channel> <extend_params>[{"abc":"123"}]</extend_params> <gmt_payment>2015-11-27 15:45:57</gmt_payment> <payment_seq_no>2013112011001004330000121536</payment_seq_no> </fund_bill> </store_received_fund_bill_list> <store_total_marketing_fee>28888</store_total_marketing_fee> <store_total_pending_fee>10000</store_total_pending_fee> <store_total_receivable_fee>60000</store_total_receivable_fee> <store_total_received_fee>50000</store_total_received_fee> <total_amount>88888</total_amount> <trade_no>2013112011001004330000121536</trade_no> <trade_status>WAIT_FOR_CONFIRM</trade_status> <goods_detail_list> <goods_detail> <quantity>1</quantity> <price>8800</price> <amount>8800</amount> <goods_name>iPad</goods_name> <goods_id>10460001</goods_id> <shop_name>ecco</shop_name> <shop_no>10460</shop_no> </goods_detail> </goods_detail_list> <attachment>[{"a":"123"}]</attachment> <extend_params>[{"abc":"123"}]</extend_params> </onsite_trade_query_response> </alibaba_xlife_onsite_trade_query_response>
<error_response> <code>50</code> <msg>Remote service error</msg> <sub_code>isv.invalid-parameter</sub_code> <sub_msg>非法参数</sub_msg> </error_response>
错误码 | 错误描述 | 解决方案 |
---|---|---|
isp.TRADE_ORDER_NOT_FOUND | 交易订单未找到 | 检查参数是否正确 |
isp.SYSTEM_ERROR | 系统异常 | ISV需要间隔2秒重试不超过10次。如果仍然异常,则需联系喵街技术支付人员检查。 |
isv.INVALID_PARAMETER | 无效参数。 | ISV开发人员需检查参数是否正确。 |
isp.QUERY_TRADE_FAIL | 查询交易时出现异常 | ISV需要间隔2秒重试不超过10次。如果仍然异常,则需联系喵街技术支付人员检查。 |