注意:以下文档只适用于TOP接口,请谨慎使用!

文档中心 > API类目 > 阿里健康API

taobao.drug.quantity.batch.update (批量同步库存接口)

商家通过top接口可以批量修改商品库存

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
out_store_id String 必须 shop1234 外部店铺ID
out_item_id_quantity_map Json 必须 {"1234":89,"45467":99} 商品ID和库存

响应参数

名称 类型 示例值 描述
result Result 接口返回model
  • └ msg_code
  • String
  • 155
  • 错误编号
  • └ msg_info
  • String
  • {\“012211334\”:\"未找到商品\",\“012211335\”:\"更新库存失败\"}
  • 错误信息
  • └ success
  • Boolean
  • true
  • 请求的接口是否成功

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
DrugQuantityBatchUpdateRequest req = new DrugQuantityBatchUpdateRequest();
req.setOutStoreId("shop1234");
req.setOutItemIdQuantityMapString("{\"1234\":89,\"45467\":99}");
DrugQuantityBatchUpdateResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<drug_quantity_batch_update_response>
    <result>
        <msg_code>155</msg_code>
        <msg_info>{\“012211334\”:\&quot;未找到商品\&quot;,\“012211335\”:\&quot;更新库存失败\&quot;}</msg_info>
        <success>true</success>
    </result>
</drug_quantity_batch_update_response>

异常示例

  • XML示例
  • JSON示例
<error_response>
    <code>50</code>
    <msg>Remote service error</msg>
    <sub_code>isv.invalid-parameter</sub_code>
    <sub_msg>非法参数</sub_msg>
</error_response>

错误码解释

错误码 错误描述 解决方案

API工具

如何获得此API

FAQ

返回
顶部