建议使用新接口:tmall.inventory.query.forstore ,新ISV不推荐使用。 商家查询商品总体库存信息
名称 | 类型 | 是否必须 | 示例值 | 更多限制 | 描述 |
---|---|---|---|---|---|
sc_item_ids | String | 必须 | 1234^2456 | 后端商品ID 列表,控制到50个 | |
sc_item_codes | String | 可选 | GLY201210120001^GLY23214141 | 后端商品的商家编码列表,控制到50个 | |
seller_nick | String | 可选 | Nike | 卖家昵称 | |
store_codes | String | 可选 | GLY001^GLY002 | 仓库列表:GLY001^GLY002 |
名称 | 类型 | 示例值 | 描述 | ||||
---|---|---|---|---|---|---|---|
item_inventorys | InventorySum [] | 商品总体库存信息 | |||||
|
|||||||
tip_infos | TipInfo [] | 提示信息,提示不存在的后端商品 | |||||
|
1 2 3 4 5 6 7 8 | TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret); InventoryQueryRequest req = new InventoryQueryRequest(); req.setScItemIds( "1234^2456" ); req.setScItemCodes( "GLY201210120001^GLY23214141" ); req.setSellerNick( "Nike" ); req.setStoreCodes( "GLY001^GLY002" ); InventoryQueryResponse rsp = client.execute(req, sessionKey); System.out.println(rsp.getBody()); |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | < inventory_query_response > < item_inventorys > < inventory_sum > < reserve_quantity >40</ reserve_quantity > < inventory_type >1</ inventory_type > < store_code >ABC0001</ store_code > < inventory_type_name >正常</ inventory_type_name > < sc_item_id >0</ sc_item_id > < sc_item_code >1234</ sc_item_code > < quantity >100</ quantity > < occupy_quantity >60</ occupy_quantity > </ inventory_sum > </ item_inventorys > < tip_infos > < tip_info > < sc_item_id >demo</ sc_item_id > < info >demo</ info > </ tip_info > </ tip_infos > </ inventory_query_response > |
1 2 3 4 5 6 | < 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:00005 | 必填参数为空 | 请传入有效参数。 |
isv.inventory-error:20002 | 后端商品不存在 | 请传入有效后端商品。 |
isv.inventory-error:00006 | 数据库访问错误 | 请稍候再试。 |
isv.inventory-error:20006 | 商品ID非数字错误 | 检查商品ID |
isv.inventory-error:20005 | 库存查询商品数量过多 | 减少查询商品数量 |