4.5 同步经营门店库存
<p>[TOC]</p>
<h3>4.5 同步经营门店库存</h3>
<p>> - Url路径:[建议]setStock</p>
<h4>4.5.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>门店号 V1.3加入</td>
</tr>
<tr>
<td>stockList </td>
<td>List<setStockModel></td>
<td> </td>
<td> </td>
<td> </td>
<td>库存集合 </td>
</tr>
</tbody>
</table>
<p>setStockModel</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>quantity</td>
<td>number </td>
<td>16,2 </td>
<td> </td>
<td>Y </td>
<td>可用库存</td>
</tr>
</tbody>
</table>
<h4>4.5.2 接口返回模型</h4>
<table>
<thead>
<tr>
<th>参数名称</th>
<th>参数类型</th>
<th>参数长度</th>
<th>代码标识说明</th>
<th>必填</th>
<th>说明 </th>
</tr>
</thead>
<tbody>
<tr>
<td>code </td>
<td>int </td>
<td>3 </td>
<td>Y </td>
<td>Y </td>
<td>成功标识 200:成功 -1:失败/异常</td>
</tr>
<tr>
<td>msg </td>
<td>string </td>
<td>200 </td>
<td> </td>
<td>Y </td>
<td>返回信息 </td>
</tr>
<tr>
<td>output </td>
<td>object </td>
<td> </td>
<td> </td>
<td> </td>
<td>返回数据 </td>
</tr>
<tr>
<td>nonce </td>
<td>string </td>
<td>200 </td>
<td> </td>
<td>Y </td>
<td>请求时的nonce原样返回 </td>
</tr>
</tbody>
</table>
<h4>4.5.3 Demo:</h4>
<p>Request:</p>
<pre><code>{
&quot;appKey&quot;: &quot;NepHealth&quot;,
&quot;input&quot;: {
&quot;pharmacyCode&quot;: &quot;K502&quot;,
&quot;stockList&quot;: [{
&quot;barcode&quot;: &quot;0000001&quot;,
&quot;quantity&quot;: 0.00
}, {
&quot;barcode&quot;: &quot;0000035&quot;,
&quot;quantity&quot;: 2.00
}, {
&quot;barcode&quot;: &quot;0000065&quot;,
&quot;quantity&quot;: 3.00
}]
},
&quot;nonce&quot;: &quot;c212b542-f177-4a82-b42c-1d402bc2f404&quot;,
&quot;sign&quot;: &quot;b4c75914177f6cc2406e8fcd6274e6e6e71794dd&quot;,
&quot;timestamp&quot;: 1646619589
}</code></pre>
<p>Response:</p>
<pre><code>{
&quot;code&quot;: 200,
&quot;msg&quot;: &quot;ok&quot;,
&quot;nonce&quot;: &quot;c212b542-f177-4a82-b42c-1d402bc2f404&quot;,
&quot;output&quot;: null
}
</code></pre>