文档中心 > API类目 > 物流宝API

cainiao.merchant.inventory.adjust (商家库存调整)

商家仓库存调整接口,目前仅支持全量更新

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
adjust_request MerStoreInvAdjustDto [] 必须
  • 最大列表长度:20
  • 商家仓编辑库存
    • └ inventory_type
    • Number
    • 必须
    • 1
    • 库存类型
    • └ attribute
    • String
    • 可选
    • {"key":value}
    • 扩展属性
    • └ quantity
    • Number
    • 必须
    • 1000
    • 数量
    • └ out_biz_code
    • String
    • 必须
    • 314635c2-110a-8ad2-29a7-0759ed03aec0
    • 外部操作唯一编码
    • └ store_code
    • String
    • 必须
    • STORE_229711
    • 仓库编码
    • └ sc_item_id
    • Number
    • 必须
    • 2300944364023
    • 货品id
    app_name String 必须 top 调用方应用名
    operation String 可选 update 操作

    响应参数

    名称 类型 示例值 描述
    result SingleResultDto result
    • └ error_code
    • String
    • errorCode
    • └ error_message
    • String
    • errorMessage
    • └ flag
    • Boolean
    • success

    请求示例

    • JAVA
    • .NET
    • PHP
    • CURL
    • Python
    • C/C++
    • NodeJS
    TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
    CainiaoMerchantInventoryAdjustRequest req = new CainiaoMerchantInventoryAdjustRequest();
    List<CainiaoMerchantInventoryAdjustRequest.MerStoreInvAdjustDto> list2 = new ArrayList<CainiaoMerchantInventoryAdjustRequest.MerStoreInvAdjustDto>();
    CainiaoMerchantInventoryAdjustRequest.MerStoreInvAdjustDto obj3 = new CainiaoMerchantInventoryAdjustRequest.MerStoreInvAdjustDto();
    list2.add(obj3);
    obj3.setInventoryType(1L);
    obj3.setAttribute("{\"key\":value}");
    obj3.setQuantity(1000L);
    obj3.setOutBizCode("314635c2-110a-8ad2-29a7-0759ed03aec0");
    obj3.setStoreCode("STORE_229711");
    obj3.setScItemId(2300944364023L);
    req.setAdjustRequest(list2);
    req.setAppName("top");
    req.setOperation("update");
    CainiaoMerchantInventoryAdjustResponse rsp = client.execute(req, sessionKey);
    System.out.println(rsp.getBody());

    响应示例

    • XML示例
    • JSON示例
    <cainiao_merchant_inventory_adjust_response>
        <result>
            <error_code></error_code>
            <error_message></error_message>
            <flag></flag>
        </result>
    </cainiao_merchant_inventory_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

    返回
    顶部