1.5 订单查询接口
<h2>订单查询接口</h2>
<p><strong>接口地址</strong>:<code>/pay/api/1.0/queryOrder</code></p>
<p><strong>请求方式</strong>:<code>POST</code></p>
<p><strong>请求数据类型</strong>:<code>application/json</code></p>
<p><strong>响应数据类型</strong>:<code>application/json</code></p>
<p><strong>接口描述</strong>:
由于不可抗因素导致交易超时,或者状态不明确时,需要商户主动发起交易查询。来确定交易的最终状态。目前系统支持往前查询<code>3</code>日的交易。即<code>T-3到T日</code>的交易才能查询到记录。</p>
<p>3日前的交易查询请参考[1.6历史订单查询](<a href="https://www.showdoc.com.cn/jucaishangfu/9965825376511642">https://www.showdoc.com.cn/jucaishangfu/9965825376511642</a> "1.6历史订单查询")</p>
<p><strong>请求示例</strong>:</p>
<pre><code class="language-javascript">{
&quot;appId&quot;: &quot;MCH_A698612520&quot;,
&quot;mchNo&quot;: &quot;MCH_I293975931&quot;,
&quot;mchOrderNo&quot;: &quot;202303271529422244655558&quot;,
&quot;sign&quot;: &quot;480f2880dfa2a9d9ec543fdc62386d1b&quot;,
&quot;termId&quot;: &quot;12345678&quot;,
&quot;wayCode&quot;: &quot;WECHAT&quot;
}</code></pre>
<p><strong>请求参数</strong>:</p>
<table>
<thead>
<tr>
<th>参数名称</th>
<th>参数说明</th>
<th>请求类型</th>
<th>是否必须</th>
<th>数据类型</th>
<th>schema</th>
</tr>
</thead>
<tbody>
<tr>
<td>req</td>
<td>req</td>
<td>body</td>
<td>支付订单查询请求实体类</td>
<td>支付订单查询请求实体类</td>
</tr>
<tr>
<td>&emsp;&emsp;version</td>
<td>版本号</td>
<td>false</td>
<td>string</td>
<td>默认1.0</td>
</tr>
<tr>
<td>&emsp;&emsp;sign</td>
<td>签名值</td>
<td><code>true</code></td>
<td>string</td>
<td>详见签名生成算法</td>
</tr>
<tr>
<td>&emsp;&emsp;termId</td>
<td>终端id</td>
<td><code>true</code></td>
<td>string</td>
<td>没有真实终端号统一填88888888</td>
</tr>
<tr>
<td>&emsp;&emsp;mchNo</td>
<td>商户号</td>
<td><code>true</code></td>
<td>string</td>
<td>招联分配给二级商户的商户号</td>
</tr>
<tr>
<td>&emsp;&emsp;appId</td>
<td>应用id</td>
<td><code>true</code></td>
<td>string</td>
<td>商户配置的应用id</td>
</tr>
<tr>
<td>&emsp;&emsp;mchOrderNo</td>
<td>商户订单号</td>
<td><code>true</code></td>
<td>string</td>
<td>商户订单号, 商户系统内部的订单号(5到30个字符、 只能包含字母数字下划线,区分大小写)</td>
</tr>
<tr>
<td>&emsp;&emsp;wayCode</td>
<td>支付方式</td>
<td>false</td>
<td>string</td>
<td>ALIPAY(统一下单、条码支付、服务窗支付)<br> WECHAT(统一下单、条码支付、公众号支付、小程序)<br> UNIONPAY(银联)</td>
</tr>
</tbody>
</table>
<p><strong>响应状态</strong>:</p>
<table>
<thead>
<tr>
<th>状态码</th>
<th>说明</th>
<th>schema</th>
</tr>
</thead>
<tbody>
<tr>
<td>200</td>
<td>OK</td>
<td>R«订单查询返回实体»</td>
</tr>
</tbody>
</table>
<p>>见[应答码表](<a href="https://www.showdoc.com.cn/jucaishangfu/9966099368299628">https://www.showdoc.com.cn/jucaishangfu/9966099368299628</a> "应答码表")</p>
<p><strong>响应参数</strong>:</p>
<table>
<thead>
<tr>
<th>参数名称</th>
<th>参数说明</th>
<th>类型</th>
<th>schema</th>
</tr>
</thead>
<tbody>
<tr>
<td>code</td>
<td>integer(int32)</td>
<td>200表示成功 其他表示失败</td>
</tr>
<tr>
<td>data</td>
<td>订单查询返回实体</td>
<td>订单查询返回实体</td>
</tr>
<tr>
<td>&emsp;&emsp;amount</td>
<td>订单金额(分)</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;buyerId</td>
<td>买家在渠道(微信、支付宝)的用户ID</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;buyerLogonId</td>
<td>买家在渠道登录账号</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;channelOrderId</td>
<td>条码流水号</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;couponFee</td>
<td>优惠金额(分)</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;dealDate</td>
<td>交易日期</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;discountGoodsDetail</td>
<td>支付宝交易支付所使用的单品券优惠的商品优惠信息</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;extParam</td>
<td>附加数据</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;fundBillList</td>
<td>支付宝交易资金渠道</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;fyTermId</td>
<td>终端号</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;hbIsSeller</td>
<td>返回值</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;orgId</td>
<td>机构号</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;isCredit</td>
<td>1-表示信用卡或者花呗 0-表示其他(非信用方式) 不填,表示未知</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;mchNo</td>
<td>商户号</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;mchOrderNo</td>
<td>商户订单号</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;payTime</td>
<td>用户支付时间</td>
<td>string</td>
<td>yyyyMMddHHmmss</td>
</tr>
<tr>
<td>&emsp;&emsp;payType</td>
<td>付款方式</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;promotionDetail</td>
<td>微信营销详情</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;randomStr</td>
<td>随机字符串</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;serviceChargeFlag</td>
<td>手续费减免标识</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;settlementAmt</td>
<td>应结算订单金额(分)</td>
<td>string</td>
<td>单位分,原订单交易金额-官方商户出资金额(包含手续费)</td>
</tr>
<tr>
<td>&emsp;&emsp;paymentAmount</td>
<td>实付金额(分)</td>
<td>string</td>
<td>实付金额=订单金额-优惠金额</td>
</tr>
<tr>
<td>&emsp;&emsp;termId</td>
<td>终端号</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;traceNo</td>
<td>系统内部追踪号</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;transStat</td>
<td>交易状态</td>
<td>string</td>
<td>SUCCESS 成功 PAYERROR 失败 USERPAYING支付中 NOTPAY 未支付 CLOSED 已关闭 REVOKED 已撤销 REFUND 已退款</td>
</tr>
<tr>
<td>&emsp;&emsp;transactionId</td>
<td>渠道交易流水号</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;voucherDetailList</td>
<td>支付宝交易支付时所使用的所有优惠券信息</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;wayCode</td>
<td>订单类型</td>
<td>string</td>
</tr>
<tr>
<td>msg</td>
<td>string</td>
</tr>
<tr>
<td>sign</td>
<td>string</td>
</tr>
</tbody>
</table>
<p><strong>响应示例</strong>:</p>
<pre><code class="language-javascript">{
&quot;code&quot;: 200,
&quot;msg&quot;: &quot;SUCCESS&quot;,
&quot;data&quot;: {
&quot;returnCode&quot;: &quot;000000&quot;,
&quot;returnMsg&quot;: &quot;SUCCESS&quot;,
&quot;termId&quot;: &quot;263575187&quot;,
&quot;randomStr&quot;: &quot;S2JTKV6TPNMOBSQO4SEO5EHD3EDAYGBV&quot;,
&quot;orgId&quot;: &quot;ISV_I238002400&quot;,
&quot;mchNo&quot;: &quot;MCH_I293975931&quot;,
&quot;wayCode&quot;: &quot;WECHAT&quot;,
&quot;transStat&quot;: &quot;SUCCESS&quot;,
&quot;mchOrderNo&quot;: &quot;202303271529422244655559&quot;,
&quot;amount&quot;: &quot;1&quot;,
&quot;buyerId&quot;: &quot;oUpF8uAaF7ZBRRpcIlquMHmQ892Q&quot;,
&quot;transactionId&quot;: &quot;4200067681202303275321464464&quot;,
&quot;extParam&quot;: &quot;&quot;,
&quot;dealDate&quot;: &quot;20230327&quot;,
&quot;couponFee&quot;: &quot;0&quot;,
&quot;buyerLogonId&quot;: &quot;&quot;,
&quot;fundBillList&quot;: &quot;&quot;,
&quot;traceNo&quot;: &quot;030062147129&quot;,
&quot;channelOrderId&quot;: &quot;202303271529422244655559&quot;,
&quot;fyTermId&quot;: null,
&quot;isCredit&quot;: &quot;0&quot;,
&quot;payTime&quot;: &quot;20230327111346&quot;,
&quot;settlementAmt&quot;: &quot;1&quot;,
&quot;payType&quot;: &quot;OTHERS&quot;,
&quot;promotionDetail&quot;: null,
&quot;voucherDetailList&quot;: null,
&quot;discountGoodsDetail&quot;: null,
&quot;hbIsSeller&quot;: null,
&quot;serviceChargeFlag&quot;: null
},
&quot;sign&quot;: &quot;1ac527b52dcb1638bb92c10bfccbd5d3&quot;
}</code></pre>