TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaTbmcInventoryPublishRequest req = new AlibabaTbmcInventoryPublishRequest();
AlibabaTbmcInventoryPublishRequest.InventoryPublishRequest obj1 = new AlibabaTbmcInventoryPublishRequest.InventoryPublishRequest();
obj1.setSupplierNo("2898876679");
obj1.setRemark("备注");
List<AlibabaTbmcInventoryPublishRequest.InventoryPublishDTO> list3 = new ArrayList<AlibabaTbmcInventoryPublishRequest.InventoryPublishDTO>();
AlibabaTbmcInventoryPublishRequest.InventoryPublishDTO obj4 = new AlibabaTbmcInventoryPublishRequest.InventoryPublishDTO();
list3.add(obj4);
obj4.setQuantity("12.3");
obj4.setRemark("备注");
obj4.setSkuCode("527787");
obj4.setWarehouseCode("001");
obj1.setDetails(list3);
obj1.setOperator("小明");
obj1.setPlatformMerchantCode("CSMMC");
req.setInventoryPublishRequest(obj1);
AlibabaTbmcInventoryPublishResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlibabaTbmcInventoryPublishRequest req = new AlibabaTbmcInventoryPublishRequest();
AlibabaTbmcInventoryPublishRequest.InventoryPublishRequestDomain obj1 = new AlibabaTbmcInventoryPublishRequest.InventoryPublishRequestDomain();
obj1.SupplierNo = "2898876679";
obj1.Remark = "备注";
List<AlibabaTbmcInventoryPublishRequest.InventoryPublishDTODomain> list3 = new List<AlibabaTbmcInventoryPublishRequest.InventoryPublishDTODomain>();
AlibabaTbmcInventoryPublishRequest.InventoryPublishDTODomain obj4 = new AlibabaTbmcInventoryPublishRequest.InventoryPublishDTODomain();
list3.Add(obj4);
obj4.Quantity = "12.3";
obj4.Remark = "备注";
obj4.SkuCode = "527787";
obj4.WarehouseCode = "001";
obj1.Details= list3;
obj1.Operator = "小明";
obj1.PlatformMerchantCode = "CSMMC";
req.InventoryPublishRequest_ = obj1;
AlibabaTbmcInventoryPublishResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlibabaTbmcInventoryPublishRequest;
$inventory_publish_request = new InventoryPublishRequest;
$inventory_publish_request->supplier_no="2898876679";
$inventory_publish_request->remark="备注";
$details = new InventoryPublishDTO;
$details->quantity="12.3";
$details->remark="备注";
$details->sku_code="527787";
$details->warehouse_code="001";
$inventory_publish_request->details = $details;
$inventory_publish_request->operator="小明";
$inventory_publish_request->platform_merchant_code="CSMMC";
$req->setInventoryPublishRequest(json_encode($inventory_publish_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.tbmc.inventory.publish' \
-d 'partner_id=apidoc' \
-d 'session=3f66ea9e-1be9-43b7-96b3-4b1ed524221a' \
-d 'sign=7DFAA9400AD7E0F163112D4DD07D4ABC' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-05-04+16%3A15%3A38' \
-d 'v=2.0' \
-d 'inventory_publish_request=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlibabaTbmcInventoryPublishRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.inventory_publish_request="数据结构示例JSON格式"
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.tbmc.inventory.publish");
add_param(pRequest,"inventory_publish_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.tbmc.inventory.publish', {
'inventory_publish_request':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})