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

taobao.inventory.shopinv.adjust (编辑闪购门店库存)

远场前端+近场闪购门店库存模式下,编辑闪购门店库存

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
shop_inventory_edit ShopInventoryEditDTO 必须 库存编辑对象
  • └ order_id
  • String
  • 必须
  • mainOrderId1
  • 库存编辑请求的主单据号。不是幂等字段
  • └ store_id
  • Number
  • 必须
  • 111111111
  • 在商户创建的门店的门店id
  • └ check_mode
  • Number
  • 必须
  • 2
  • 1:全量更新 2: 出入库盘盈盘亏
  • detail_list
  • ShopInventoryEditDetailDTO []
  • 必须
  • 子单号list
  • 库存编辑明细,一次最多不超过20条明细
  • └ item_id
  • Number
  • 必须
  • 1231111
  • 商品id
  • └ sku_id
  • Number
  • 必须
  • 0
  • skuid,若商品无sku,则填0。若有sku需要填对应skuid
  • └ sub_order_id
  • String
  • 必须
  • subOrderId1
  • 子单据号,作为业务调整依据,幂等字段,处理时会根据此单据号作幂等
  • └ quantity
  • Number
  • 必须
  • 1
  • 调整数量,增量编辑时,正数盘盈,负数盘亏;全量编辑时,全量覆盖
  • └ recover_deleted_data
  • Boolean
  • 必须
  • true
  • 对于删除过的库存行,是否支持重新激活后编辑库存。若为false,想要编辑的品的门店库存曾经存在过且被删除过,那么会报错。系统默认值为false

响应参数

名称 类型 示例值 描述
result SingleResult result result
  • └ error_message
  • String
  • errorMessage
  • 错误信息
  • └ error_code
  • String
  • IP_ILLEGAL_ARGUMENT
  • 错误码
  • └ success
  • Boolean
  • false
  • 如果是失败,可能是部分失败。如果是成功,则全部成功。成功,有可能是本次操作成功,也可能是本次的单据已经被操作过,本次不需要操作,幂等成功。需要看子单据的详情
  • data
  • ShopInventoryEditResultDTO []
  • 成功的结果对象
  • └ error_msg
  • String
  • errorMsg
  • 错误信息
  • └ error_code
  • String
  • errorCode
  • 错误码
  • └ success
  • Boolean
  • false
  • 每个子调整单据是否成功
  • └ idempotent
  • Boolean
  • false
  • 是否幂等成功。幂等成功代表本次的单据已经被操作过,本次不需要操作,幂等成功。
  • └ sub_order_id
  • String
  • subOrderId1
  • 子单据号,作为业务调整依据,处理时会根据此单据号作幂等
  • └ idempotent_reason
  • String
  • 已处理过
  • 幂等原因,幂等情况下可以做参考,可能不一定都有值

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
InventoryShopinvAdjustRequest req = new InventoryShopinvAdjustRequest();
InventoryShopinvAdjustRequest.ShopInventoryEditDTO obj1 = new InventoryShopinvAdjustRequest.ShopInventoryEditDTO();
obj1.setOrderId("mainOrderId1");
obj1.setStoreId(111111111L);
obj1.setCheckMode(2L);
List<InventoryShopinvAdjustRequest.ShopInventoryEditDetailDTO> list3 = new ArrayList<InventoryShopinvAdjustRequest.ShopInventoryEditDetailDTO>();
InventoryShopinvAdjustRequest.ShopInventoryEditDetailDTO obj4 = new InventoryShopinvAdjustRequest.ShopInventoryEditDetailDTO();
list3.add(obj4);
obj4.setItemId(1231111L);
obj4.setSkuId(0L);
obj4.setSubOrderId("subOrderId1");
obj4.setQuantity(1L);
obj1.setDetailList(list3);
obj1.setRecoverDeletedData(true);
req.setShopInventoryEdit(obj1);
InventoryShopinvAdjustResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<inventory_shopinv_adjust_response>
    <result>
        <error_message>errorMessage</error_message>
        <error_code>IP_ILLEGAL_ARGUMENT</error_code>
        <success>false</success>
        <data>
            <shop_inventory_edit_result_d_t_o>
                <error_msg>errorMsg</error_msg>
                <error_code>errorCode</error_code>
                <success>false</success>
                <idempotent>false</idempotent>
                <sub_order_id>subOrderId1</sub_order_id>
                <idempotent_reason>已处理过</idempotent_reason>
            </shop_inventory_edit_result_d_t_o>
        </data>
    </result>
</inventory_shopinv_adjust_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

返回
顶部