TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlitripTicketSkusBatchUploadRequest req = new AlitripTicketSkusBatchUploadRequest();
req.setAliProductId(1212L);
req.setOutProductId("1111");
List<AlitripTicketSkusBatchUploadRequest.TicketPriceRule> list2 = new ArrayList<AlitripTicketSkusBatchUploadRequest.TicketPriceRule>();
AlitripTicketSkusBatchUploadRequest.TicketPriceRule obj3 = new AlitripTicketSkusBatchUploadRequest.TicketPriceRule();
list2.add(obj3);
obj3.setTicketType("成人票");
obj3.setTicketSeason("上午场");
obj3.setTicketArea("贵宾席");
List<AlitripTicketSkusBatchUploadRequest.PriceRule> list6 = new ArrayList<AlitripTicketSkusBatchUploadRequest.PriceRule>();
AlitripTicketSkusBatchUploadRequest.PriceRule obj7 = new AlitripTicketSkusBatchUploadRequest.PriceRule();
list6.add(obj7);
obj7.setOutRuleId("111");
obj7.setOutSkuId("12345");
obj7.setUploadType(1L);
List<AlitripTicketSkusBatchUploadRequest.DateInventory> list10 = new ArrayList<AlitripTicketSkusBatchUploadRequest.DateInventory>();
AlitripTicketSkusBatchUploadRequest.DateInventory obj11 = new AlitripTicketSkusBatchUploadRequest.DateInventory();
list10.add(obj11);
obj11.setDate(StringUtils.parseDateTime("2016-12-10 23:59:00"));
obj11.setPrice(1000L);
obj11.setStock(12L);
obj11.setOutSkuDateId("2222");
list8.setDateInventorys(list10);
list4.setPriceRules(list6);
req.setTicketPriceRules(list2);
req.setItemId(1223L);
AlitripTicketSkusBatchUploadResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlitripTicketSkusBatchUploadRequest req = new AlitripTicketSkusBatchUploadRequest();
req.AliProductId = 1212L;
req.OutProductId = "1111";
List<AlitripTicketSkusBatchUploadRequest.TicketPriceRuleDomain> list2 = new List<AlitripTicketSkusBatchUploadRequest.TicketPriceRuleDomain>();
AlitripTicketSkusBatchUploadRequest.TicketPriceRuleDomain obj3 = new AlitripTicketSkusBatchUploadRequest.TicketPriceRuleDomain();
list2.Add(obj3);
obj3.TicketType = "成人票";
obj3.TicketSeason = "上午场";
obj3.TicketArea = "贵宾席";
List<AlitripTicketSkusBatchUploadRequest.PriceRuleDomain> list5 = new List<AlitripTicketSkusBatchUploadRequest.PriceRuleDomain>();
AlitripTicketSkusBatchUploadRequest.PriceRuleDomain obj6 = new AlitripTicketSkusBatchUploadRequest.PriceRuleDomain();
list5.Add(obj6);
obj6.OutRuleId = "111";
obj6.OutSkuId = "12345";
obj6.UploadType = 1L;
List<AlitripTicketSkusBatchUploadRequest.DateInventoryDomain> list8 = new List<AlitripTicketSkusBatchUploadRequest.DateInventoryDomain>();
AlitripTicketSkusBatchUploadRequest.DateInventoryDomain obj9 = new AlitripTicketSkusBatchUploadRequest.DateInventoryDomain();
list8.Add(obj9);
obj9.Date = DateTime.Parse(2016-12-10 23:59:00");
obj9.Price = 1000L;
obj9.Stock = 12L;
obj9.OutSkuDateId = "2222";
obj6.DateInventorys= list8;
obj3.PriceRules= list5;
req.TicketPriceRules_ = list2;
req.ItemId = 1223L;
AlitripTicketSkusBatchUploadResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlitripTicketSkusBatchUploadRequest;
$req->setAliProductId("1212");
$req->setOutProductId("1111");
$ticket_price_rules = new TicketPriceRule;
$ticket_price_rules->ticket_type="成人票";
$ticket_price_rules->ticket_season="上午场";
$ticket_price_rules->ticket_area="贵宾席";
$price_rules = new PriceRule;
$price_rules->out_rule_id="111";
$price_rules->out_sku_id="12345";
$price_rules->upload_type="1";
$date_inventorys = new DateInventory;
$date_inventorys->date="2016-12-10 23:59:00";
$date_inventorys->price="1000";
$date_inventorys->stock="12";
$date_inventorys->out_sku_date_id="2222";
$price_rules->date_inventorys = $date_inventorys;
$ticket_price_rules->price_rules = $price_rules;
$req->setTicketPriceRules(json_encode($ticket_price_rules));
$req->setItemId("1223");
$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.ticket.skus.batch.upload' \
-d 'partner_id=apidoc' \
-d 'session=24bd6d0f-c75a-4578-b0e8-cd2c07599f3e' \
-d 'sign=4D69A672E67DE098D7952AD72AD0C6AE' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-21+21%3A54%3A52' \
-d 'v=2.0' \
-d 'ali_product_id=1212' \
-d 'item_id=1223' \
-d 'out_product_id=1111' \
-d 'ticket_price_rules=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlitripTicketSkusBatchUploadRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.ali_product_id=1212
req.out_product_id="1111"
req.ticket_price_rules=""
req.item_id=1223
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.ticket.skus.batch.upload");
add_param(pRequest,"ali_product_id","1212");
add_param(pRequest,"out_product_id","1111");
add_param(pRequest,"ticket_price_rules","数据结构JSON示例");
add_param(pRequest,"item_id","1223");
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.ticket.skus.batch.upload', {
'ali_product_id':'1212',
'out_product_id':'1111',
'ticket_price_rules':'数据结构JSON示例',
'item_id':'1223'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})