TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
TmallCampusInventoryRetailItemTransferRequest req = new TmallCampusInventoryRetailItemTransferRequest();
TmallCampusInventoryRetailItemTransferRequest.AllocateInventoryReq obj1 = new TmallCampusInventoryRetailItemTransferRequest.AllocateInventoryReq();
obj1.setTpId(123L);
obj1.setItemType("1");
obj1.setQuantity(10L);
obj1.setItemTitle("名称");
obj1.setOuterId("123");
obj1.setStoreId(123L);
obj1.setBarcode("69123");
req.setAllocateInventoryReq(obj1);
TmallCampusInventoryRetailItemTransferResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
TmallCampusInventoryRetailItemTransferRequest req = new TmallCampusInventoryRetailItemTransferRequest();
TmallCampusInventoryRetailItemTransferRequest.AllocateInventoryReqDomain obj1 = new TmallCampusInventoryRetailItemTransferRequest.AllocateInventoryReqDomain();
obj1.TpId = 123L;
obj1.ItemType = "1";
obj1.Quantity = 10L;
obj1.ItemTitle = "名称";
obj1.OuterId = "123";
obj1.StoreId = 123L;
obj1.Barcode = "69123";
req.AllocateInventoryReq_ = obj1;
TmallCampusInventoryRetailItemTransferResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new TmallCampusInventoryRetailItemTransferRequest;
$allocate_inventory_req = new AllocateInventoryReq;
$allocate_inventory_req->tp_id="123";
$allocate_inventory_req->item_type="1";
$allocate_inventory_req->quantity="10";
$allocate_inventory_req->item_title="名称";
$allocate_inventory_req->outer_id="123";
$allocate_inventory_req->store_id="123";
$allocate_inventory_req->barcode="69123";
$req->setAllocateInventoryReq(json_encode($allocate_inventory_req));
$resp = $c->execute($req);
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=tmall.campus.inventory.retail.item.transfer' \
-d 'partner_id=apidoc' \
-d 'sign=D167C81D45BEF7409CFD477836DE6099' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-06-08+02%3A19%3A10' \
-d 'v=2.0' \
-d 'allocate_inventory_req=%E8%AF%B7%E6%B1%82%E5%8F%82%E6%95%B0'
# -*- coding: utf-8 -*-
import top.api
req=top.api.TmallCampusInventoryRetailItemTransferRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.allocate_inventory_req="请求参数"
try:
resp= req.getResponse()
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,"tmall.campus.inventory.retail.item.transfer");
add_param(pRequest,"allocate_inventory_req","数据结构JSON示例");
pResponse = top_execute(pClient,pRequest,NULL);
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('tmall.campus.inventory.retail.item.transfer', {
'allocate_inventory_req':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})