订单查询
<h1>订单查询接口文档</h1>
<h2>一、接口基础信息</h2>
<ol>
<li><strong>请求地址</strong>:<code>https://pay.lmwa.cn/api/pay/query</code></li>
<li><strong>请求方式</strong>:POST</li>
</ol>
<h2>二、请求参数</h2>
<table>
<thead>
<tr>
<th>字段名</th>
<th>变量名</th>
<th>必填</th>
<th>类型</th>
<th>示例值</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>商户 ID</td>
<td>pid</td>
<td>是</td>
<td>Int</td>
<td>1001</td>
<td>-</td>
</tr>
<tr>
<td>平台订单号</td>
<td>trade_no</td>
<td>特殊</td>
<td>String</td>
<td>20160806151343349</td>
<td>与商户订单号必传其一</td>
</tr>
<tr>
<td>商户订单号</td>
<td>out_trade_no</td>
<td>特殊</td>
<td>String</td>
<td>20160806151343351</td>
<td>与平台订单号必传其一</td>
</tr>
<tr>
<td>当前时间戳</td>
<td>timestamp</td>
<td>是</td>
<td>String</td>
<td>1721206072</td>
<td>10 位整数,单位秒</td>
</tr>
<tr>
<td>签名字符串</td>
<td>sign</td>
<td>是</td>
<td>String</td>
<td>-</td>
<td>参考签名规则</td>
</tr>
<tr>
<td>签名类型</td>
<td>sign_type</td>
<td>是</td>
<td>String</td>
<td>RSA</td>
<td>默认为 RSA</td>
</tr>
</tbody>
</table>
<h2>三、返回参数</h2>
<table>
<thead>
<tr>
<th>字段名</th>
<th>变量名</th>
<th>类型</th>
<th>示例值</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>返回状态码</td>
<td>code</td>
<td>Int</td>
<td>0</td>
<td>0 为成功,其它值为失败</td>
</tr>
<tr>
<td>错误信息</td>
<td>msg</td>
<td>String</td>
<td>-</td>
<td>失败时返回原因</td>
</tr>
<tr>
<td>平台订单号</td>
<td>trade_no</td>
<td>String</td>
<td>20160806151343349</td>
<td>-</td>
</tr>
<tr>
<td>商户订单号</td>
<td>out_trade_no</td>
<td>String</td>
<td>20160806151343351</td>
<td>-</td>
</tr>
<tr>
<td>接口订单号</td>
<td>api_trade_no</td>
<td>String</td>
<td>40001249985198893</td>
<td>微信支付宝返回的单号</td>
</tr>
<tr>
<td>支付方式</td>
<td>type</td>
<td>String</td>
<td>alipay</td>
<td>支付方式列表</td>
</tr>
<tr>
<td>支付状态</td>
<td>status</td>
<td>Int</td>
<td>1</td>
<td>支付状态列表</td>
</tr>
<tr>
<td>商户 ID</td>
<td>pid</td>
<td>Int</td>
<td>1001</td>
<td>-</td>
</tr>
<tr>
<td>订单创建时间</td>
<td>addtime</td>
<td>String</td>
<td>2024-07-01 16:47:32</td>
<td>-</td>
</tr>
<tr>
<td>订单完成时间</td>
<td>endtime</td>
<td>String</td>
<td>2024-07-01 16:49:24</td>
<td>仅完成才返回</td>
</tr>
<tr>
<td>商品名称</td>
<td>name</td>
<td>String</td>
<td>-</td>
<td>-</td>
</tr>
<tr>
<td>商品金额</td>
<td>money</td>
<td>String</td>
<td>1.00</td>
<td>-</td>
</tr>
<tr>
<td>已退款金额</td>
<td>refundmoney</td>
<td>String</td>
<td>-</td>
<td>仅部分退款情况才返回</td>
</tr>
<tr>
<td>业务扩展参数</td>
<td>param</td>
<td>String</td>
<td>-</td>
<td>-</td>
</tr>
<tr>
<td>支付用户标识</td>
<td>buyer</td>
<td>String</td>
<td>-</td>
<td>一般为 openid</td>
</tr>
<tr>
<td>支付用户 IP</td>
<td>clientip</td>
<td>String</td>
<td>-</td>
<td>-</td>
</tr>
<tr>
<td>当前时间戳</td>
<td>timestamp</td>
<td>String</td>
<td>1721206072</td>
<td>10 位整数,单位秒</td>
</tr>
<tr>
<td>签名字符串</td>
<td>sign</td>
<td>String</td>
<td>-</td>
<td>参考签名规则</td>
</tr>
<tr>
<td>签名类型</td>
<td>sign_type</td>
<td>String</td>
<td>RSA</td>
<td>默认为 RSA</td>
</tr>
</tbody>
</table>
<h2>四、支付状态列表</h2>
<table>
<thead>
<tr>
<th>状态值</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>0</td>
<td>未支付</td>
</tr>
<tr>
<td>1</td>
<td>已支付</td>
</tr>
<tr>
<td>2</td>
<td>已退款</td>
</tr>
<tr>
<td>3</td>
<td>已冻结</td>
</tr>
<tr>
<td>4</td>
<td>预授权</td>
</tr>
</tbody>
</table>