1.1 商户扫用户统一下单接口
<h2>商户扫用户统一下单接口</h2>
<p><strong>接口地址</strong>:<code>/pay/api/1.0/b2cUnifiedOrder</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><code>步骤1:</code>用户和商户确认订单金额
<code>步骤2:</code>用户向商户展示支付二维码(微信、支付宝等)
<code>步骤3:</code>商户使用扫码枪,扫描用户二维码并提交到招联扫码,并实时返回支付结果</p>
<p><code>注:</code>条码支付存在需要用户输入支付密码的场景(实时返回用户支付中),是否需要输入支付密码,与支付宝、微信的风控规则有关。此时需要商户主动发起查询来确定最终的订单状态。(建议:交易发起5S以后开始查询。查询间隔5S以上)</p>
<p><strong>请求示例</strong>:</p>
<pre><code class="language-javascript">{
&quot;appId&quot;: &quot;MCH_A698612520&quot;,
&quot;body&quot;: &quot;商品描述信息&quot;,
&quot;amount&quot;: 1,
&quot;authCode&quot;: &quot;287501494802645996&quot;,
&quot;clientIp&quot;: &quot;127.0.0.1&quot;,
&quot;mchNo&quot;: &quot;MCH_I293975931&quot;,
&quot;mchOrderNo&quot;: &quot;3007202304121733422244655576&quot;,
&quot;scene&quot;: &quot;1&quot;,
&quot;sign&quot;: &quot;913d9db6e819a7a6b1b2293a5aa93041&quot;,
&quot;subject&quot;: &quot;测试支付&quot;,
&quot;termId&quot;: &quot;88888888&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>false</td>
<td>string</td>
<td>ALIPAY(支付宝)<br> WECHAT(微信)<br> UNIONPAY(银联二维码)</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/2213661531846395/9965976008190664#goodsDetail%E8%AF%B4%E6%98%8E%E5%AD%97%E6%AE%B5">https://www.showdoc.com.cn/2213661531846395/9965976008190664#goodsDetail%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;authCode</td>
<td>扫码支付授权码</td>
<td><code>true</code></td>
<td>string</td>
<td>设备读取用户的条码或者二维码信息</td>
</tr>
<tr>
<td>&emsp;&emsp;scene</td>
<td>支付场景,默认1</td>
<td>false</td>
<td>string</td>
<td>1: 条码支付<br> 2: 声波支付<br> 3: 刷脸支付</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;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;fyTermId</td>
<td>富友终端号</td>
<td>false</td>
<td>string</td>
<td>富友采购或自带机入网填此字段</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>
<td>用于单品券核销</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/2213661531846395/9965976008190664/#extendParams">https://www.showdoc.com.cn/2213661531846395/9965976008190664/#extendParams</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="https://www.showdoc.com.cn/2213661531846395/9965976008190664/#terminalInfo">https://www.showdoc.com.cn/2213661531846395/9965976008190664/#terminalInfo</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;sceneInfo</td>
<td>场景信息说明字段</td>
<td>false</td>
<td>JSONObject</td>
<td>见文档中[sceneInfo场景信息说明字段示例](<a href="https://www.showdoc.com.cn/2213661531846395/9965976008190664/#sceneInfo">https://www.showdoc.com.cn/2213661531846395/9965976008190664/#sceneInfo</a> "sceneInfo场景信息说明字段")</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;termId</td>
<td>终端号</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;randomStr</td>
<td>随机字符串</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;wayCode</td>
<td>支付方式</td>
<td>string</td>
<td>ALIPAY<br> WECHAT<br>UNIONPAY</td>
</tr>
<tr>
<td>&emsp;&emsp;mchOrderNo</td>
<td>商户订单号</td>
<td>string</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;transactionId</td>
<td>渠道交易流水号</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;extParam</td>
<td>附加数据</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;channelOrderNo</td>
<td>渠道方生成的订单号</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;dealDate</td>
<td>交易日期</td>
<td>string</td>
<td>yyyyMMdd</td>
</tr>
<tr>
<td>&emsp;&emsp;couponFee</td>
<td>优惠金额(分)</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;buyerLogonId</td>
<td>买家在渠道登录账号</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;fundBillList</td>
<td>支付宝交易资金渠道,详细渠道</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;traceNo</td>
<td>系统内部追踪号</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;channelOrderId</td>
<td>条码流水号</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;isCredit</td>
<td>1:表示信用卡或者花呗<br> 0:表示其他(非信用方式)<br> 不填,表示未知</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;payTime</td>
<td>用户支付时间</td>
<td>string</td>
<td>yyyyMMddHHmmss</td>
</tr>
<tr>
<td>&emsp;&emsp;settlementAmt</td>
<td>应结算订单金额</td>
<td>string</td>
<td>单位分,原订单交易金额-官方商户出资金额(包含手续费)</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;voucherDetailList</td>
<td>支付宝交易支付时所使用的所有优惠券信息</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;discountGoodsDetail</td>
<td>支付宝交易支付所使用的单品券优惠的商品优惠信息</td>
<td>string</td>
</tr>
<tr>
<td>&emsp;&emsp;hbIsSeller</td>
<td>返回值</td>
<td>string</td>
<td>1=商户出息</td>
</tr>
<tr>
<td>&emsp;&emsp;serviceChargeFlag</td>
<td>手续费减免标识</td>
<td>string</td>
<td>Y:表示减免(默认)<br>N:表示不减免</td>
</tr>
<tr>
<td>msg</td>
<td>错误信息</td>
<td>string</td>
</tr>
<tr>
<td>sign</td>
<td>签名值</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;7NMLT87J7FSDM88IEBAGK6JG82BZPLWF&quot;,
&quot;orgId&quot;: &quot;ISV_I238002400&quot;,
&quot;mchNo&quot;: &quot;MCH_A698612520&quot;,
&quot;wayCode&quot;: &quot;WECHAT&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;channelOrderNo&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;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;3eb7ab0b08365c7dff027c7eb7328a2b&quot;
}</code></pre>