TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlitripTicketSkusUploadRequest req = new AlitripTicketSkusUploadRequest();
req.setTicketType("成人票");
req.setOutProductId("1111");
req.setItemId(1223L);
List<AlitripTicketSkusUploadRequest.PriceRule> list2 = new ArrayList<AlitripTicketSkusUploadRequest.PriceRule>();
AlitripTicketSkusUploadRequest.PriceRule obj3 = new AlitripTicketSkusUploadRequest.PriceRule();
list2.add(obj3);
obj3.setOutRuleId("111");
obj3.setUploadType(1L);
List<AlitripTicketSkusUploadRequest.DateInventory> list6 = new ArrayList<AlitripTicketSkusUploadRequest.DateInventory>();
AlitripTicketSkusUploadRequest.DateInventory obj7 = new AlitripTicketSkusUploadRequest.DateInventory();
list6.add(obj7);
obj7.setDate(StringUtils.parseDateTime("2016-12-10 23:59:00"));
obj7.setPrice(1000L);
obj7.setStock(12L);
obj7.setOutSkuDateId("2222");
list4.setDateInventorys(list6);
obj3.setOutSkuId("12345");
req.setPriceRules(list2);
req.setAliProductId(1212L);
req.setTicketSeason("上午场");
req.setTicketArea("贵宾席");
AlitripTicketSkusUploadResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlitripTicketSkusUploadRequest req = new AlitripTicketSkusUploadRequest();
req.TicketType = "成人票";
req.OutProductId = "1111";
req.ItemId = 1223L;
List<AlitripTicketSkusUploadRequest.PriceRuleDomain> list2 = new List<AlitripTicketSkusUploadRequest.PriceRuleDomain>();
AlitripTicketSkusUploadRequest.PriceRuleDomain obj3 = new AlitripTicketSkusUploadRequest.PriceRuleDomain();
list2.Add(obj3);
obj3.OutRuleId = "111";
obj3.UploadType = 1L;
List<AlitripTicketSkusUploadRequest.DateInventoryDomain> list5 = new List<AlitripTicketSkusUploadRequest.DateInventoryDomain>();
AlitripTicketSkusUploadRequest.DateInventoryDomain obj6 = new AlitripTicketSkusUploadRequest.DateInventoryDomain();
list5.Add(obj6);
obj6.Date = DateTime.Parse(2016-12-10 23:59:00");
obj6.Price = 1000L;
obj6.Stock = 12L;
obj6.OutSkuDateId = "2222";
obj3.DateInventorys= list5;
obj3.OutSkuId = "12345";
req.PriceRules_ = list2;
req.AliProductId = 1212L;
req.TicketSeason = "上午场";
req.TicketArea = "贵宾席";
AlitripTicketSkusUploadResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlitripTicketSkusUploadRequest;
$req->setTicketType("成人票");
$req->setOutProductId("1111");
$req->setItemId("1223");
$price_rules = new PriceRule;
$price_rules->out_rule_id="111";
$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;
$price_rules->out_sku_id="12345";
$req->setPriceRules(json_encode($price_rules));
$req->setAliProductId("1212");
$req->setTicketSeason("上午场");
$req->setTicketArea("贵宾席");
$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.upload' \
-d 'partner_id=apidoc' \
-d 'session=e559edfb-6347-495e-86ed-08ed3b4dfe47' \
-d 'sign=1C0A0F790B0A502F077AC6221A1B48C0' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-21+22%3A54%3A04' \
-d 'v=2.0' \
-d 'ali_product_id=1212' \
-d 'item_id=1223' \
-d 'out_product_id=1111' \
-d 'price_rules=null' \
-d 'ticket_area=%E8%B4%B5%E5%AE%BE%E5%B8%AD' \
-d 'ticket_season=%E4%B8%8A%E5%8D%88%E5%9C%BA' \
-d 'ticket_type=%E6%88%90%E4%BA%BA%E7%A5%A8'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlitripTicketSkusUploadRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.ticket_type="成人票"
req.out_product_id="1111"
req.item_id=1223
req.price_rules=""
req.ali_product_id=1212
req.ticket_season="上午场"
req.ticket_area="贵宾席"
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.upload");
add_param(pRequest,"ticket_type","成人票");
add_param(pRequest,"out_product_id","1111");
add_param(pRequest,"item_id","1223");
add_param(pRequest,"price_rules","数据结构JSON示例");
add_param(pRequest,"ali_product_id","1212");
add_param(pRequest,"ticket_season","上午场");
add_param(pRequest,"ticket_area","贵宾席");
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.upload', {
'ticket_type':'成人票',
'out_product_id':'1111',
'item_id':'1223',
'price_rules':'数据结构JSON示例',
'ali_product_id':'1212',
'ticket_season':'上午场',
'ticket_area':'贵宾席'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})