1.2 用户扫商户统一下单接口
<h2>用户扫商户统一下单接口</h2>
<p><strong>接口地址</strong>:<code>/pay/api/1.0/c2bUnifiedOrder</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>步骤1:</code>商户发送报文至招联进行下单,实时返回下单后的支付二维码地址
<code>步骤2:</code>商户展示二维码给用户,用户使用微信、支付宝等扫码支付
<code>步骤3:</code>支付结果以回调的方式通知到商户</p>
<p><code>注:</code>下单成功之后开始查询。建议:查询间隔<code>5S</code>以上。如主动发起查询请在下单成功之后发起查询。</p>
<p><strong>请求示例</strong>:</p>
<pre><code class="language-javascript">{
&quot;appId&quot;: &quot;MCH_A698612520&quot;,
&quot;alipayStoreId&quot;: &quot;&quot;,
&quot;amount&quot;: 1,
&quot;body&quot;: &quot;1&quot;,
&quot;businessParams&quot;: {},
&quot;clientIp&quot;: &quot;127.0.0.1&quot;,
&quot;currency&quot;: &quot;CNY&quot;,
&quot;deviceInfo&quot;: &quot;&quot;,
&quot;extParam&quot;: &quot;&quot;,
&quot;extendParams&quot;: &quot;&quot;,
&quot;fyTermId&quot;: &quot;&quot;,
&quot;limitPay&quot;: &quot;&quot;,
&quot;mchNo&quot;: &quot;MCH_I293975931&quot;,
&quot;mchOrderNo&quot;: &quot;202303271518020724447&quot;,
&quot;notifyUrl&quot;: &quot;https://mail.qq.com/cgi-bin/frame_html?sid=pEYG5nBgQiNVqANe&amp;r=4a6c47ad7d279a80630dec073cda96e2&quot;,
&quot;sign&quot;: &quot;24b50b957d23f2da4034757109843eb9&quot;,
&quot;storeCode&quot;: &quot;&quot;,
&quot;subAppid&quot;: &quot;&quot;,
&quot;subject&quot;: &quot;支付测试&quot;,
&quot;tag&quot;: &quot;&quot;,
&quot;termId&quot;: &quot;12345678&quot;,
&quot;termSn&quot;: &quot;&quot;,
&quot;termType&quot;: &quot;&quot;,
&quot;terminalInfo&quot;: {},
&quot;version&quot;: &quot;1.0&quot;,
&quot;wayCode&quot;: &quot;ALIPAY&quot;,
&quot;businessSource&quot;: &quot;A007&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><code>true</code></td>
<td>string</td>
<td>ALIPAY(支付宝)<br> WECHAT(微信)<br> UNIONPAY(银联二维码)<br> BESTPAY(翼支付-暂不支持)<br> DIGICCY(数字货币-暂不支持)</td>
</tr>
<tr>
<td>&emsp;&emsp;amount</td>
<td>支付金额</td>
<td><code>true</code></td>
<td>number</td>
<td>单位:分</td>
</tr>
<tr>
<td>&emsp;&emsp;currency</td>
<td>货币代码</td>
<td>false</td>
<td>string</td>
<td>默认人民币:CNY</td>
</tr>
<tr>
<td>&emsp;&emsp;clientIp</td>
<td>实时交易终端IP地址</td>
<td><code>true</code></td>
<td>string</td>
<td>真实ip地址(ipv4)</td>
</tr>
<tr>
<td>&emsp;&emsp;subject</td>
<td>商品标题</td>
<td><code>true</code></td>
<td>string</td>
<td>显示在用户账单的商品、商品说明等地方</td>
</tr>
<tr>
<td>&emsp;&emsp;body</td>
<td>商品描述信息</td>
<td>false</td>
<td>string</td>
<td>商品描述信息</td>
</tr>
<tr>
<td>&emsp;&emsp;goodsDetail</td>
<td>单品优惠功能字段</td>
<td>false</td>
<td>JSONObject</td>
<td>见文档中[goodsDetail说明字段](<a href="https://www.showdoc.com.cn/jucaishangfu/9965976008190664?id=body%E8%AF%B4%E6%98%8E%E5%AD%97%E6%AE%B5">https://www.showdoc.com.cn/jucaishangfu/9965976008190664?id=body%E8%AF%B4%E6%98%8E%E5%AD%97%E6%AE%B5</a> "goodsDetail说明字段")</td>
</tr>
<tr>
<td>&emsp;&emsp;tag</td>
<td>商品标记</td>
<td>false</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;notifyUrl</td>
<td>通知地址</td>
<td><code>true</code></td>
<td>string</td>
<td>接收异步通知回调地址</td>
</tr>
<tr>
<td>&emsp;&emsp;subAppid</td>
<td>子商户公众号id</td>
<td>false</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;limitPay</td>
<td>限制支付</td>
<td>false</td>
<td>string</td>
<td>no_credit:不能使用信用卡 credit_group:不能使用花呗以及信用卡</td>
</tr>
<tr>
<td>&emsp;&emsp;extParam</td>
<td>商户扩展参数</td>
<td>false</td>
<td>string</td>
<td>如果需要用到微信点餐数据回传,该字段需要填写OrderSource=FoodOrder</td>
</tr>
<tr>
<td>&emsp;&emsp;fyTermId</td>
<td>富友终端号</td>
<td>false</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;termType</td>
<td>0:其他 1:富友终端 2:POS机 3:台卡 4:PC软件</td>
<td>false</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;termSn</td>
<td>终端序列号</td>
<td>false</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;deviceInfo</td>
<td>设备信息,托传给微信。用于单品券核销</td>
<td>false</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;extendParams</td>
<td>分期扩展参数</td>
<td>false</td>
<td>JSONObject</td>
<td>见文档中[extendParams扩展参数说明字段](<a href="https://www.showdoc.com.cn/jucaishangfu/9965976008190664">https://www.showdoc.com.cn/jucaishangfu/9965976008190664</a> "extendParams分期扩展参数说明字段")</td>
</tr>
<tr>
<td>&emsp;&emsp;storeCode</td>
<td>门店id</td>
<td>false</td>
<td>string</td>
<td>目前仅支持支付宝</td>
</tr>
<tr>
<td>&emsp;&emsp;alipayStoreId</td>
<td>支付宝店铺编号</td>
<td>false</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;terminalInfo</td>
<td>终端信息说明字段</td>
<td>false</td>
<td>JSONObject</td>
<td>终端信息说明字段,见文档中[terminalInfo终端信息说明字段](<a href="http://fundwx.fuiou.com/doc/#/scanpay/transform?id=_23-%e7%bb%88%e7%ab%af%e7%9b%b8%e5%85%b3">http://fundwx.fuiou.com/doc/#/scanpay/transform?id=_23-%e7%bb%88%e7%ab%af%e7%9b%b8%e5%85%b3</a> "terminalInfo终端信息说明字段")(259号文,终端信息) 以下示例仅测试环境可用:{"serial_num":"12345678901SN012"}</td>
</tr>
<tr>
<td>&emsp;&emsp;businessParams</td>
<td>商户传入业务信息</td>
<td>false</td>
<td>JSONObject</td>
<td>应用于安全,营销等参数直传场景,格式为 json 格式:{"data":"123"}</td>
</tr>
<tr>
<td>&emsp;&emsp;businessSource</td>
<td>渠道号</td>
<td><code>true</code></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;orgId</td>
<td>机构号</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;mchNo</td>
<td>商户号</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;orderId</td>
<td>条码流水号</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;orderNo</td>
<td>订单号</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;qrCode</td>
<td>二维码链接</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;randomStr</td>
<td>随机字符串</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;sessionId</td>
<td>预支付交易会话标识</td>
<td>string</td>
<td>支付宝生成的预支付回话标识,用于后续接口调用中使用,该值有效期为2小时</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;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;orgId&quot;: &quot;ISV_I238002400&quot;,
&quot;mchNo&quot;: &quot;MCH_I293975931&quot;,
&quot;orderId&quot;: &quot;&quot;,
&quot;orderNo&quot;: &quot;202303271518020724447&quot;,
&quot;qrCode&quot;: &quot;https://insuretest.fuioupay.com/native?token=20201201120186438897&quot;,
&quot;randomStr&quot;: &quot;ZO2559LK6JSWSQKW2XGQH1FSFFMW980F&quot;,
&quot;sessionId&quot;: &quot;&quot;,
&quot;termId&quot;: &quot;&quot;,
&quot;traceNo&quot;: &quot;120186438897&quot;,
&quot;wayCode&quot;: &quot;WECHAT&quot;
},
&quot;sign&quot;: &quot;d374750034a8f9e74a86301decaa7d56&quot;
}</code></pre>