1.7 退款申请接口
<h2>退款申请接口</h2>
<p><strong>接口地址</strong>:<code>/pay/api/1.0/refund</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>:
当交易发生之后一段时间内,由于买家或者卖家的原因需要退款时,卖家可以通过退款接口将支付款退还给买家,扫码支付平台将在收到退款请求并且验证成功之后,按照退款规则将支付款按原路退到买家帐号上。</p>
<p>总退款金额不能超过订单总金额。</p>
<p><code>注:</code>目前支持对<code>180天</code>以内的交易进行退款,支持全额或者是多次部分退款。
如需支持180天内的退款,需要在请求报文中填写:dealDate(原交易日期,格式:yyyyMMdd)
<strong><code>不填该值,支持30天内的交易进行退款。</code></strong>
<strong><code>填写该值,支持180天</code></strong></p>
<p><strong>请求示例</strong>:</p>
<pre><code class="language-javascript">{
&quot;appId&quot;: &quot;MCH_A698612520&quot;,
&quot;amount&quot;: 1,
&quot;dealDate&quot;: &quot;20230327&quot;,
&quot;extParam&quot;: &quot;&quot;,
&quot;mchNo&quot;: &quot;MCH_I293975931&quot;,
&quot;mchOrderNo&quot;: &quot;202303271529422244655559&quot;,
&quot;operatorId&quot;: &quot;&quot;,
&quot;refundAmt&quot;: 1,
&quot;refundOrderNo&quot;: &quot;202303271529422244655566&quot;,
&quot;sign&quot;: &quot;449b0a987ae340e1eb4dd63ddda5b3a4&quot;,
&quot;termId&quot;: &quot;88888888&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 BESTPAY(翼支付)<br> PY68(银联分期-商户贴息)<br> PY69(银联分期-持卡人贴息)</td>
</tr>
<tr>
<td>&emsp;&emsp;refundOrderNo</td>
<td>商户退款单号</td>
<td><code>true</code></td>
<td>string</td>
<td>支付订单号</td>
</tr>
<tr>
<td>&emsp;&emsp;amount</td>
<td>总金额</td>
<td>false</td>
<td>number</td>
<td>单位:分</td>
</tr>
<tr>
<td>&emsp;&emsp;refundAmt</td>
<td>退款金额</td>
<td><code>true</code></td>
<td>number</td>
<td>单位:分</td>
</tr>
<tr>
<td>&emsp;&emsp;operatorId</td>
<td>操作员</td>
<td>false</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;fyTermId</td>
<td>富友终端号</td>
<td>false</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;dealDate</td>
<td>原交易日期</td>
<td>false</td>
<td>string</td>
<td>yyyyMMdd</td>
</tr>
<tr>
<td>&emsp;&emsp;extParam</td>
<td>附加数据</td>
<td>false</td>
<td>string</td>
<td>附加数据</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>integer(int32)</td>
</tr>
<tr>
<td>data</td>
<td>订单退款返回实体类</td>
<td>订单退款返回实体类</td>
</tr>
<tr>
<td>&emsp;&emsp;dealDate</td>
<td>交易日期(yyyyMMdd)</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;orgId</td>
<td>机构号</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;randomStr</td>
<td>随机字符串</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;refundAmt</td>
<td>退款金额</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;refundId</td>
<td>渠道退款流水号</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;refundOrderNo</td>
<td>商户退款单号</td>
<td>string</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;transactionId</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;88888888&quot;,
&quot;randomStr&quot;: &quot;T0TB85UYAV9NRQI9ED508P7LNG3RCCJR&quot;,
&quot;orgId&quot;: &quot;ISV_I238002400&quot;,
&quot;mchNo&quot;: &quot;MCH_I293975931&quot;,
&quot;wayCode&quot;: &quot;WECHAT&quot;,
&quot;mchOrderNo&quot;: &quot;202303271529422244655559&quot;,
&quot;refundOrderNo&quot;: &quot;202303271529422244655566&quot;,
&quot;transactionId&quot;: &quot;4200067681202303275321464464&quot;,
&quot;refundId&quot;: &quot;50101205262023032732569102729&quot;,
&quot;dealDate&quot;: &quot;20230327&quot;,
&quot;refundAmt&quot;: &quot;1&quot;,
&quot;traceNo&quot;: &quot;030062147383&quot;
},
&quot;sign&quot;: &quot;dddf76be0a661b87c53bffb1cb9d04a0&quot;
}</code></pre>