3. API代付下单接口
<p><strong>简要描述:</strong> </p>
<ul>
<li>API代付下单接口</li>
<li>后台代付需支付密码,如忘记支付密码请联系商务。</li>
<li>API代付需要报备IP白名单,请联系商务。</li>
</ul>
<p><strong>请求URL:</strong> </p>
<ul>
<li><code>/go/withdraw/withdraw.go</code></li>
</ul>
<p><strong>请求方式:</strong></p>
<ul>
<li>POST</li>
<li>GET </li>
</ul>
<p><strong>参数说明:</strong> </p>
<table>
<thead>
<tr>
<th>参数</th>
<th>字段名</th>
<th>类型</th>
<th>最大长度</th>
<th>描述</th>
<th>签名</th>
</tr>
</thead>
<tbody>
<tr>
<td>pid</td>
<td>商户编号</td>
<td>Int</td>
<td>Max(8)</td>
<td>收单商户编号</td>
<td>是</td>
</tr>
<tr>
<td>cid</td>
<td>渠道编号</td>
<td>Int</td>
<td>Max(3)</td>
<td>渠道编号</td>
<td>否</td>
</tr>
<tr>
<td>oid</td>
<td>下发订单号</td>
<td>String</td>
<td>Max(32)</td>
<td>商户订单号</td>
<td>是</td>
</tr>
<tr>
<td>amount</td>
<td>下发金额</td>
<td>Int</td>
<td>Max(8)</td>
<td>(单位:分)1元=100</td>
<td>是</td>
</tr>
<tr>
<td>paypwd</td>
<td>支付密码</td>
<td>String</td>
<td>Max(32)</td>
<td>MD5("支付密码")后的值</td>
<td>是</td>
</tr>
<tr>
<td>uname</td>
<td>持卡人姓名</td>
<td>String</td>
<td>Max(10)</td>
<td>是</td>
</tr>
<tr>
<td>anumber</td>
<td>银行卡号</td>
<td>String</td>
<td>Max(30)</td>
<td>是</td>
</tr>
<tr>
<td>bname</td>
<td>银行名称</td>
<td>String</td>
<td>Max(20)</td>
<td>详见[银行编码]</td>
<td>是</td>
</tr>
<tr>
<td>bprovince</td>
<td>银行卡所在省份</td>
<td>string</td>
<td>Max(20)</td>
<td>例如:渐江省</td>
<td>是</td>
</tr>
<tr>
<td>bcity</td>
<td>银行卡所在市</td>
<td>String</td>
<td>Max(10)</td>
<td>例如:杭州市</td>
<td>是</td>
</tr>
<tr>
<td>bbranch</td>
<td>银行卡开户支行</td>
<td>String</td>
<td>Max(20)</td>
<td>例如:西湖支行</td>
<td>是</td>
</tr>
<tr>
<td>nurl</td>
<td>异步通知地址</td>
<td>String</td>
<td>Max(200)</td>
<td>完成后异步通知</td>
<td>是</td>
</tr>
<tr>
<td>sign</td>
<td>签名</td>
<td>String</td>
<td>Max(32)</td>
<td>签名规则见示例</td>
<td>否</td>
</tr>
</tbody>
</table>
<p><strong>签名示例:</strong> </p>
<pre><code>MD5(&quot;amount=下发金额&amp;anumber=银行卡号&amp;bbranch=银行卡开户支行&amp;bcity=银行卡所在市&amp;bname=银行名称&amp;bprovince=银行卡所在省份&amp;nurl=异步通知地址&amp;oid=下发订单号&amp;paypwd=支付密码&amp;pid=商户编号&amp;uname=持卡人姓名&amp;key=密钥&quot;)</code></pre>
<p><strong>签名规则:</strong> </p>
<pre><code>1、参数列表中,除去sign和说明不参与签名的参数,值为空的参数也需要参与签名
2、签名顺序按照参数名a到z的顺序排序,若遇到相同的首字母,则看第二个字母,以此类推,组成规则如下:
` 参数名1=参数值1&amp;参数名2=参数值2…….参数名n=参数值n&amp;key=秘钥(由系统提供)`
3、然后使用MD5对其进行UTF-8的编码方式加密即可,签名结果统一转成小写</code></pre>
<p><strong>返回示例</strong></p>
<pre><code> {
&quot;code&quot;: 117,
&quot;data&quot;: &quot;&quot;,
&quot;msg&quot;:&quot;IP错误&quot;,
}</code></pre>
<pre><code>{
&quot;code&quot;:101,
&quot;data&quot;:&quot;&quot;,
&quot;msg&quot;:&quot;成功&quot;
}</code></pre>
<p><strong>返回说明</strong> </p>
<p><code>返回格式统一为JSON格式.</code></p>
<p><strong>备注</strong> </p>
<ul>
<li>更多返回错误代码请看错误代码说明</li>
</ul>