提交订单接口
<h4><strong>简要描述:</strong></h4>
<p>提交订单接口</p>
<ol>
<li><code>POST请求,Content-Type必须设置为:application/json;</code></li>
<li><code>接口是异步,接口调用成功(即下单成功),不代表充值成功</code></li>
<li><code>最终“充值结果”,需要调用“订单详情接口”进行查询,由于取卡是异步操作,建议间隔1-3s循环调用,直至最终结果;</code></li>
<li><code>此接口不会返回卡密数据,需要再调用“订单详情接口”获取卡密信息;</code></li>
<li><code>“订单详情接口”必须接入;</code></li>
<li><code>下单接口如果请求超时,请调用订单详情接口确认下单结果;</code></li>
</ol>
<h4><strong>请求URL:</strong></h4>
<p><code>http://平台域名/api/v1/order/buy</code></p>
<h4><strong>请求方式:</strong></h4>
<p><code>POST</code></p>
<h4><strong>请求参数:</strong></h4>
<table>
<thead>
<tr>
<th>Header 参数</th>
<th>类型</th>
<th>是否必填</th>
<th>描述</th>
<th>示例值</th>
</tr>
</thead>
<tbody>
<tr>
<td>Sign</td>
<td>string</td>
<td>是</td>
<td>签名</td>
<td>[点击查看签名规范](<a href="https://doc.kasushou.com/api/v2api/39">https://doc.kasushou.com/api/v2api/39</a> " 点击查看签名规范")</td>
</tr>
<tr>
<td>Timestamp</td>
<td>string</td>
<td>是</td>
<td>13位时间戳(毫秒)</td>
<td>1696644296195</td>
</tr>
<tr>
<td>UserId</td>
<td>string</td>
<td>是</td>
<td>您的用户编号</td>
<td>10000</td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th>Body 参数</th>
<th>类型</th>
<th>是否必填</th>
<th>描述</th>
<th>示例值</th>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>int</td>
<td>是</td>
<td>商品ID</td>
<td>1</td>
</tr>
<tr>
<td>url</td>
<td>string</td>
<td>否</td>
<td>订单回调地址(没有就不传)</td>
<td><a href="http://demo.kasushou.com/notify"><a href="http://demo.kasushou.com/notify">http://demo.kasushou.com/notify</a></a></td>
</tr>
<tr>
<td>external_orderno</td>
<td>string</td>
<td>是</td>
<td>三方订单号(防重复)可传空,建议传值,需传唯一值</td>
<td>D091952644768932429824</td>
</tr>
<tr>
<td>safe_price</td>
<td>string</td>
<td>否</td>
<td>安全价格(防止调价导致亏本,传入此参数用于对比)</td>
<td>2.2</td>
</tr>
<tr>
<td>mark</td>
<td>string</td>
<td>是</td>
<td>下单备注</td>
<td></td>
</tr>
<tr>
<td>quantity</td>
<td>int</td>
<td>是</td>
<td>下单数量</td>
<td>1</td>
</tr>
<tr>
<td>attach</td>
<td>object</td>
<td>否</td>
<td>下单参数(卡密商品不用传此参数)</td>
<td>手工订单下单模板(以下属性为商品模板中key)</td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th>attach 参数</th>
<th>类型</th>
<th>是否必填</th>
<th>描述</th>
<th>示例值</th>
</tr>
</thead>
<tbody>
<tr>
<td>recharge_account</td>
<td>string</td>
<td>否</td>
<td>充值账号</td>
<td>111111</td>
</tr>
<tr>
<td>lblName1</td>
<td>string</td>
<td>否</td>
<td>下单参数一</td>
<td>222222</td>
</tr>
<tr>
<td>lblName2</td>
<td>string</td>
<td>否</td>
<td>下单参数二</td>
<td>333333</td>
</tr>
<tr>
<td>…</td>
<td>…</td>
<td>否</td>
<td>下单参数N</td>
<td>123456</td>
</tr>
</tbody>
</table>
<h4><strong>签名示例:</strong></h4>
<p><code>1696644296195{&quot;attach:{&quot;recharge_account&quot;:&quot;111111&quot;,&quot;lblName1&quot;:&quot;222222&quot;,&quot;lblName2&quot;:&quot;333333&quot;},&quot;external_orderno&quot;:&quot;D091952644768932429824&quot;,&quot;id&quot;:1,&quot;mark&quot;:&quot;&quot;,&quot;quantity&quot;:1,&quot;safe_price&quot;:&quot;2.2&quot;,&quot;url&quot;:&quot;http://demo.kasushou.com/notify&quot;}apikey</code></p>
<h4><strong>返回示例:</strong></h4>
<ol>
<li><code>{</code></li>
<li><code>&quot;code&quot;: 200,</code></li>
<li><code>&quot;msg&quot;: &quot;下单成功&quot;,</code></li>
<li><code>&quot;data&quot;: {</code></li>
<li><code>&quot;ordersn&quot;: &quot;API091952652791532879872&quot;,</code></li>
<li><code>&quot;external_orderno&quot;: &quot;D091952644768932429824&quot;</code></li>
<li><code>}</code></li>
<li><code>}</code></li>
</ol>
<h4><strong>返回data说明:</strong></h4>
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr>
<td>ordersn</td>
<td>string</td>
<td>本地订单号</td>
</tr>
<tr>
<td>external_orderno</td>
<td>string</td>
<td>三方订单号</td>
</tr>
</tbody>
</table>