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());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlibabaAscpChannelDistributorInventoryGetRequest req = new AlibabaAscpChannelDistributorInventoryGetRequest();
AlibabaAscpChannelDistributorInventoryGetRequest.ChannelInventoryQueryDomain obj1 = new AlibabaAscpChannelDistributorInventoryGetRequest.ChannelInventoryQueryDomain();
obj1.ProductId = "572261812004";
obj1.SubChannelCode = "tmallglobal_blackUnique";
obj1.SkuId = "4581686065806";
obj1.ProductType = "无需传";
obj1.ChannelCode = "tmallglobal";
obj1.ProvinceName = "浙江省";
obj1.CityName = "杭州市";
obj1.AreaName = "余杭区";
req.InventoryRequest_ = obj1;
AlibabaAscpChannelDistributorInventoryGetResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlibabaAscpChannelDistributorInventoryGetRequest;
$inventory_request = new ChannelInventoryQuery;
$inventory_request->product_id="572261812004";
$inventory_request->sub_channel_code="tmallglobal_blackUnique";
$inventory_request->sku_id="4581686065806";
$inventory_request->product_type="无需传";
$inventory_request->channel_code="tmallglobal";
$inventory_request->province_name="浙江省";
$inventory_request->city_name="杭州市";
$inventory_request->area_name="余杭区";
$req->setInventoryRequest(json_encode($inventory_request));
$resp = $c->execute($req, $sessionKey);
curl -X POST 'http://gw.api.taobao.com/router/rest' \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'app_key=12129701' \
-d 'format=json' \
-d 'method=alibaba.ascp.channel.distributor.inventory.get' \
-d 'partner_id=apidoc' \
-d 'session=42604324-982d-48d0-8ef4-1481752a8a13' \
-d 'sign=F950480179EC8EF9CF8385CE167D3045' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-04-24+12%3A53%3A54' \
-d 'v=2.0' \
-d 'inventory_request=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlibabaAscpChannelDistributorInventoryGetRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.inventory_request=""
try:
resp= req.getResponse(sessionkey)
print(resp)
except Exception,e:
print(e)
pTopRequest pRequest = alloc_top_request();
pTopResponse pResponse = NULL;
pTaobaoClient pClient = alloc_taobao_client(url, appkey, appsecret);
set_api_name(pRequest,"alibaba.ascp.channel.distributor.inventory.get");
add_param(pRequest,"inventory_request","数据结构JSON示例");
pResponse = top_execute(pClient,pRequest,sessionKey);
printf("ret code:%d\n",pResponse->code);
if(pResponse->code == 0){
pTopResponseIterator ite = init_response_iterator(pResponse);
pResultItem pResultItem = alloc_result_item();
while(parseNext(ite, pResultItem) == 0){
printf("%s:%s\n",pResultItem->key,pResultItem->value);
}
destroy_response_iterator(ite);
destroy_result_item(pResultItem);
}
destroy_top_request(pRequest);
destroy_top_response(pResponse);
destroy_taobao_client(pClient);
TopClient = require('./topClient').TopClient;
var client = new TopClient({
'appkey': 'appkey',
'appsecret': 'secret',
'REST_URL': 'http://gw.api.taobao.com/router/rest'
});
client.execute('alibaba.ascp.channel.distributor.inventory.get', {
'inventory_request':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})