订单核销接口
<h5>接口使用描述</h5>
<pre><code>核销订单接口,对接方提供,我们调用您的接口 推送订单。</code></pre>
<h5>接口地址</h5>
<pre><code>URL地址:商家提供
请求方式:POST
功能描述:订单、退货单回传,由ERP提供接口
限频规则:测试环境(qps:5/s)正式环境(qps:20/s)
注意事项:商家要对接口做防重校验,注意接口中字段的单位,如果强依赖某个字段的值,请做强校验,避免错误数据写入后再做冲销</code></pre>
<p><br/></p>
<h4>请求参数<img src='<a href="https://www.showdoc.cc/server/api/common/visitfile/sign/bfc24f8d7eb93fae8e66d4ab2b4bc461?showdoc=.jpg'">https://www.showdoc.cc/server/api/common/visitfile/sign/bfc24f8d7eb93fae8e66d4ab2b4bc461?showdoc=.jpg'</a>; align='right' style=' width:300px;height:100 px'/></h4>
<table>
<thead>
<tr>
<th><strong>NO</strong></th>
<th><strong>字段</strong></th>
<th><strong>名称</strong></th>
<th><strong>长度</strong></th>
<th><strong>必填</strong></th>
<th><strong>示例</strong></th>
<th><strong>说明</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>appId</td>
<td>合作方标识</td>
<td>string</td>
<td>Y</td>
<td>EW_N2949193174</td>
<td>合作商户编码,用于以后所有接口发起请求时验签使用</td>
</tr>
<tr>
<td>2</td>
<td>sign</td>
<td>签名。具体参见“<a href="https://www.showdoc.cc/web/#/liantuofu?page_id=673453270295568">签名规则</a>”</td>
<td>string</td>
<td>Y</td>
<td>1b70687c8a4c72f50c749baf95a482c0</td>
<td>MD5加密验签值。具体参见“<a href="https://www.showdoc.cc/web/#/liantuofu?page_id=673453270295568">签名规则</a>”</td>
</tr>
<tr>
<td>3</td>
<td>timestamp</td>
<td>时间戳</td>
<td>string</td>
<td>LONG</td>
<td>1713943936754</td>
<td>时间戳(毫秒)请实时获取,允许误差在15分钟以内(数据类型:Long)</td>
</tr>
<tr>
<td>4</td>
<td>body</td>
<td>同步数据(json格式,参照下文说明)</td>
<td>string</td>
<td>Y</td>
<td>{ "channel": "1", "channelCommission": 42, "channelOrderId": "2409904217000723", "createTime": 1713942642000, "deliveryFee": 400, "jdSkyChoose": 0, "orderSettlement": 748, "outStationNo": "EW_N6334934883", "platformSubsidyAll": 1, "productList": [{ "bussinessSubsidy": 0, "changeId": 0, "discountValue": 1, "goodId": "40005", "merchantSingleProductSubsidy": 0, "outSkuId": "40005", "payValue": 1190, "platformSingleProductSubsidy": 0, "platformSubsidy": 1, "shippingFeeVenderSubsidy": 0, "skuCount": 1.0, "skuPrice": 1190, "skuUpc": "11000001" }], "refund": false, "totalPrice": 1709, "transactionId": "JDDJ2409904217000723_1", "updateTime": 1713943914317, "venderDeliverySubsidy": 0, "vipCode": "" }</td>
<td></td>
</tr>
<tr>
<td>5</td>
<td>type</td>
<td>类型</td>
<td>string</td>
<td>Y</td>
<td>hb </td>
<td>类型,目前都传hb</td>
</tr>
</tbody>
</table>
<hr />
<h4>响应参数</h4>
<table>
<thead>
<tr>
<th><strong>NO</strong></th>
<th><strong>字段</strong></th>
<th><strong>名称</strong></th>
<th><strong>长度</strong></th>
<th><strong>必填</strong></th>
<th><strong>示例</strong></th>
<th><strong>说明</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>code</td>
<td>结果</td>
<td>string</td>
<td>Y</td>
<td>SUCCESS</td>
<td>同步结果 SUCCESS:同步成功 FAILED:同步失败</td>
</tr>
<tr>
<td>2</td>
<td>msg</td>
<td>结果描述</td>
<td>string</td>
<td>Y</td>
<td>同步成功/失败</td>
<td>无论是成功或者失败,message都会针对于当前的结果返回响应的结果描述</td>
</tr>
</tbody>
</table>
<p><br/><br/></p>
<h5>请求示例:</h5>
<pre><code></code></pre>
<h5>响应示例(成功):</h5>
<pre><code class="language-json">{
&quot;code&quot;: &quot;SUCCESS&quot;,
&quot;msg&quot;: &quot;同步成功&quot;
}</code></pre>
<h5>响应示例(失败):</h5>
<pre><code class="language-json">{
&quot;code&quot;:&quot;FAILED&quot;,
&quot;msg&quot;:&quot;同步失败&quot;,
}</code></pre>
<h5>body入参详细说明</h5>
<table>
<thead>
<tr>
<th>字段</th>
<th>类型</th>
<th>必填</th>
<th>描述</th>
<th>示例</th>
</tr>
</thead>
<tbody>
<tr>
<td>transactionId</td>
<td>String(100)</td>
<td>Y</td>
<td>调用方流水号,JDDJ+渠道单号(逆向单为中台逆向单号)_channel</td>
<td>JDDJ111112312312312</td>
</tr>
<tr>
<td>channelOrderId</td>
<td>String(100)</td>
<td>Y</td>
<td>渠道订单号</td>
<td>111112312312312</td>
</tr>
<tr>
<td>afterOrderId</td>
<td>String(100)</td>
<td>N</td>
<td>渠道退单号(只有逆向有)</td>
<td>2898340928038</td>
</tr>
<tr>
<td>outStationNo</td>
<td>String(20)</td>
<td>Y</td>
<td>商家自有门店编码</td>
<td>1001</td>
</tr>
<tr>
<td>createTime</td>
<td>Long</td>
<td>Y</td>
<td>时间戳(毫秒)</td>
<td>时间戳</td>
</tr>
<tr>
<td>refund</td>
<td>boolean</td>
<td>N</td>
<td>是否是退货,默认是false</td>
<td>false</td>
</tr>
<tr>
<td>vipCode</td>
<td>String(100)</td>
<td>N</td>
<td>会员卡号,用于积分</td>
<td>0800494200</td>
</tr>
<tr>
<td>channel</td>
<td>String(4)</td>
<td>Y</td>
<td>用于区分调用渠道,1京东到家,2美团,3饿了么 ,9自有渠道,10有赞,12 抖音,13 京超,14 淘宝买菜,15 京东加盟仓</td>
<td>1</td>
</tr>
<tr>
<td>deliveryFee</td>
<td>Long(20) </td>
<td>N</td>
<td>运费原价,未优惠前金额 单位分</td>
<td>500</td>
</tr>
<tr>
<td>venderDeliverySubsidy</td>
<td>Long(20) </td>
<td>N</td>
<td>商家运费补贴; 单位分</td>
<td>200</td>
</tr>
<tr>
<td>orderSettlement</td>
<td>Long(20) </td>
<td>N</td>
<td>应结金额; 单位分(只有正向有,逆向为0)</td>
<td>4000</td>
</tr>
<tr>
<td>totalPrice</td>
<td>Long(20) </td>
<td>N</td>
<td>用户支付金额; 单位分(只有正向有,逆向为0)</td>
<td>3000</td>
</tr>
<tr>
<td>channelCommission</td>
<td>Long(20) </td>
<td>N</td>
<td>渠道佣金;单位分(只有正向有,逆向为0))</td>
<td>500</td>
</tr>
<tr>
<td>jdSkyChoose</td>
<td>int </td>
<td>Y</td>
<td>订单标记,0普通订单 ,20小时购, 23天选</td>
<td>0</td>
</tr>
<tr>
<td>daySeq</td>
<td>int </td>
<td>N</td>
<td>门店当天流水号(仅正向单有)</td>
<td>1</td>
</tr>
<tr>
<td>recipientName</td>
<td>String </td>
<td>N</td>
<td>收件人姓名(仅正向单有)</td>
<td>王某某</td>
</tr>
<tr>
<td>recipientPhone</td>
<td>String </td>
<td>N</td>
<td>收件人联系方式,如果是隐私号会传隐私号(仅正向单有)</td>
<td>13883632885,6885</td>
</tr>
<tr>
<td>recipientAddress</td>
<td>String </td>
<td>N</td>
<td>收件人地址(仅正向单有) --此字段需要联系HB技术人员开通</td>
<td>上海市徐汇区乐山路19号xxxxx</td>
</tr>
<tr>
<td>productList</td>
<td>List<Object> </td>
<td>Y</td>
<td>商品明细</td>
<td>参照如下</td>
</tr>
</tbody>
</table>
<h5>二级参数Object类属性::</h5>
<table>
<thead>
<tr>
<th>字段</th>
<th>类型</th>
<th>必填</th>
<th>描述</th>
<th>示例</th>
</tr>
</thead>
<tbody>
<tr>
<td>outSkuId</td>
<td>String(100)</td>
<td>Y</td>
<td>商家 skuId</td>
<td>4997</td>
</tr>
<tr>
<td>skuUpc</td>
<td>String(255)</td>
<td>Y</td>
<td>商品 UPC 编码</td>
<td>6903102103270</td>
</tr>
<tr>
<td>serialNumberList</td>
<td>String(500)</td>
<td>N</td>
<td>仓库id:串码仓库id:串码</td>
<td>k50057:SF6MDX2SPQ1YGk50057:SF6MDX2SPQ1YG</td>
</tr>
<tr>
<td>skuCount</td>
<td>double(20)</td>
<td>Y</td>
<td>商品数量(非标品按kg,标品按个数)</td>
<td>3</td>
</tr>
<tr>
<td>goodId</td>
<td>String</td>
<td>Y</td>
<td>商品编码</td>
<td>4483384</td>
</tr>
<tr>
<td>skuPrice</td>
<td>long(20)</td>
<td>Y</td>
<td>商品原始单价; 单位分(订单里的原单价,标品表示每个的单价,非标品表示每份的单价)</td>
<td>12</td>
</tr>
<tr>
<td>payValue</td>
<td>long(20)</td>
<td>Y</td>
<td>核销金额,根据海博核销公式计算的金额,通常用于ERP的销售收入金额;(正、逆向核销金额均为正数); 单位分</td>
<td>25</td>
</tr>
<tr>
<td>discountValue</td>
<td>long(20)</td>
<td>N</td>
<td>优惠金额,默认为 0</td>
<td>0</td>
</tr>
<tr>
<td>promotionCode</td>
<td>String(100)</td>
<td>N</td>
<td>ERP促销单号</td>
<td>2021061101236671</td>
</tr>
<tr>
<td>verderCode</td>
<td>String(100)</td>
<td>N</td>
<td>供应商编码</td>
<td>90001</td>
</tr>
<tr>
<td>venderSubsidy</td>
<td>long(20)</td>
<td>N</td>
<td>供应商补贴; 单位分</td>
<td>0</td>
</tr>
<tr>
<td>merchantSingleProductSubsidy</td>
<td>long(20)</td>
<td>N</td>
<td>商家单品补贴,单位分</td>
<td>0</td>
</tr>
<tr>
<td>platformSingleProductSubsidy</td>
<td>long(20)</td>
<td>N</td>
<td>平台单品补贴,单位分</td>
<td>0</td>
</tr>
<tr>
<td>bussinessSubsidy</td>
<td>long(20)</td>
<td>N</td>
<td>商家整单补贴,单位分</td>
<td>0</td>
</tr>
<tr>
<td>platformSubsidy</td>
<td>long(20)</td>
<td>N</td>
<td>平台整单补贴,单位分</td>
<td>0</td>
</tr>
<tr>
<td>productPromotionSubsidy</td>
<td>long(20)</td>
<td>N</td>
<td>到家补贴商家推广费-单品,单位分</td>
<td>0</td>
</tr>
<tr>
<td>orderPromotionSubsidy</td>
<td>long(20)</td>
<td>N</td>
<td>到家补贴商家推广费-整单,单位分</td>
<td>0</td>
</tr>
</tbody>
</table>
<h5>对接字段使用参考</h5>
<table>
<thead>
<tr>
<th>类型</th>
<th>品名/货号</th>
<th>原价(四舍五入)</th>
<th>售价</th>
<th>数量</th>
<th>小计</th>
<th>优惠(商家补贴)</th>
<th>单位</th>
</tr>
</thead>
<tbody>
<tr>
<td>标品</td>
<td>ERP查/goodId</td>
<td>(payValue+商家补贴)/skuCount</td>
<td>payValue/skuCount</td>
<td>skuCount</td>
<td>payValue</td>
<td>商家整单补贴(分) + 商家单品补贴 (分)</td>
<td>个</td>
</tr>
<tr>
<td>非标品</td>
<td>ERP查/goodId</td>
<td>(payValue+商家补贴)/skuCount</td>
<td>payValue/skuCount</td>
<td>skuCount</td>
<td>payValue</td>
<td>商家整单补贴(分) + 商家单品补贴 (分)</td>
<td>千克</td>
</tr>
<tr>
<td>平台优惠</td>
<td>不处理</td>
<td>不处理</td>
<td>不处理</td>
<td>不处理</td>
<td>不处理</td>
<td>不处理</td>
<td>不处理</td>
</tr>
<tr>
<td>配送费</td>
<td>不处理</td>
<td>不处理</td>
<td>不处理</td>
<td>不处理</td>
<td>不处理</td>
<td>不处理</td>
<td>不处理</td>
</tr>
<tr>
<td>包装费</td>
<td>不处理</td>
<td>不处理</td>
<td>不处理</td>
<td>不处理</td>
<td>不处理</td>
<td>不处理</td>
<td>不处理</td>
</tr>
<tr>
<td>商家优惠合计</td>
<td>=sum(商家补贴)</td>
</tr>
<tr>
<td>订单合计</td>
<td>=sum(skuCount)</td>
<td>=sum(payValue</td>
</tr>
<tr>
<td>优惠合计</td>
<td>商家补贴 = bussinessSubsidy+merchantSingleProductSubsidy</td>
</tr>
</tbody>
</table>
<p>{
"channel": "1",
"channelCommission": 5,
"channelOrderId": "2410922570002791",
"createTime": 1714961024000,
"deliveryFee": 0,
"jdSkyChoose": 0,
"orderSettlement": 145,
"outStationNo": "EW_N2100428432",
"platformSubsidyAll": 0,
"productList": [
{
"bussinessSubsidy": 0,
"changeId": 0,
"discountValue": 0,
"goodId": "6921168511280",
"merchantSingleProductSubsidy": 0,
"outSkuId": "6921168511280",
"payValue": 150,
"platformSingleProductSubsidy": 0,
"platformSubsidy": 0,
"shippingFeeVenderSubsidy": 0,
"skuCount": 1,
"skuPrice": 150,
"skuUpc": "050200071"
}
],
"refund": false,
"totalPrice": 270,
"transactionId": "JDDJ2410922570002791_1",
"updateTime": 1714961047288,
"venderDeliverySubsidy": 0,
"vipCode": ""
}</p>
<h4>大小包装商品回传</h4>
<table>
<thead>
<tr>
<th>商品接口</th>
<th>商品同步接口(商家级)</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>关键字段1</td>
<td>goodsId</td>
<td>ERP商品编码</td>
</tr>
<tr>
<td>关键字段2</td>
<td>outSkuId</td>
<td>商品编码,如果是箱包品和单品共用ERP商品编号的话,则箱包品的outSkuId=goodsId+”_”+upc,其他情况下outSkuId=goodsid</td>
</tr>
<tr>
<td>关键字段3</td>
<td>commodityType</td>
<td>商品编码类型 1 单品码 2 大码</td>
</tr>
</tbody>
</table>
<p>例如:农夫山泉,1包12瓶</p>
<p>假如:ERP系统最小单位维护100瓶;大小码库存接口,都传100,线上会自动根据档案转换系数,转成包;</p>
<h4>测试数据</h4>
<p><a href="http://clubmall.liantuofu.com/api/hiboos/synchronization/goodsInfo?sign=bf0a06b04c4df44f3d5fbdaa119a1d54&appId=EW_N8296826968&jsonRequest=[{"goodsId":"wy690045189702801","outSkuId":"wy690045189702801","commodityType":1,"productRatio":1,"skuName":"农夫山泉">http://clubmall.liantuofu.com/api/hiboos/synchronization/goodsInfo?sign=bf0a06b04c4df44f3d5fbdaa119a1d54&appId=EW_N8296826968&jsonRequest=[{"goodsId":"wy690045189702801","outSkuId":"wy690045189702801","commodityType":1,"productRatio":1,"skuName":"农夫山泉</a> 饮用天然水550ml","skuType":"1","weight":550,"upc":"6921168509256","venderCategoryCodeLevel3":"0504","unit":"瓶","spec":"500ML"}]&random=2024062601332051217&type=hb
{"code":"SUCCESS","msg":"同步成功","success":true}
<a href="http://clubmall.liantuofu.com/api/hiboos/synchronization/goodsInfo?sign=4858317ac3c155e60d274401f6c43d3e&appId=EW_N8296826968&jsonRequest=[{"goodsId":"wy690045189702815","outSkuId":"wy690045189702815","commodityType":2,"productRatio":12,"skuName":"【包】农夫山泉">http://clubmall.liantuofu.com/api/hiboos/synchronization/goodsInfo?sign=4858317ac3c155e60d274401f6c43d3e&appId=EW_N8296826968&jsonRequest=[{"goodsId":"wy690045189702815","outSkuId":"wy690045189702815","commodityType":2,"productRatio":12,"skuName":"【包】农夫山泉</a> 饮用天然水550mlX12","skuType":"1","weight":6000,"upc":"6921168595747","venderCategoryCodeLevel3":"0504","unit":"包","spec":"500ML*12"}]&random=2024062601332051217&type=hb
{"code":"SUCCESS","msg":"同步成功","success":true}
<a href="http://clubmall.liantuofu.com/api/hiboos/synchronization/goodsPrice?sign=b8189a5c6546e7edf479757e1758e2a7&appId=EW_N8296826968&jsonRequest={"outStationNo":"EW_N2100428432","prices":[{"outSkuId":"wy690045189702801","goodsId":"wy690045189702801","basicPrice":250,"originalPrice":250,"offlineSaleStatus":1,"productType":2}]}&random=2024062601332057090&type=hb">http://clubmall.liantuofu.com/api/hiboos/synchronization/goodsPrice?sign=b8189a5c6546e7edf479757e1758e2a7&appId=EW_N8296826968&jsonRequest={"outStationNo":"EW_N2100428432","prices":[{"outSkuId":"wy690045189702801","goodsId":"wy690045189702801","basicPrice":250,"originalPrice":250,"offlineSaleStatus":1,"productType":2}]}&random=2024062601332057090&type=hb</a>
{"code":"SUCCESS","msg":"同步成功","success":true}
<a href="http://clubmall.liantuofu.com/api/hiboos/synchronization/goodsStock?sign=33ad8632432e620d6d17a33d9c4688fb&appId=EW_N8296826968&jsonRequest={"outStationNo":"EW_N2100428432","stocks":[{"outSkuId":"wy690045189702801","goodsId":"wy690045189702801","stock":72}]}&random=2024062601332065005&type=hb">http://clubmall.liantuofu.com/api/hiboos/synchronization/goodsStock?sign=33ad8632432e620d6d17a33d9c4688fb&appId=EW_N8296826968&jsonRequest={"outStationNo":"EW_N2100428432","stocks":[{"outSkuId":"wy690045189702801","goodsId":"wy690045189702801","stock":72}]}&random=2024062601332065005&type=hb</a>
{"code":"SUCCESS","msg":"同步成功","success":true}
<a href="http://clubmall.liantuofu.com/api/hiboos/synchronization/goodsPrice?sign=f15e140009158e747ec643824dde1f71&appId=EW_N8296826968&jsonRequest={"outStationNo":"EW_N2100428432","prices":[{"outSkuId":"wy690045189702815","goodsId":"wy690045189702815","basicPrice":3000,"originalPrice":3000,"offlineSaleStatus":1,"productType":2}]}&random=2024062601332057090&type=hb">http://clubmall.liantuofu.com/api/hiboos/synchronization/goodsPrice?sign=f15e140009158e747ec643824dde1f71&appId=EW_N8296826968&jsonRequest={"outStationNo":"EW_N2100428432","prices":[{"outSkuId":"wy690045189702815","goodsId":"wy690045189702815","basicPrice":3000,"originalPrice":3000,"offlineSaleStatus":1,"productType":2}]}&random=2024062601332057090&type=hb</a>
{"code":"SUCCESS","msg":"同步成功","success":true}
<a href="http://clubmall.liantuofu.com/api/hiboos/synchronization/goodsStock?sign=8e1672f157172c2199e491e15bbb9f37&appId=EW_N8296826968&jsonRequest={"outStationNo":"EW_N2100428432","stocks":[{"outSkuId":"wy690045189702815","goodsId":"wy690045189702815","stock":36}]}&random=2024062601332065005&type=hb">http://clubmall.liantuofu.com/api/hiboos/synchronization/goodsStock?sign=8e1672f157172c2199e491e15bbb9f37&appId=EW_N8296826968&jsonRequest={"outStationNo":"EW_N2100428432","stocks":[{"outSkuId":"wy690045189702815","goodsId":"wy690045189702815","stock":36}]}&random=2024062601332065005&type=hb</a>
{"code":"SUCCESS","msg":"同步成功","success":true}</p>