TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
XhotelRateUpdateRequest req = new XhotelRateUpdateRequest();
req.setGid(100000L);
req.setRpid(100000L);
req.setName("aaa");
req.setInventoryPrice("{\"use_room_inventory\":false,\"inventory_price\":[{\"date\":2014-01-28,\"quota\":10,\"price\":100},{\"date\":2014-01-29,\"quota\":10,\"price\":200}]}");
req.setAddBed(1L);
req.setAddBedPrice(1L);
req.setCurrencyCode(1L);
req.setShijiaTag(1L);
req.setJishiquerenTag(1L);
req.setVendor("taobao");
req.setRateplanCode("12345AAA");
req.setOutRid("12345AAA");
req.setRateSwitchCal("[{\"date\":\"yyyy-MM-dd\",\"rate_status\":1},{\"date\":\"yyyy-MM-dd\",\"rate_status\":0}]");
req.setLockEndTime("2016-07-15 00:00:00");
req.setLockStartTime("2016-07-16 00:00:00");
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\\":\\"\\"}]");
XhotelRateUpdateResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
XhotelRateUpdateRequest req = new XhotelRateUpdateRequest();
req.Gid = 100000L;
req.Rpid = 100000L;
req.Name = "aaa";
req.InventoryPrice = "{\"use_room_inventory\":false,\"inventory_price\":[{\"date\":2014-01-28,\"quota\":10,\"price\":100},{\"date\":2014-01-29,\"quota\":10,\"price\":200}]}";
req.AddBed = 1L;
req.AddBedPrice = 1L;
req.CurrencyCode = 1L;
req.ShijiaTag = 1L;
req.JishiquerenTag = 1L;
req.Vendor = "taobao";
req.RateplanCode = "12345AAA";
req.OutRid = "12345AAA";
req.RateSwitchCal = "[{\"date\":\"yyyy-MM-dd\",\"rate_status\":1},{\"date\":\"yyyy-MM-dd\",\"rate_status\":0}]";
req.LockEndTime = "2016-07-15 00:00:00";
req.LockStartTime = "2016-07-16 00:00:00";
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\\":\\"\\"}]";
XhotelRateUpdateResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new XhotelRateUpdateRequest;
$req->setGid("100000");
$req->setRpid("100000");
$req->setName("aaa");
$req->setInventoryPrice("{\"use_room_inventory\":false,\"inventory_price\":[{\"date\":2014-01-28,\"quota\":10,\"price\":100},{\"date\":2014-01-29,\"quota\":10,\"price\":200}]}");
$req->setAddBed("1");
$req->setAddBedPrice("1");
$req->setCurrencyCode("1");
$req->setShijiaTag("1");
$req->setJishiquerenTag("1");
$req->setVendor("taobao");
$req->setRateplanCode("12345AAA");
$req->setOutRid("12345AAA");
$req->setRateSwitchCal("[{\"date\":\"yyyy-MM-dd\",\"rate_status\":1},{\"date\":\"yyyy-MM-dd\",\"rate_status\":0}]");
$req->setLockEndTime("2016-07-15 00:00:00");
$req->setLockStartTime("2016-07-16 00:00:00");
$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.update' \
-d 'partner_id=apidoc' \
-d 'session=802af1f6-9847-4345-82f4-d2f1a6f1d506' \
-d 'sign=C67F95EA2BB85C5F2CBC7688DC324739' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-23+17%3A26%3A25' \
-d 'v=2.0' \
-d 'add_bed=1' \
-d 'add_bed_price=1' \
-d 'currency_code=1' \
-d 'gid=100000' \
-d 'hotel_xitem_infos=%7B%5C%22actionType%5C%22%3A%5C%22BOUND%5C%22%2C%5C%22outXcode%5C%22%3A%5C%22123456%5C%22%2C%5C%22subTypeCode%5C%22%3A%5C%2240000_105%5C%22%2C%5C%22shortName%5C%22%3A%5C%22%E5%BB%B6%E6%97%B614%E7%82%B9%E9%80%80%E6%88%BF%5C%22%2C%5C%22time%5C%22%3A%5C%2200%3A00-23%3A59%5C%22%2C%5C%22value%5C%22%3A1200%2C%5C%22itemDesc%5C%22%3A%5C%22%E5%8F%AF%E5%BB%B6%E6%97%B6%E5%88%B014%E7%82%B9%E9%80%80%E6%88%BF%5C%22%2C%5C%22dimensionType%5C%22%3A1%2C%5C%22picList%5C%22%3A%5B%5D%2C%5C%22adultCount%5C%22%3A1%2C%5C%22childCount%5C%22%3A1%2C%5C%22itemLimit%5C%22%3A%5C%22%5C%22%2C%5C%22checkInStart%5C%22%3A%5C%222023-07-13+00%3A00%3A01%5C%22%2C%5C%22checkInEnd%5C%22%3A%5C%222023-07-13+00%3A00%3A01%5C%22%2C%5C%22bookStartTime%5C%22%3A%5C%222023-07-13+00%3A00%3A01%5C%22%2C%5C%22bookStartEnd%5C%22%3A%5C%222023-07-13+00%3A00%3A01%5C%22%2C%5C%22featureDetail%5C%22%3A%5C%22%5C%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%3A2014-01-28%2C%5C%22quota%5C%22%3A10%2C%5C%22price%5C%22%3A100%7D%2C%7B%5C%22date%5C%22%3A2014-01-29%2C%5C%22quota%5C%22%3A10%2C%5C%22price%5C%22%3A200%7D%5D%7D' \
-d 'jishiqueren_tag=1' \
-d 'lock_end_time=2016-07-15+00%3A00%3A00' \
-d 'lock_start_time=2016-07-16+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 'out_rid=12345AAA' \
-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 'vendor=taobao'
# -*- coding: utf-8 -*-
import top.api
req=top.api.XhotelRateUpdateRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.gid=100000
req.rpid=100000
req.name="aaa"
req.inventory_price="{\"use_room_inventory\":false,\"inventory_price\":[{\"date\":2014-01-28,\"quota\":10,\"price\":100},{\"date\":2014-01-29,\"quota\":10,\"price\":200}]}"
req.add_bed=1
req.add_bed_price=1
req.currency_code=1
req.shijia_tag=1
req.jishiqueren_tag=1
req.vendor="taobao"
req.rateplan_code="12345AAA"
req.out_rid="12345AAA"
req.rate_switch_cal="[{\"date\":\"yyyy-MM-dd\",\"rate_status\":1},{\"date\":\"yyyy-MM-dd\",\"rate_status\":0}]"
req.lock_end_time="2016-07-15 00:00:00"
req.lock_start_time="2016-07-16 00:00:00"
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.update");
add_param(pRequest,"gid","100000");
add_param(pRequest,"rpid","100000");
add_param(pRequest,"name","aaa");
add_param(pRequest,"inventory_price","{\"use_room_inventory\":false,\"inventory_price\":[{\"date\":2014-01-28,\"quota\":10,\"price\":100},{\"date\":2014-01-29,\"quota\":10,\"price\":200}]}");
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,"vendor","taobao");
add_param(pRequest,"rateplan_code","12345AAA");
add_param(pRequest,"out_rid","12345AAA");
add_param(pRequest,"rate_switch_cal","{"date":"yyyy-MM-dd","rate_status":1},{"date":"yyyy-MM-dd","rate_status":0}");
add_param(pRequest,"lock_end_time","2016-07-15 00:00:00");
add_param(pRequest,"lock_start_time","2016-07-16 00:00:00");
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.update', {
'gid':'100000',
'rpid':'100000',
'name':'aaa',
'inventory_price':'{\"use_room_inventory\":false,\"inventory_price\":[{\"date\":2014-01-28,\"quota\":10,\"price\":100},{\"date\":2014-01-29,\"quota\":10,\"price\":200}]}',
'add_bed':'1',
'add_bed_price':'1',
'currency_code':'1',
'shijia_tag':'1',
'jishiqueren_tag':'1',
'vendor':'taobao',
'rateplan_code':'12345AAA',
'out_rid':'12345AAA',
'rate_switch_cal':'{"date":"yyyy-MM-dd","rate_status":1},{"date":"yyyy-MM-dd","rate_status":0}',
'lock_end_time':'2016-07-15 00:00:00',
'lock_start_time':'2016-07-16 00:00:00',
'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);
})