taobao.inventory.initial (库存初始化)

建议使用新接口:taobao.inventory.merchant.adjust ,该接口会逐步停用。 商家仓库存初始化接口,直接按照商家指定的商品库存数进行填充,没有单据核对,不参与库存对账。

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
store_code String 必须 ABC0001 商家仓库编码
items String 必须 [{"scItemId":"12345","scItemCode":"GLY0001","inventoryType":"1","quantity":"111"}] 商品初始库存信息: [{"scItemId":"商品后端ID,如果有传scItemCode,参数可以为0","scItemCode":"商品商家编码","inventoryType":"库存类型 1:正常,2:损坏,3:冻结,10:质押,11-20:用户自定义","quantity":"数量"}]

响应参数

名称 类型 示例值 描述
tip_infos TipInfo [] 提示信息 提示信息
  • └ sc_item_id
  • String
  • demo
  • 商品id
  • └ info
  • String
  • demo
  • 返回信息

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
InventoryInitialRequest req = new InventoryInitialRequest();
req.setStoreCode("ABC0001");
req.setItems("[{\"scItemId\":\"12345\",\"scItemCode\":\"GLY0001\",\"inventoryType\":\"1\",\"quantity\":\"111\"}]");
InventoryInitialResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<inventory_initial_response>
    <tip_infos>
        <tip_info>
            <sc_item_id>demo</sc_item_id>
            <info>demo</info>
        </tip_info>
    </tip_infos>
</inventory_initial_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>

错误码解释

错误码 错误描述 解决方案
isv.inventory-error:40001 不能使用该服务 请检查是否订阅了该服务
isv.inventory-error:30006 明细为空 请传入明细信息。
isv.inventory-error:00001 JSON解析异常 请检查商品初始库存信息的JSON格式。
isv.inventory-error:20002 后端商品不存在 请检查商品信息是否正确。
isv.inventory-error:00000 未知异常 未知异常
isv.inventory-error:00006 数据库访问错误 请检查是否重复初始化
isv.inventory-error:20004 该商品已初始化 请不要重复初始化
isv.inventory-error: 30001 错误的商品库存类型 请选择正确的商品类型
isv.inventory-error:30017 库存为负数 修改初始化的库存数量

API工具

如何获得此API

FAQ

返回
顶部