TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
XhotelRateAddRequest req = new XhotelRateAddRequest();
req.setGid(100000L);
req.setRpid(100000L);
req.setVendor("ChinaOnline");
req.setRateplanCode("12345AAA");
req.setOutRid("abc123");
req.setRateSwitchCal("[{\"date\":\"yyyy-MM-dd\",\"rate_status\":1},{\"date\":\"yyyy-MM-dd\",\"rate_status\":0}]");
req.setName("aaa");
req.setInventoryPrice("{\"use_room_inventory\":false,\"inventory_price\":[{\"date\":\"2017-10-10\",\"quota\":10,\"price\":100,\"alQuota\":10,\"genAlQuota\":10},{\"date\":\"2017-10-11\",\"quota\":10,\"price\":200},{\"date\":\"2017-10-13\",\"quota\":10,\"price\":300,\"alQuota\":10,\"genAlQuota\":10}]}");
req.setAddBed(1L);
req.setAddBedPrice(1L);
req.setCurrencyCode(1L);
req.setShijiaTag(1L);
req.setJishiquerenTag(1L);
req.setLockEndTime("2016-07-15 00:00:00");
req.setLockStartTime("2016-07-15 00:00:00");
req.setCurrencyCodeName("CNY");
req.setOperator("XXX小二");
req.setSource(2L);
req.setStatus(1L);
req.setOnlineBookingBindingInfo("[{\"itemId\":1234235235,\"skuId\":1234235235,\"priceRuleInfoList\":[{\"priceRuleNumber\":\"14235253\"},{\"priceRuleNumber\":\"14235253\"},{\"priceRuleNumber\":\"14235253\"}]},{\"itemId\":1234235235,\"skuId\":1234235235,\"priceRuleInfoList\":[{\"priceRuleNumber\":\"14235253\"},{\"priceRuleNumber\":\"14235253\"},{\"priceRuleNumber\":\"14235253\"}]}]");
req.setHotelXitemInfos("[{\"actionType\":\"BOUND\",\"outXcode\":\"123456\",\"subTypeCode\":\"40000_105\",\"shortName\":\"延时14点退房\",\"time\":\"00:00-23:59\",\"value\":1200,\"itemDesc\":\"可延时到14点退房\",\"dimensionType\":1,\"picList\":[],\"adultCount\":1,\"childCount\":1,\"itemLimit\":\"\",\"checkInStart\":\"2023-07-13 00:00:01\",\"checkInEnd\":\"2023-07-13 00:00:01\",\"bookStartTime\":\"2023-07-13 00:00:01\",\"bookStartEnd\":\"2023-07-13 00:00:01\",\"featureDetail\":\"\"}]");
XhotelRateAddResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
XhotelRateAddRequest req = new XhotelRateAddRequest();
req.Gid = 100000L;
req.Rpid = 100000L;
req.Vendor = "ChinaOnline";
req.RateplanCode = "12345AAA";
req.OutRid = "abc123";
req.RateSwitchCal = "[{\"date\":\"yyyy-MM-dd\",\"rate_status\":1},{\"date\":\"yyyy-MM-dd\",\"rate_status\":0}]";
req.Name = "aaa";
req.InventoryPrice = "{\"use_room_inventory\":false,\"inventory_price\":[{\"date\":\"2017-10-10\",\"quota\":10,\"price\":100,\"alQuota\":10,\"genAlQuota\":10},{\"date\":\"2017-10-11\",\"quota\":10,\"price\":200},{\"date\":\"2017-10-13\",\"quota\":10,\"price\":300,\"alQuota\":10,\"genAlQuota\":10}]}";
req.AddBed = 1L;
req.AddBedPrice = 1L;
req.CurrencyCode = 1L;
req.ShijiaTag = 1L;
req.JishiquerenTag = 1L;
req.LockEndTime = "2016-07-15 00:00:00";
req.LockStartTime = "2016-07-15 00:00:00";
req.CurrencyCodeName = "CNY";
req.Operator = "XXX小二";
req.Source = 2L;
req.Status = 1L;
req.OnlineBookingBindingInfo = "[{\"itemId\":1234235235,\"skuId\":1234235235,\"priceRuleInfoList\":[{\"priceRuleNumber\":\"14235253\"},{\"priceRuleNumber\":\"14235253\"},{\"priceRuleNumber\":\"14235253\"}]},{\"itemId\":1234235235,\"skuId\":1234235235,\"priceRuleInfoList\":[{\"priceRuleNumber\":\"14235253\"},{\"priceRuleNumber\":\"14235253\"},{\"priceRuleNumber\":\"14235253\"}]}]";
req.HotelXitemInfos = "[{\"actionType\":\"BOUND\",\"outXcode\":\"123456\",\"subTypeCode\":\"40000_105\",\"shortName\":\"延时14点退房\",\"time\":\"00:00-23:59\",\"value\":1200,\"itemDesc\":\"可延时到14点退房\",\"dimensionType\":1,\"picList\":[],\"adultCount\":1,\"childCount\":1,\"itemLimit\":\"\",\"checkInStart\":\"2023-07-13 00:00:01\",\"checkInEnd\":\"2023-07-13 00:00:01\",\"bookStartTime\":\"2023-07-13 00:00:01\",\"bookStartEnd\":\"2023-07-13 00:00:01\",\"featureDetail\":\"\"}]";
XhotelRateAddResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new XhotelRateAddRequest;
$req->setGid("100000");
$req->setRpid("100000");
$req->setVendor("ChinaOnline");
$req->setRateplanCode("12345AAA");
$req->setOutRid("abc123");
$req->setRateSwitchCal("[{\"date\":\"yyyy-MM-dd\",\"rate_status\":1},{\"date\":\"yyyy-MM-dd\",\"rate_status\":0}]");
$req->setName("aaa");
$req->setInventoryPrice("{\"use_room_inventory\":false,\"inventory_price\":[{\"date\":\"2017-10-10\",\"quota\":10,\"price\":100,\"alQuota\":10,\"genAlQuota\":10},{\"date\":\"2017-10-11\",\"quota\":10,\"price\":200},{\"date\":\"2017-10-13\",\"quota\":10,\"price\":300,\"alQuota\":10,\"genAlQuota\":10}]}");
$req->setAddBed("1");
$req->setAddBedPrice("1");
$req->setCurrencyCode("1");
$req->setShijiaTag("1");
$req->setJishiquerenTag("1");
$req->setLockEndTime("2016-07-15 00:00:00");
$req->setLockStartTime("2016-07-15 00:00:00");
$req->setCurrencyCodeName("CNY");
$req->setOperator("XXX小二");
$req->setSource("2");
$req->setStatus("1");
$req->setOnlineBookingBindingInfo("[{\"itemId\":1234235235,\"skuId\":1234235235,\"priceRuleInfoList\":[{\"priceRuleNumber\":\"14235253\"},{\"priceRuleNumber\":\"14235253\"},{\"priceRuleNumber\":\"14235253\"}]},{\"itemId\":1234235235,\"skuId\":1234235235,\"priceRuleInfoList\":[{\"priceRuleNumber\":\"14235253\"},{\"priceRuleNumber\":\"14235253\"},{\"priceRuleNumber\":\"14235253\"}]}]");
$req->setHotelXitemInfos("[{\"actionType\":\"BOUND\",\"outXcode\":\"123456\",\"subTypeCode\":\"40000_105\",\"shortName\":\"延时14点退房\",\"time\":\"00:00-23:59\",\"value\":1200,\"itemDesc\":\"可延时到14点退房\",\"dimensionType\":1,\"picList\":[],\"adultCount\":1,\"childCount\":1,\"itemLimit\":\"\",\"checkInStart\":\"2023-07-13 00:00:01\",\"checkInEnd\":\"2023-07-13 00:00:01\",\"bookStartTime\":\"2023-07-13 00:00:01\",\"bookStartEnd\":\"2023-07-13 00:00:01\",\"featureDetail\":\"\"}]");
$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=taobao.xhotel.rate.add' \
-d 'partner_id=apidoc' \
-d 'session=0164584e-9012-4f39-b482-ab6a8592bb99' \
-d 'sign=9B6B4D83B6A5AE57ECD7809719DB79F0' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-21+20%3A33%3A15' \
-d 'v=2.0' \
-d 'add_bed=1' \
-d 'add_bed_price=1' \
-d 'currency_code=1' \
-d 'currency_code_name=CNY' \
-d 'gid=100000' \
-d 'hotel_xitem_infos=%7B%22actionType%22%3A%22BOUND%22%2C%22outXcode%22%3A%22123456%22%2C%22subTypeCode%22%3A%2240000_105%22%2C%22shortName%22%3A%22%E5%BB%B6%E6%97%B614%E7%82%B9%E9%80%80%E6%88%BF%22%2C%22time%22%3A%2200%3A00-23%3A59%22%2C%22value%22%3A1200%2C%22itemDesc%22%3A%22%E5%8F%AF%E5%BB%B6%E6%97%B6%E5%88%B014%E7%82%B9%E9%80%80%E6%88%BF%22%2C%22dimensionType%22%3A1%2C%22picList%22%3A%5B%5D%2C%22adultCount%22%3A1%2C%22childCount%22%3A1%2C%22itemLimit%22%3A%22%22%2C%22checkInStart%22%3A%222023-07-13+00%3A00%3A01%22%2C%22checkInEnd%22%3A%222023-07-13+00%3A00%3A01%22%2C%22bookStartTime%22%3A%222023-07-13+00%3A00%3A01%22%2C%22bookStartEnd%22%3A%222023-07-13+00%3A00%3A01%22%2C%22featureDetail%22%3A%22%22%7D' \
-d 'inventory_price=%7B%5C%22use_room_inventory%5C%22%3Afalse%2C%5C%22inventory_price%5C%22%3A%5B%7B%5C%22date%5C%22%3A%5C%222017-10-10%5C%22%2C%5C%22quota%5C%22%3A10%2C%5C%22price%5C%22%3A100%2C%5C%22alQuota%5C%22%3A10%2C%5C%22genAlQuota%5C%22%3A10%7D%2C%7B%5C%22date%5C%22%3A%5C%222017-10-11%5C%22%2C%5C%22quota%5C%22%3A10%2C%5C%22price%5C%22%3A200%7D%2C%7B%5C%22date%5C%22%3A%5C%222017-10-13%5C%22%2C%5C%22quota%5C%22%3A10%2C%5C%22price%5C%22%3A300%2C%5C%22alQuota%5C%22%3A10%2C%5C%22genAlQuota%5C%22%3A10%7D%5D%7D' \
-d 'jishiqueren_tag=1' \
-d 'lock_end_time=2016-07-15+00%3A00%3A00' \
-d 'lock_start_time=2016-07-15+00%3A00%3A00' \
-d 'name=aaa' \
-d 'online_booking_binding_info=%7B%22itemId%22%3A1234235235%2C%22skuId%22%3A1234235235%2C%22priceRuleInfoList%22%3A%5B%7B%22priceRuleNumber%22%3A%2214235253%22%7D%2C%7B%22priceRuleNumber%22%3A%2214235253%22%7D%2C%7B%22priceRuleNumber%22%3A%2214235253%22%7D%5D%7D%2C%7B%22itemId%22%3A1234235235%2C%22skuId%22%3A1234235235%2C%22priceRuleInfoList%22%3A%5B%7B%22priceRuleNumber%22%3A%2214235253%22%7D%2C%7B%22priceRuleNumber%22%3A%2214235253%22%7D%2C%7B%22priceRuleNumber%22%3A%2214235253%22%7D%5D%7D' \
-d 'operator=XXX%E5%B0%8F%E4%BA%8C' \
-d 'out_rid=abc123' \
-d 'rate_switch_cal=%7B%22date%22%3A%22yyyy-MM-dd%22%2C%22rate_status%22%3A1%7D%2C%7B%22date%22%3A%22yyyy-MM-dd%22%2C%22rate_status%22%3A0%7D' \
-d 'rateplan_code=12345AAA' \
-d 'rpid=100000' \
-d 'shijia_tag=1' \
-d 'source=2' \
-d 'status=1' \
-d 'vendor=ChinaOnline'
# -*- coding: utf-8 -*-
import top.api
req=top.api.XhotelRateAddRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.gid=100000
req.rpid=100000
req.vendor="ChinaOnline"
req.rateplan_code="12345AAA"
req.out_rid="abc123"
req.rate_switch_cal="[{\"date\":\"yyyy-MM-dd\",\"rate_status\":1},{\"date\":\"yyyy-MM-dd\",\"rate_status\":0}]"
req.name="aaa"
req.inventory_price="{\"use_room_inventory\":false,\"inventory_price\":[{\"date\":\"2017-10-10\",\"quota\":10,\"price\":100,\"alQuota\":10,\"genAlQuota\":10},{\"date\":\"2017-10-11\",\"quota\":10,\"price\":200},{\"date\":\"2017-10-13\",\"quota\":10,\"price\":300,\"alQuota\":10,\"genAlQuota\":10}]}"
req.add_bed=1
req.add_bed_price=1
req.currency_code=1
req.shijia_tag=1
req.jishiqueren_tag=1
req.lock_end_time="2016-07-15 00:00:00"
req.lock_start_time="2016-07-15 00:00:00"
req.currency_code_name="CNY"
req.operator="XXX小二"
req.source=2
req.status=1
req.online_booking_binding_info="[{\"itemId\":1234235235,\"skuId\":1234235235,\"priceRuleInfoList\":[{\"priceRuleNumber\":\"14235253\"},{\"priceRuleNumber\":\"14235253\"},{\"priceRuleNumber\":\"14235253\"}]},{\"itemId\":1234235235,\"skuId\":1234235235,\"priceRuleInfoList\":[{\"priceRuleNumber\":\"14235253\"},{\"priceRuleNumber\":\"14235253\"},{\"priceRuleNumber\":\"14235253\"}]}]"
req.hotel_xitem_infos="[{\"actionType\":\"BOUND\",\"outXcode\":\"123456\",\"subTypeCode\":\"40000_105\",\"shortName\":\"延时14点退房\",\"time\":\"00:00-23:59\",\"value\":1200,\"itemDesc\":\"可延时到14点退房\",\"dimensionType\":1,\"picList\":[],\"adultCount\":1,\"childCount\":1,\"itemLimit\":\"\",\"checkInStart\":\"2023-07-13 00:00:01\",\"checkInEnd\":\"2023-07-13 00:00:01\",\"bookStartTime\":\"2023-07-13 00:00:01\",\"bookStartEnd\":\"2023-07-13 00:00:01\",\"featureDetail\":\"\"}]"
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,"taobao.xhotel.rate.add");
add_param(pRequest,"gid","100000");
add_param(pRequest,"rpid","100000");
add_param(pRequest,"vendor","ChinaOnline");
add_param(pRequest,"rateplan_code","12345AAA");
add_param(pRequest,"out_rid","abc123");
add_param(pRequest,"rate_switch_cal","{"date":"yyyy-MM-dd","rate_status":1},{"date":"yyyy-MM-dd","rate_status":0}");
add_param(pRequest,"name","aaa");
add_param(pRequest,"inventory_price","{\"use_room_inventory\":false,\"inventory_price\":[{\"date\":\"2017-10-10\",\"quota\":10,\"price\":100,\"alQuota\":10,\"genAlQuota\":10},{\"date\":\"2017-10-11\",\"quota\":10,\"price\":200},{\"date\":\"2017-10-13\",\"quota\":10,\"price\":300,\"alQuota\":10,\"genAlQuota\":10}]}");
add_param(pRequest,"add_bed","1");
add_param(pRequest,"add_bed_price","1");
add_param(pRequest,"currency_code","1");
add_param(pRequest,"shijia_tag","1");
add_param(pRequest,"jishiqueren_tag","1");
add_param(pRequest,"lock_end_time","2016-07-15 00:00:00");
add_param(pRequest,"lock_start_time","2016-07-15 00:00:00");
add_param(pRequest,"currency_code_name","CNY");
add_param(pRequest,"operator","XXX小二");
add_param(pRequest,"source","2");
add_param(pRequest,"status","1");
add_param(pRequest,"online_booking_binding_info","{"itemId":1234235235,"skuId":1234235235,"priceRuleInfoList":[{"priceRuleNumber":"14235253"},{"priceRuleNumber":"14235253"},{"priceRuleNumber":"14235253"}]},{"itemId":1234235235,"skuId":1234235235,"priceRuleInfoList":[{"priceRuleNumber":"14235253"},{"priceRuleNumber":"14235253"},{"priceRuleNumber":"14235253"}]}");
add_param(pRequest,"hotel_xitem_infos","{"actionType":"BOUND","outXcode":"123456","subTypeCode":"40000_105","shortName":"延时14点退房","time":"00:00-23:59","value":1200,"itemDesc":"可延时到14点退房","dimensionType":1,"picList":[],"adultCount":1,"childCount":1,"itemLimit":"","checkInStart":"2023-07-13 00:00:01","checkInEnd":"2023-07-13 00:00:01","bookStartTime":"2023-07-13 00:00:01","bookStartEnd":"2023-07-13 00:00:01","featureDetail":""}");
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('taobao.xhotel.rate.add', {
'gid':'100000',
'rpid':'100000',
'vendor':'ChinaOnline',
'rateplan_code':'12345AAA',
'out_rid':'abc123',
'rate_switch_cal':'{"date":"yyyy-MM-dd","rate_status":1},{"date":"yyyy-MM-dd","rate_status":0}',
'name':'aaa',
'inventory_price':'{\"use_room_inventory\":false,\"inventory_price\":[{\"date\":\"2017-10-10\",\"quota\":10,\"price\":100,\"alQuota\":10,\"genAlQuota\":10},{\"date\":\"2017-10-11\",\"quota\":10,\"price\":200},{\"date\":\"2017-10-13\",\"quota\":10,\"price\":300,\"alQuota\":10,\"genAlQuota\":10}]}',
'add_bed':'1',
'add_bed_price':'1',
'currency_code':'1',
'shijia_tag':'1',
'jishiqueren_tag':'1',
'lock_end_time':'2016-07-15 00:00:00',
'lock_start_time':'2016-07-15 00:00:00',
'currency_code_name':'CNY',
'operator':'XXX小二',
'source':'2',
'status':'1',
'online_booking_binding_info':'{"itemId":1234235235,"skuId":1234235235,"priceRuleInfoList":[{"priceRuleNumber":"14235253"},{"priceRuleNumber":"14235253"},{"priceRuleNumber":"14235253"}]},{"itemId":1234235235,"skuId":1234235235,"priceRuleInfoList":[{"priceRuleNumber":"14235253"},{"priceRuleNumber":"14235253"},{"priceRuleNumber":"14235253"}]}',
'hotel_xitem_infos':'{"actionType":"BOUND","outXcode":"123456","subTypeCode":"40000_105","shortName":"延时14点退房","time":"00:00-23:59","value":1200,"itemDesc":"可延时到14点退房","dimensionType":1,"picList":[],"adultCount":1,"childCount":1,"itemLimit":"","checkInStart":"2023-07-13 00:00:01","checkInEnd":"2023-07-13 00:00:01","bookStartTime":"2023-07-13 00:00:01","bookStartEnd":"2023-07-13 00:00:01","featureDetail":""}'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})