文档中心 > API类目 > 新零售供应链API

alibaba.ascp.channel.distributor.inventory.get (链渠道中心淘外库存查询)

此api为淘外分销的渠道产品库存查询标准api,淘外分销商专用

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
inventory_request ChannelInventoryQuery 可选 入参
  • └ product_id
  • String
  • 可选
  • 572261812004
  • 产品ID
  • └ sub_channel_code
  • String
  • 必须
  • tmallglobal_blackUnique
  • 二级渠道
  • └ sku_id
  • String
  • 可选
  • 4581686065806
  • skuId
  • └ product_type
  • String
  • 可选
  • 无需传
  • 默认不需传
  • └ channel_code
  • String
  • 必须
  • tmallglobal
  • 一级渠道
  • └ province_name
  • String
  • 可选
  • 浙江省
  • └ city_name
  • String
  • 可选
  • 杭州市
  • └ area_name
  • String
  • 可选
  • 余杭区

响应参数

名称 类型 示例值 描述
result ResultDto a 异步获取历史数据接口返回结果
  • └ trace_id
  • String
  • aadfasdfa
  • 调用链路ID
  • └ success
  • Boolean
  • true
  • 执行结果
  • datas
  • ChannelInventoryDto []
  • 结果
  • └ quantity
  • String
  • 9
  • 库存数量
  • └ product_id
  • String
  • 572261812004
  • 产品ID
  • └ sub_channel_code
  • String
  • tmallglobal_blackUnique
  • 二级渠道
  • └ sku_id
  • String
  • 4581686065806
  • skuId
  • └ channel_code
  • String
  • tmallglobal
  • 市场
  • └ error_message
  • String
  • 错误信息
  • 错误码
  • └ error_code
  • String
  • 错误码
  • 错误码

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaAscpChannelDistributorInventoryGetRequest req = new AlibabaAscpChannelDistributorInventoryGetRequest();
AlibabaAscpChannelDistributorInventoryGetRequest.ChannelInventoryQuery obj1 = new AlibabaAscpChannelDistributorInventoryGetRequest.ChannelInventoryQuery();
obj1.setProductId("572261812004");
obj1.setSubChannelCode("tmallglobal_blackUnique");
obj1.setSkuId("4581686065806");
obj1.setProductType("无需传");
obj1.setChannelCode("tmallglobal");
obj1.setProvinceName("浙江省");
obj1.setCityName("杭州市");
obj1.setAreaName("余杭区");
req.setInventoryRequest(obj1);
AlibabaAscpChannelDistributorInventoryGetResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<alibaba_ascp_channel_distributor_inventory_get_response>
    <result>
        <trace_id>aadfasdfa</trace_id>
        <success>true</success>
        <datas>
            <channel_inventory_dto>
                <quantity>9</quantity>
                <product_id>572261812004</product_id>
                <sub_channel_code>tmallglobal_blackUnique</sub_channel_code>
                <sku_id>4581686065806</sku_id>
                <channel_code>tmallglobal</channel_code>
            </channel_inventory_dto>
        </datas>
        <error_message>错误信息</error_message>
        <error_code>错误码</error_code>
    </result>
</alibaba_ascp_channel_distributor_inventory_get_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

返回
顶部