5.6 获取渠道门店商品库存
<p>[TOC]</p>
<h3>5.6 获取渠道门店商品库存</h3>
<p>>接口方向:第三方平台 ----> 海王星辰
<br>
<code>使用该接口无法获取虚拟仓、组合商品、疗程商品库存,建议主要通过 “4.5 同步经营门店库存”</code>
<code>主要使用该接口来同步库存:</code><a href="https://www.showdoc.com.cn/nephealth/10201057146161073">“4.5 同步经营门店库存”</a>
<a href="https://www.showdoc.com.cn/nephealth/10201057146161073">https://www.showdoc.com.cn/nephealth/10201057146161073</a></p>
<p><br><br>
> - Url路径:{appKey}/getStock</p>
<h4>5.6.1 接口请求模型</h4>
<table>
<thead>
<tr>
<th>参数代码 </th>
<th>参数类型参数类型</th>
<th>参数长度</th>
<th>代码标识说明</th>
<th>是否非空</th>
<th>说明 </th>
</tr>
</thead>
<tbody>
<tr>
<td>pharmacyCode</td>
<td>string </td>
<td>4 </td>
<td> </td>
<td>Y </td>
<td>门店编码 获取仓库库存时 编码为01</td>
</tr>
<tr>
<td>barcodes </td>
<td>List<string> </td>
<td> </td>
<td> </td>
<td> </td>
<td>商品编码集合(最大100个)</td>
</tr>
</tbody>
</table>
<p>> 门店编码通过接口[5.4 获取门店列表(仅限O2O)]( <a href="https://www.showdoc.com.cn/nephealth/10201051945622334">https://www.showdoc.com.cn/nephealth/10201051945622334</a>) 来获取门店编码;
获取B2C 仓库库存时 编码为01</p>
<p><br></p>
<h4>5.6.2 接口返回模型</h4>
<table>
<thead>
<tr>
<th>参数代码</th>
<th>参数类型参数类型 </th>
<th>参数长度</th>
<th>代码标识说明</th>
<th>是否非空</th>
<th>说明 </th>
</tr>
</thead>
<tbody>
<tr>
<td>products</td>
<td>List<getStockModel></td>
<td> </td>
<td> </td>
<td>Y </td>
<td>商品集合</td>
</tr>
</tbody>
</table>
<p>getStockModel </p>
<table>
<thead>
<tr>
<th>参数代码</th>
<th>参数类型参数类型</th>
<th>参数长度</th>
<th>代码标识说明</th>
<th>是否非空</th>
<th>说明 </th>
</tr>
</thead>
<tbody>
<tr>
<td>barcode </td>
<td>string </td>
<td>7 </td>
<td> </td>
<td>Y </td>
<td>商品编码</td>
</tr>
<tr>
<td>siteNo </td>
<td>string </td>
<td>100 </td>
<td> </td>
<td>Y </td>
<td>地点编号</td>
</tr>
<tr>
<td>quantity</td>
<td>number </td>
<td>16,2 </td>
<td> </td>
<td>Y </td>
<td>可用库存</td>
</tr>
</tbody>
</table>
<h4>5.6.3 Demo:</h4>
<p>Request:</p>
<pre><code>{
&quot;appKey&quot;:&quot;NepHealth&quot;,
&quot;nonce&quot;:&quot;Tdsad2saa2a&quot;,
&quot;timestamp&quot;:1639119614,
&quot;sign&quot;:&quot;a1f8f760de8edfe74b3b7bb9d9c51e4379abfbdb1&quot;,
&quot;input&quot;:{
&quot;pharmacyCode&quot;:&quot;SC12&quot;,
&quot;barcodes&quot;:[&quot;0000001&quot;,&quot;0000002&quot;]
}
}</code></pre>
<p>Response:</p>
<pre><code>{
&quot;code&quot;: 200,
&quot;msg&quot;: &quot;ok&quot;,
&quot;nonce&quot;: &quot;Tdsad2saa2a&quot;,
&quot;output&quot;: {
&quot;products&quot;: [
{
&quot;quantity&quot;: 2,
&quot;barcode&quot;: &quot;0000001&quot;,
&quot;siteNo&quot;: &quot;SC12&quot;
},
{
&quot;barcode&quot;: &quot;0000002&quot;,
&quot;siteNo&quot;: &quot;SC12&quot;,
&quot;quantity&quot;: 0
}
]
}
}</code></pre>