TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlitripTravelGereralskuUpdateRequest req = new AlitripTravelGereralskuUpdateRequest();
List<AlitripTravelGereralskuUpdateRequest.PropertyAliasInfo> list2 = new ArrayList<AlitripTravelGereralskuUpdateRequest.PropertyAliasInfo>();
AlitripTravelGereralskuUpdateRequest.PropertyAliasInfo obj3 = new AlitripTravelGereralskuUpdateRequest.PropertyAliasInfo();
list2.add(obj3);
obj3.setProperties("20000:33564");
obj3.setValue("香港直飞");
req.setAlias(list2);
List<AlitripTravelGereralskuUpdateRequest.CatPropInfo> list5 = new ArrayList<AlitripTravelGereralskuUpdateRequest.CatPropInfo>();
AlitripTravelGereralskuUpdateRequest.CatPropInfo obj6 = new AlitripTravelGereralskuUpdateRequest.CatPropInfo();
list5.add(obj6);
obj6.setPid("111");
obj6.setVid("222");
req.setProperties(list5);
req.setItemId(123L);
req.setPrice(100L);
req.setQuantity(100L);
List<AlitripTravelGereralskuUpdateRequest.DateInventoryAndPrice> list8 = new ArrayList<AlitripTravelGereralskuUpdateRequest.DateInventoryAndPrice>();
AlitripTravelGereralskuUpdateRequest.DateInventoryAndPrice obj9 = new AlitripTravelGereralskuUpdateRequest.DateInventoryAndPrice();
list8.add(obj9);
obj9.setPrice(200L);
obj9.setStock(100L);
obj9.setDate(StringUtils.parseDateTime("2017-10-23 09:42:12"));
req.setDateList(list8);
req.setOuterId("111");
AlitripTravelGereralskuUpdateResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlitripTravelGereralskuUpdateRequest req = new AlitripTravelGereralskuUpdateRequest();
List<AlitripTravelGereralskuUpdateRequest.PropertyAliasInfoDomain> list2 = new List<AlitripTravelGereralskuUpdateRequest.PropertyAliasInfoDomain>();
AlitripTravelGereralskuUpdateRequest.PropertyAliasInfoDomain obj3 = new AlitripTravelGereralskuUpdateRequest.PropertyAliasInfoDomain();
list2.Add(obj3);
obj3.Properties = "20000:33564";
obj3.Value = "香港直飞";
req.Alias_ = list2;
List<AlitripTravelGereralskuUpdateRequest.CatPropInfoDomain> list5 = new List<AlitripTravelGereralskuUpdateRequest.CatPropInfoDomain>();
AlitripTravelGereralskuUpdateRequest.CatPropInfoDomain obj6 = new AlitripTravelGereralskuUpdateRequest.CatPropInfoDomain();
list5.Add(obj6);
obj6.Pid = "111";
obj6.Vid = "222";
req.Properties_ = list5;
req.ItemId = 123L;
req.Price = 100L;
req.Quantity = 100L;
List<AlitripTravelGereralskuUpdateRequest.DateInventoryAndPriceDomain> list8 = new List<AlitripTravelGereralskuUpdateRequest.DateInventoryAndPriceDomain>();
AlitripTravelGereralskuUpdateRequest.DateInventoryAndPriceDomain obj9 = new AlitripTravelGereralskuUpdateRequest.DateInventoryAndPriceDomain();
list8.Add(obj9);
obj9.Price = 200L;
obj9.Stock = 100L;
obj9.Date = DateTime.Parse(2017-10-23 09:42:12");
req.DateList_ = list8;
req.OuterId = "111";
AlitripTravelGereralskuUpdateResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlitripTravelGereralskuUpdateRequest;
$alias = new PropertyAliasInfo;
$alias->properties="20000:33564";
$alias->value="香港直飞";
$req->setAlias(json_encode($alias));
$properties = new CatPropInfo;
$properties->pid="111";
$properties->vid="222";
$req->setProperties(json_encode($properties));
$req->setItemId("123");
$req->setPrice("100");
$req->setQuantity("100");
$date_list = new DateInventoryAndPrice;
$date_list->price="200";
$date_list->stock="100";
$date_list->date="2017-10-23 09:42:12";
$req->setDateList(json_encode($date_list));
$req->setOuterId("111");
$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=alitrip.travel.gereralsku.update' \
-d 'partner_id=apidoc' \
-d 'session=3ef1ea73-866a-4541-a35f-acf4f44602d2' \
-d 'sign=B0DA144B90C927E233E3F9B5322D706E' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-23+21%3A46%3A12' \
-d 'v=2.0' \
-d 'alias=null' \
-d 'date_list=null' \
-d 'item_id=123' \
-d 'outer_id=111' \
-d 'price=100' \
-d 'properties=null' \
-d 'quantity=100'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlitripTravelGereralskuUpdateRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.alias=""
req.properties=""
req.item_id=123
req.price=100
req.quantity=100
req.date_list=""
req.outer_id="111"
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,"alitrip.travel.gereralsku.update");
add_param(pRequest,"alias","数据结构JSON示例");
add_param(pRequest,"properties","数据结构JSON示例");
add_param(pRequest,"item_id","123");
add_param(pRequest,"price","100");
add_param(pRequest,"quantity","100");
add_param(pRequest,"date_list","数据结构JSON示例");
add_param(pRequest,"outer_id","111");
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('alitrip.travel.gereralsku.update', {
'alias':'数据结构JSON示例',
'properties':'数据结构JSON示例',
'item_id':'123',
'price':'100',
'quantity':'100',
'date_list':'数据结构JSON示例',
'outer_id':'111'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})