创建支付分订单
<h3>接口说明</h3>
<ul>
<li>
<p>适用对象:直连商户</p>
</li>
<li>
<p>请求URL:<a href="https://open.yushuokj.cn/mini/v3/payscore/createorder">https://open.yushuokj.cn/mini/v3/payscore/createorder</a></p>
</li>
<li>请求方式:POST</li>
</ul>
<p><strong>请求头部:</strong></p>
<table>
<thead>
<tr>
<th>标签</th>
<th>必填</th>
<th>内容</th>
</tr>
</thead>
<tbody>
<tr>
<td>Content-Type</td>
<td>是</td>
<td>application/x-www-form-urlencoded</td>
</tr>
</tbody>
</table>
<h3>请求参数</h3>
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>必填</th>
<th>说明</th>
<th>参数示例</th>
</tr>
</thead>
<tbody>
<tr>
<td>terminal_no</td>
<td>string</td>
<td>是</td>
<td>终端号</td>
<td>70005551</td>
</tr>
<tr>
<td>open_id</td>
<td>string</td>
<td>是</td>
<td>用户openid</td>
<td>rfdcddqqSrtyuiohhkii</td>
</tr>
</tbody>
</table>
<h3>请求示例</h3>
<h3>返回参数</h3>
<table>
<thead>
<tr>
<th style="text-align: left;">参数名</th>
<th style="text-align: left;">类型</th>
<th style="text-align: left;">必含</th>
<th style="text-align: left;">说明</th>
<th>参数示例</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">code</td>
<td style="text-align: left;">int</td>
<td style="text-align: left;">M</td>
<td style="text-align: left;">响应码:200 成功,500 失败</td>
<td>200</td>
</tr>
<tr>
<td style="text-align: left;">data</td>
<td style="text-align: left;">string</td>
<td style="text-align: left;">M</td>
<td style="text-align: left;">响应内容,JSON等数据</td>
<td>1234</td>
</tr>
<tr>
<td style="text-align: left;">message</td>
<td style="text-align: left;">string</td>
<td style="text-align: left;">M</td>
<td style="text-align: left;">消息提未</td>
<td>操作成功</td>
</tr>
</tbody>
</table>
<p><strong>返data参数说明:</strong> </p>
<table>
<thead>
<tr>
<th>参数名</th>
<th>变量</th>
<th>类型[长度限制]</th>
<th>必填</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>terminal_no</td>
<td>string</td>
<td>M</td>
<td>终端号</td>
<td>70000001</td>
</tr>
<tr>
<td>mch_id</td>
<td>string</td>
<td>M</td>
<td>微信商户号</td>
<td>1699693975</td>
</tr>
<tr>
<td>package</td>
<td>string</td>
<td>M</td>
<td>跳转支付分小程序订单数据包</td>
<td>AAQTnZoAAAABAAAAAADjQ-1gWc7u</td>
</tr>
<tr>
<td>timestamp</td>
<td>string</td>
<td>M</td>
<td>10位时间戳,毫秒转化为秒</td>
<td>1736765175</td>
</tr>
<tr>
<td>sign_type</td>
<td>string</td>
<td>M</td>
<td>签名方式,只能为HMAC-SHA256</td>
<td>HMAC-SHA256</td>
</tr>
<tr>
<td>sign</td>
<td>string</td>
<td>M</td>
<td>apiv2key密钥对 mch_id、package、timestamp、nonce_str、sign_type 参数生成签名</td>
<td>E1B4CF7DA746222B573BA26D11D07A4B714A2BD5D375D7CF86A54C5A8DBB34AC</td>
</tr>
<tr>
<td>desc</td>
<td>string</td>
<td>M</td>
<td>订单描述</td>
<td>JSON信息</td>
</tr>
</tbody>
</table>
<h4>返回示例</h4>
<ul>
<li><a href="javascript:;">正常示例</a></li>
</ul>
<pre><code>{
&quot;code&quot;: 200,
&quot;data&quot;: {
&quot;terminal_no&quot;: &quot;70000001&quot;,
&quot;mch_id&quot;: &quot;1699693975&quot;,
&quot;nonce_str&quot;: &quot;7j6vglkv&quot;,
&quot;sign_type&quot;: &quot;HMAC-SHA256&quot;,
&quot;timestamp&quot;: &quot;1736765175&quot;,
&quot;package&quot;: &quot;AAQTnZoAAAABAAAAAAB8tyebzySzTYh99-6EZyAAAABcwQVtru-5k9MmEOZJ_Pv_Nq7Cw56dNKKN5EjZKnt5jcP-YMW51jTgeqBB82wJ5DqjmcS6grW0aXkA-zpRKf-kdE893F7wnfhQFjaKrXWEOa1Kugs5xPf65jUaYpaHXo4HzsuRydIYKkxMqJy7R4h2-1pIBEz8XS9uH4AGhX6c31SUxkIT-MIuN8BVxkjxI45MaCY5iogO2xsd&quot;,
&quot;sign&quot;: &quot;E1B4CF7DA746222B573BA26D11D07A4B714A2BD5D375D7CF86A54C5A8DBB34AC&quot;
},
&quot;message&quot;: &quot;操作成功&quot;
}</code></pre>
<h3>错误码<a href="https://pay.weixin.qq.com/wiki/doc/apiv3/Share/error_code.shtml">公共错误码</a></h3>
<table>
<thead>
<tr>
<th>状态码</th>
<th>错误码</th>
<th>描述</th>
<th>解决方案</th>
</tr>
</thead>
<tbody>
<tr>
<td>500</td>
<td>SYSTEM_ERROR</td>
<td>系统错误</td>
<td>5开头的状态码都为系统问题,请使用相同参数稍后重新调用</td>
</tr>
<tr>
<td>400</td>
<td>PARAM_ERROR</td>
<td>参数错误</td>
<td>根据错误提示,传入正确参数</td>
</tr>
<tr>
<td>403</td>
<td>NO_AUTH</td>
<td>商户信息不合法</td>
<td>登录商户平台核对,传入正确信息</td>
</tr>
<tr>
<td>429</td>
<td>FREQUENCY_LIMITED</td>
<td>频率超限</td>
<td>请求量不要超过接口调用频率限制</td>
</tr>
<tr>
<td>400</td>
<td>INVALID_REQUEST</td>
<td>请求参数符合参数格式,但不符合业务规则</td>
<td>请确认相同单号是否使用了不同的参数</td>
</tr>
<tr>
<td>404</td>
<td>ORDER_NOT_EXIST</td>
<td>订单不存在</td>
<td>确认入参,传入正确单据</td>
</tr>
<tr>
<td>400</td>
<td>INVALID_ORDER_STATE</td>
<td>单据状态错误</td>
<td>确认操作是否符合流程</td>
</tr>
<tr>
<td>400</td>
<td>ORDER_CANCELED</td>
<td>单据已取消</td>
<td>当前状态无需操作</td>
</tr>
<tr>
<td>400</td>
<td>ORDER_DONE</td>
<td>订单已完成</td>
<td>当前状态无需操作</td>
</tr>
</tbody>
</table>
<p><code>微信参数文档</code> <a href="https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter6_1_14.shtml">https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter6_1_14.shtml</a></p>