TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
XhotelMultipleratesUpdateRequest req = new XhotelMultipleratesUpdateRequest();
req.setRateQuotaMap("[ { \"useRoomInventory\": false, \"outRoomId\": \"abc\", \"ratePlanCode\": \"WHL03\", \"vendor\": \"\", \"currencyCode\": \"CNY\", \"childAges\": \"2~5\", \"childRule\": [ { \"calculateType\": \"1\", \"ageRange\": \"4~6\", \"numRange\": \"1\", \"feeType\": \"10\" }, { \"calculateType\": \"2\", \"ageRange\": \"2~6\", \"numRange\": \"2\", \"feeType\": \"0.2\" } ], \"priceCalendar\": [ { \"date\": \"2017-04-16\", \"inventoryPrice\": [ { \"lengthOfStay\": 1, \"rateSwitch\": 0, \"quota\": 100, \"price\": [ { \"occupancy\": 5, \"basePrice\": 310000, \"taxAndFee\": 100, \"twoTax\": 200, \"threeTax\": 300, \"fourTax\": 400, \"fiveTax\": 500 } ] } ] } ], \"rateCalDataList\":[ { \"nod\":1, \"nop\":1, \"breakfastCal\":\"[{\\"date\\":\\"yyyy-MM-dd\\",\\"startDate\\":\\"yyyy-MM-dd\\",\\"endDate\\":\\"yyyy-MM-dd\\",\\"breakfast_count\\":0},{\\"date\\":\\"yyyy-MM-dd\\",\\"startDate\\":\\"yyyy-MM-dd\\",\\"endDate\\":\\"yyyy-MM-dd\\",\\"breakfast_count\\":1}]\", \"cancelPolicyCal\":\"[{\\"date\\":\\"yyyy-MM-dd\\",\\"startDate\\":\\"yyyy-MM-dd\\",\\"endDate\\":\\"yyyy-MM-dd\\",\\"cancel_policy\\":{\\"cancelPolicyType\\":1} },{\\"date\\":\\"yyyy-MM-dd\\",\\"startDate\\":\\"yyyy-MM-dd\\",\\"endDate\\":\\"yyyy-MM-dd\\",\\"cancel_policy\\":{\\"cancelPolicyType\\":4,\\"policyInfo\\":{\\"48\\":10,\\"24\\":20}}}]\" } ] } ]");
req.setStandardXitemInfos("[ { \"actionType\": \"BOUND\", \"outXCode\": \"123456\", \"subTypeCode\": \"70000_200\", \"name\": \"下午茶更新\", \"poi\": \"杭州西湖\", \"poiAddition\": \"杭州西湖addition\", \"subProducts\": [ { \"name\": \"早餐\", \"amount\": 1,#如果子产品是早餐,份数建议与rate_quota_map这个价库字段的nop一致;若加赠早餐场景下,份数可自行控制 \"price\": 38 } ], \"availableSubAmount\": 3, \"priceValue\": { \"price\": 100, \"sellingPrice\": 100 }, \"useRule\": { \"receptionTime\": [ { \"startTime\": \"00:00\", \"endTime\": \"01:00\" }, { \"startTime\": \"02:00\", \"endTime\": \"03:00\" }, { \"startTime\": \"03:00\", \"endTime\": \"04:00\" } ], \"adultAmount\": 2, \"childAmount\": 1, \"childHeight\": \"120\", \"childAge\": \"8\", \"bookingRule\": 1, \"bookingMinAmount\": 2, \"bookingUnit\": 1, \"contactNumber\": \"05316776678\", \"acquireType\": 1, \"effectiveType\": 0, \"additionalReminder\": \"补充提醒\" }, \"actionDimension\": 1, \"startDateTime\": \"2023-07-13 00:00:01\", \"endDateTime\": \"2024-07-13 00:00:01\", \"displayStartTime\": \"2023-07-13 00:00:01\", \"displayEndTime\": \"2024-07-13 00:00:01\", \"availableWeekDays\": \"1,2,3,4,5,6,7\", \"amount\": 2, \"childAmount\": 2 } ]");
XhotelMultipleratesUpdateResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
XhotelMultipleratesUpdateRequest req = new XhotelMultipleratesUpdateRequest();
req.RateQuotaMap = "[ { \"useRoomInventory\": false, \"outRoomId\": \"abc\", \"ratePlanCode\": \"WHL03\", \"vendor\": \"\", \"currencyCode\": \"CNY\", \"childAges\": \"2~5\", \"childRule\": [ { \"calculateType\": \"1\", \"ageRange\": \"4~6\", \"numRange\": \"1\", \"feeType\": \"10\" }, { \"calculateType\": \"2\", \"ageRange\": \"2~6\", \"numRange\": \"2\", \"feeType\": \"0.2\" } ], \"priceCalendar\": [ { \"date\": \"2017-04-16\", \"inventoryPrice\": [ { \"lengthOfStay\": 1, \"rateSwitch\": 0, \"quota\": 100, \"price\": [ { \"occupancy\": 5, \"basePrice\": 310000, \"taxAndFee\": 100, \"twoTax\": 200, \"threeTax\": 300, \"fourTax\": 400, \"fiveTax\": 500 } ] } ] } ], \"rateCalDataList\":[ { \"nod\":1, \"nop\":1, \"breakfastCal\":\"[{\\"date\\":\\"yyyy-MM-dd\\",\\"startDate\\":\\"yyyy-MM-dd\\",\\"endDate\\":\\"yyyy-MM-dd\\",\\"breakfast_count\\":0},{\\"date\\":\\"yyyy-MM-dd\\",\\"startDate\\":\\"yyyy-MM-dd\\",\\"endDate\\":\\"yyyy-MM-dd\\",\\"breakfast_count\\":1}]\", \"cancelPolicyCal\":\"[{\\"date\\":\\"yyyy-MM-dd\\",\\"startDate\\":\\"yyyy-MM-dd\\",\\"endDate\\":\\"yyyy-MM-dd\\",\\"cancel_policy\\":{\\"cancelPolicyType\\":1} },{\\"date\\":\\"yyyy-MM-dd\\",\\"startDate\\":\\"yyyy-MM-dd\\",\\"endDate\\":\\"yyyy-MM-dd\\",\\"cancel_policy\\":{\\"cancelPolicyType\\":4,\\"policyInfo\\":{\\"48\\":10,\\"24\\":20}}}]\" } ] } ]";
req.StandardXitemInfos = "[ { \"actionType\": \"BOUND\", \"outXCode\": \"123456\", \"subTypeCode\": \"70000_200\", \"name\": \"下午茶更新\", \"poi\": \"杭州西湖\", \"poiAddition\": \"杭州西湖addition\", \"subProducts\": [ { \"name\": \"早餐\", \"amount\": 1,#如果子产品是早餐,份数建议与rate_quota_map这个价库字段的nop一致;若加赠早餐场景下,份数可自行控制 \"price\": 38 } ], \"availableSubAmount\": 3, \"priceValue\": { \"price\": 100, \"sellingPrice\": 100 }, \"useRule\": { \"receptionTime\": [ { \"startTime\": \"00:00\", \"endTime\": \"01:00\" }, { \"startTime\": \"02:00\", \"endTime\": \"03:00\" }, { \"startTime\": \"03:00\", \"endTime\": \"04:00\" } ], \"adultAmount\": 2, \"childAmount\": 1, \"childHeight\": \"120\", \"childAge\": \"8\", \"bookingRule\": 1, \"bookingMinAmount\": 2, \"bookingUnit\": 1, \"contactNumber\": \"05316776678\", \"acquireType\": 1, \"effectiveType\": 0, \"additionalReminder\": \"补充提醒\" }, \"actionDimension\": 1, \"startDateTime\": \"2023-07-13 00:00:01\", \"endDateTime\": \"2024-07-13 00:00:01\", \"displayStartTime\": \"2023-07-13 00:00:01\", \"displayEndTime\": \"2024-07-13 00:00:01\", \"availableWeekDays\": \"1,2,3,4,5,6,7\", \"amount\": 2, \"childAmount\": 2 } ]";
XhotelMultipleratesUpdateResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new XhotelMultipleratesUpdateRequest;
$req->setRateQuotaMap("[ { \"useRoomInventory\": false, \"outRoomId\": \"abc\", \"ratePlanCode\": \"WHL03\", \"vendor\": \"\", \"currencyCode\": \"CNY\", \"childAges\": \"2~5\", \"childRule\": [ { \"calculateType\": \"1\", \"ageRange\": \"4~6\", \"numRange\": \"1\", \"feeType\": \"10\" }, { \"calculateType\": \"2\", \"ageRange\": \"2~6\", \"numRange\": \"2\", \"feeType\": \"0.2\" } ], \"priceCalendar\": [ { \"date\": \"2017-04-16\", \"inventoryPrice\": [ { \"lengthOfStay\": 1, \"rateSwitch\": 0, \"quota\": 100, \"price\": [ { \"occupancy\": 5, \"basePrice\": 310000, \"taxAndFee\": 100, \"twoTax\": 200, \"threeTax\": 300, \"fourTax\": 400, \"fiveTax\": 500 } ] } ] } ], \"rateCalDataList\":[ { \"nod\":1, \"nop\":1, \"breakfastCal\":\"[{\\"date\\":\\"yyyy-MM-dd\\",\\"startDate\\":\\"yyyy-MM-dd\\",\\"endDate\\":\\"yyyy-MM-dd\\",\\"breakfast_count\\":0},{\\"date\\":\\"yyyy-MM-dd\\",\\"startDate\\":\\"yyyy-MM-dd\\",\\"endDate\\":\\"yyyy-MM-dd\\",\\"breakfast_count\\":1}]\", \"cancelPolicyCal\":\"[{\\"date\\":\\"yyyy-MM-dd\\",\\"startDate\\":\\"yyyy-MM-dd\\",\\"endDate\\":\\"yyyy-MM-dd\\",\\"cancel_policy\\":{\\"cancelPolicyType\\":1} },{\\"date\\":\\"yyyy-MM-dd\\",\\"startDate\\":\\"yyyy-MM-dd\\",\\"endDate\\":\\"yyyy-MM-dd\\",\\"cancel_policy\\":{\\"cancelPolicyType\\":4,\\"policyInfo\\":{\\"48\\":10,\\"24\\":20}}}]\" } ] } ]");
$req->setStandardXitemInfos("[ { \"actionType\": \"BOUND\", \"outXCode\": \"123456\", \"subTypeCode\": \"70000_200\", \"name\": \"下午茶更新\", \"poi\": \"杭州西湖\", \"poiAddition\": \"杭州西湖addition\", \"subProducts\": [ { \"name\": \"早餐\", \"amount\": 1,#如果子产品是早餐,份数建议与rate_quota_map这个价库字段的nop一致;若加赠早餐场景下,份数可自行控制 \"price\": 38 } ], \"availableSubAmount\": 3, \"priceValue\": { \"price\": 100, \"sellingPrice\": 100 }, \"useRule\": { \"receptionTime\": [ { \"startTime\": \"00:00\", \"endTime\": \"01:00\" }, { \"startTime\": \"02:00\", \"endTime\": \"03:00\" }, { \"startTime\": \"03:00\", \"endTime\": \"04:00\" } ], \"adultAmount\": 2, \"childAmount\": 1, \"childHeight\": \"120\", \"childAge\": \"8\", \"bookingRule\": 1, \"bookingMinAmount\": 2, \"bookingUnit\": 1, \"contactNumber\": \"05316776678\", \"acquireType\": 1, \"effectiveType\": 0, \"additionalReminder\": \"补充提醒\" }, \"actionDimension\": 1, \"startDateTime\": \"2023-07-13 00:00:01\", \"endDateTime\": \"2024-07-13 00:00:01\", \"displayStartTime\": \"2023-07-13 00:00:01\", \"displayEndTime\": \"2024-07-13 00:00:01\", \"availableWeekDays\": \"1,2,3,4,5,6,7\", \"amount\": 2, \"childAmount\": 2 } ]");
$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.multiplerates.update' \
-d 'partner_id=apidoc' \
-d 'session=002c325b-5477-4c10-aec8-6d6ad826eb8d' \
-d 'sign=9EC89BB0780CE1250D038C221655F99E' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-12-26+19%3A42%3A28' \
-d 'v=2.0' \
-d 'rate_quota_map=+++++%7B+++++++++%22useRoomInventory%22%3A+false%2C+++++++++%22outRoomId%22%3A+%22abc%22%2C+++++++++%22ratePlanCode%22%3A+%22WHL03%22%2C+++++++++%22vendor%22%3A+%22%22%2C+++++++++%22currencyCode%22%3A+%22CNY%22%2C+++++++++%22childAges%22%3A+%222%7E5%22%2C+++++++++%22childRule%22%3A+%5B+++++++++++++%7B+++++++++++++++++%22calculateType%22%3A+%221%22%2C+++++++++++++++++%22ageRange%22%3A+%224%7E6%22%2C+++++++++++++++++%22numRange%22%3A+%221%22%2C+++++++++++++++++%22feeType%22%3A+%2210%22+++++++++++++%7D%2C+++++++++++++%7B+++++++++++++++++%22calculateType%22%3A+%222%22%2C+++++++++++++++++%22ageRange%22%3A+%222%7E6%22%2C+++++++++++++++++%22numRange%22%3A+%222%22%2C+++++++++++++++++%22feeType%22%3A+%220.2%22+++++++++++++%7D+++++++++%5D%2C+++++++++%22priceCalendar%22%3A+%5B+++++++++++++%7B+++++++++++++++++%22date%22%3A+%222017-04-16%22%2C+++++++++++++++++%22inventoryPrice%22%3A+%5B+++++++++++++++++++++%7B+++++++++++++++++++++++++%22lengthOfStay%22%3A+1%2C+++++++++++++++++++++++++%22rateSwitch%22%3A+0%2C+++++++++++++++++++++++++%22quota%22%3A+100%2C+++++++++++++++++++++++++%22price%22%3A+%5B+++++++++++++++++++++++++++++%7B+++++++++++++++++++++++++++++++++%22occupancy%22%3A+5%2C+++++++++++++++++++++++++++++++++%22basePrice%22%3A+310000%2C+++++++++++++++++++++++++++++++++%22taxAndFee%22%3A+100%2C+++++++++++++++++++++++++++++++++%22twoTax%22%3A+200%2C+++++++++++++++++++++++++++++++++%22threeTax%22%3A+300%2C+++++++++++++++++++++++++++++++++%22fourTax%22%3A+400%2C+++++++++++++++++++++++++++++++++%22fiveTax%22%3A+500+++++++++++++++++++++++++++++%7D+++++++++++++++++++++++++%5D+++++++++++++++++++++%7D+++++++++++++++++%5D+++++++++++++%7D+++++++++%5D%2C+++++++%22rateCalDataList%22%3A%5B+++++++++%7B+++++++++%09%22nod%22%3A1%2C+++++++++++%09%22nop%22%3A1%2C+++++++++++%09%22breakfastCal%22%3A%22%5B%7B%5C%22date%5C%22%3A%5C%22yyyy-MM-dd%5C%22%2C%5C%22startDate%5C%22%3A%5C%22yyyy-MM-dd%5C%22%2C%5C%22endDate%5C%22%3A%5C%22yyyy-MM-dd%5C%22%2C%5C%22breakfast_count%5C%22%3A0%7D%2C%7B%5C%22date%5C%22%3A%5C%22yyyy-MM-dd%5C%22%2C%5C%22startDate%5C%22%3A%5C%22yyyy-MM-dd%5C%22%2C%5C%22endDate%5C%22%3A%5C%22yyyy-MM-dd%5C%22%2C%5C%22breakfast_count%5C%22%3A1%7D%5D%22%2C+++++++++%09%22cancelPolicyCal%22%3A%22%5B%7B%5C%22date%5C%22%3A%5C%22yyyy-MM-dd%5C%22%2C%5C%22startDate%5C%22%3A%5C%22yyyy-MM-dd%5C%22%2C%5C%22endDate%5C%22%3A%5C%22yyyy-MM-dd%5C%22%2C%5C%22cancel_policy%5C%22%3A%7B%5C%22cancelPolicyType%5C%22%3A1%7D+%7D%2C%7B%5C%22date%5C%22%3A%5C%22yyyy-MM-dd%5C%22%2C%5C%22startDate%5C%22%3A%5C%22yyyy-MM-dd%5C%22%2C%5C%22endDate%5C%22%3A%5C%22yyyy-MM-dd%5C%22%2C%5C%22cancel_policy%5C%22%3A%7B%5C%22cancelPolicyType%5C%22%3A4%2C%5C%22policyInfo%5C%22%3A%7B%5C%2248%5C%22%3A10%2C%5C%2224%5C%22%3A20%7D%7D%7D%5D%22+++++++++%7D+++++++%5D+++++%7D+' \
-d 'standard_xitem_infos=+%7B+%22actionType%22%3A+%22BOUND%22%2C+%22outXCode%22%3A+%22123456%22%2C+%22subTypeCode%22%3A+%2270000_200%22%2C+%22name%22%3A+%22%E4%B8%8B%E5%8D%88%E8%8C%B6%E6%9B%B4%E6%96%B0%22%2C+%22poi%22%3A+%22%E6%9D%AD%E5%B7%9E%E8%A5%BF%E6%B9%96%22%2C+%22poiAddition%22%3A+%22%E6%9D%AD%E5%B7%9E%E8%A5%BF%E6%B9%96addition%22%2C+%22subProducts%22%3A+%5B+%7B+%22name%22%3A+%22%E6%97%A9%E9%A4%90%22%2C+%22amount%22%3A+1%2C%23%E5%A6%82%E6%9E%9C%E5%AD%90%E4%BA%A7%E5%93%81%E6%98%AF%E6%97%A9%E9%A4%90%EF%BC%8C%E4%BB%BD%E6%95%B0%E5%BB%BA%E8%AE%AE%E4%B8%8Erate_quota_map%E8%BF%99%E4%B8%AA%E4%BB%B7%E5%BA%93%E5%AD%97%E6%AE%B5%E7%9A%84nop%E4%B8%80%E8%87%B4%EF%BC%9B%E8%8B%A5%E5%8A%A0%E8%B5%A0%E6%97%A9%E9%A4%90%E5%9C%BA%E6%99%AF%E4%B8%8B%EF%BC%8C%E4%BB%BD%E6%95%B0%E5%8F%AF%E8%87%AA%E8%A1%8C%E6%8E%A7%E5%88%B6+%22price%22%3A+38+%7D+%5D%2C+%22availableSubAmount%22%3A+3%2C+%22priceValue%22%3A+%7B+%22price%22%3A+100%2C+%22sellingPrice%22%3A+100+%7D%2C+%22useRule%22%3A+%7B+%22receptionTime%22%3A+%5B+%7B+%22startTime%22%3A+%2200%3A00%22%2C+%22endTime%22%3A+%2201%3A00%22+%7D%2C+%7B+%22startTime%22%3A+%2202%3A00%22%2C+%22endTime%22%3A+%2203%3A00%22+%7D%2C+%7B+%22startTime%22%3A+%2203%3A00%22%2C+%22endTime%22%3A+%2204%3A00%22+%7D+%5D%2C+%22adultAmount%22%3A+2%2C+%22childAmount%22%3A+1%2C+%22childHeight%22%3A+%22120%22%2C+%22childAge%22%3A+%228%22%2C+%22bookingRule%22%3A+1%2C+%22bookingMinAmount%22%3A+2%2C+%22bookingUnit%22%3A+1%2C+%22contactNumber%22%3A+%2205316776678%22%2C+%22acquireType%22%3A+1%2C+%22effectiveType%22%3A+0%2C+%22additionalReminder%22%3A+%22%E8%A1%A5%E5%85%85%E6%8F%90%E9%86%92%22+%7D%2C+%22actionDimension%22%3A+1%2C+%22startDateTime%22%3A+%222023-07-13+00%3A00%3A01%22%2C+%22endDateTime%22%3A+%222024-07-13+00%3A00%3A01%22%2C+%22displayStartTime%22%3A+%222023-07-13+00%3A00%3A01%22%2C+%22displayEndTime%22%3A+%222024-07-13+00%3A00%3A01%22%2C+%22availableWeekDays%22%3A+%221%2C2%2C3%2C4%2C5%2C6%2C7%22%2C+%22amount%22%3A+2%2C+%22childAmount%22%3A+2+%7D+'
# -*- coding: utf-8 -*-
import top.api
req=top.api.XhotelMultipleratesUpdateRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.rate_quota_map="[ { \"useRoomInventory\": false, \"outRoomId\": \"abc\", \"ratePlanCode\": \"WHL03\", \"vendor\": \"\", \"currencyCode\": \"CNY\", \"childAges\": \"2~5\", \"childRule\": [ { \"calculateType\": \"1\", \"ageRange\": \"4~6\", \"numRange\": \"1\", \"feeType\": \"10\" }, { \"calculateType\": \"2\", \"ageRange\": \"2~6\", \"numRange\": \"2\", \"feeType\": \"0.2\" } ], \"priceCalendar\": [ { \"date\": \"2017-04-16\", \"inventoryPrice\": [ { \"lengthOfStay\": 1, \"rateSwitch\": 0, \"quota\": 100, \"price\": [ { \"occupancy\": 5, \"basePrice\": 310000, \"taxAndFee\": 100, \"twoTax\": 200, \"threeTax\": 300, \"fourTax\": 400, \"fiveTax\": 500 } ] } ] } ], \"rateCalDataList\":[ { \"nod\":1, \"nop\":1, \"breakfastCal\":\"[{\\"date\\":\\"yyyy-MM-dd\\",\\"startDate\\":\\"yyyy-MM-dd\\",\\"endDate\\":\\"yyyy-MM-dd\\",\\"breakfast_count\\":0},{\\"date\\":\\"yyyy-MM-dd\\",\\"startDate\\":\\"yyyy-MM-dd\\",\\"endDate\\":\\"yyyy-MM-dd\\",\\"breakfast_count\\":1}]\", \"cancelPolicyCal\":\"[{\\"date\\":\\"yyyy-MM-dd\\",\\"startDate\\":\\"yyyy-MM-dd\\",\\"endDate\\":\\"yyyy-MM-dd\\",\\"cancel_policy\\":{\\"cancelPolicyType\\":1} },{\\"date\\":\\"yyyy-MM-dd\\",\\"startDate\\":\\"yyyy-MM-dd\\",\\"endDate\\":\\"yyyy-MM-dd\\",\\"cancel_policy\\":{\\"cancelPolicyType\\":4,\\"policyInfo\\":{\\"48\\":10,\\"24\\":20}}}]\" } ] } ]"
req.standard_xitem_infos="[ { \"actionType\": \"BOUND\", \"outXCode\": \"123456\", \"subTypeCode\": \"70000_200\", \"name\": \"下午茶更新\", \"poi\": \"杭州西湖\", \"poiAddition\": \"杭州西湖addition\", \"subProducts\": [ { \"name\": \"早餐\", \"amount\": 1,#如果子产品是早餐,份数建议与rate_quota_map这个价库字段的nop一致;若加赠早餐场景下,份数可自行控制 \"price\": 38 } ], \"availableSubAmount\": 3, \"priceValue\": { \"price\": 100, \"sellingPrice\": 100 }, \"useRule\": { \"receptionTime\": [ { \"startTime\": \"00:00\", \"endTime\": \"01:00\" }, { \"startTime\": \"02:00\", \"endTime\": \"03:00\" }, { \"startTime\": \"03:00\", \"endTime\": \"04:00\" } ], \"adultAmount\": 2, \"childAmount\": 1, \"childHeight\": \"120\", \"childAge\": \"8\", \"bookingRule\": 1, \"bookingMinAmount\": 2, \"bookingUnit\": 1, \"contactNumber\": \"05316776678\", \"acquireType\": 1, \"effectiveType\": 0, \"additionalReminder\": \"补充提醒\" }, \"actionDimension\": 1, \"startDateTime\": \"2023-07-13 00:00:01\", \"endDateTime\": \"2024-07-13 00:00:01\", \"displayStartTime\": \"2023-07-13 00:00:01\", \"displayEndTime\": \"2024-07-13 00:00:01\", \"availableWeekDays\": \"1,2,3,4,5,6,7\", \"amount\": 2, \"childAmount\": 2 } ]"
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.multiplerates.update");
add_param(pRequest,"rate_quota_map"," { "useRoomInventory": false, "outRoomId": "abc", "ratePlanCode": "WHL03", "vendor": "", "currencyCode": "CNY", "childAges": "2~5", "childRule": [ { "calculateType": "1", "ageRange": "4~6", "numRange": "1", "feeType": "10" }, { "calculateType": "2", "ageRange": "2~6", "numRange": "2", "feeType": "0.2" } ], "priceCalendar": [ { "date": "2017-04-16", "inventoryPrice": [ { "lengthOfStay": 1, "rateSwitch": 0, "quota": 100, "price": [ { "occupancy": 5, "basePrice": 310000, "taxAndFee": 100, "twoTax": 200, "threeTax": 300, "fourTax": 400, "fiveTax": 500 } ] } ] } ], "rateCalDataList":[ { "nod":1, "nop":1, "breakfastCal":"[{\"date\":\"yyyy-MM-dd\",\"startDate\":\"yyyy-MM-dd\",\"endDate\":\"yyyy-MM-dd\",\"breakfast_count\":0},{\"date\":\"yyyy-MM-dd\",\"startDate\":\"yyyy-MM-dd\",\"endDate\":\"yyyy-MM-dd\",\"breakfast_count\":1}]", "cancelPolicyCal":"[{\"date\":\"yyyy-MM-dd\",\"startDate\":\"yyyy-MM-dd\",\"endDate\":\"yyyy-MM-dd\",\"cancel_policy\":{\"cancelPolicyType\":1} },{\"date\":\"yyyy-MM-dd\",\"startDate\":\"yyyy-MM-dd\",\"endDate\":\"yyyy-MM-dd\",\"cancel_policy\":{\"cancelPolicyType\":4,\"policyInfo\":{\"48\":10,\"24\":20}}}]" } ] } ");
add_param(pRequest,"standard_xitem_infos"," { "actionType": "BOUND", "outXCode": "123456", "subTypeCode": "70000_200", "name": "下午茶更新", "poi": "杭州西湖", "poiAddition": "杭州西湖addition", "subProducts": [ { "name": "早餐", "amount": 1,#如果子产品是早餐,份数建议与rate_quota_map这个价库字段的nop一致;若加赠早餐场景下,份数可自行控制 "price": 38 } ], "availableSubAmount": 3, "priceValue": { "price": 100, "sellingPrice": 100 }, "useRule": { "receptionTime": [ { "startTime": "00:00", "endTime": "01:00" }, { "startTime": "02:00", "endTime": "03:00" }, { "startTime": "03:00", "endTime": "04:00" } ], "adultAmount": 2, "childAmount": 1, "childHeight": "120", "childAge": "8", "bookingRule": 1, "bookingMinAmount": 2, "bookingUnit": 1, "contactNumber": "05316776678", "acquireType": 1, "effectiveType": 0, "additionalReminder": "补充提醒" }, "actionDimension": 1, "startDateTime": "2023-07-13 00:00:01", "endDateTime": "2024-07-13 00:00:01", "displayStartTime": "2023-07-13 00:00:01", "displayEndTime": "2024-07-13 00:00:01", "availableWeekDays": "1,2,3,4,5,6,7", "amount": 2, "childAmount": 2 } ");
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.multiplerates.update', {
'rate_quota_map':' { "useRoomInventory": false, "outRoomId": "abc", "ratePlanCode": "WHL03", "vendor": "", "currencyCode": "CNY", "childAges": "2~5", "childRule": [ { "calculateType": "1", "ageRange": "4~6", "numRange": "1", "feeType": "10" }, { "calculateType": "2", "ageRange": "2~6", "numRange": "2", "feeType": "0.2" } ], "priceCalendar": [ { "date": "2017-04-16", "inventoryPrice": [ { "lengthOfStay": 1, "rateSwitch": 0, "quota": 100, "price": [ { "occupancy": 5, "basePrice": 310000, "taxAndFee": 100, "twoTax": 200, "threeTax": 300, "fourTax": 400, "fiveTax": 500 } ] } ] } ], "rateCalDataList":[ { "nod":1, "nop":1, "breakfastCal":"[{\"date\":\"yyyy-MM-dd\",\"startDate\":\"yyyy-MM-dd\",\"endDate\":\"yyyy-MM-dd\",\"breakfast_count\":0},{\"date\":\"yyyy-MM-dd\",\"startDate\":\"yyyy-MM-dd\",\"endDate\":\"yyyy-MM-dd\",\"breakfast_count\":1}]", "cancelPolicyCal":"[{\"date\":\"yyyy-MM-dd\",\"startDate\":\"yyyy-MM-dd\",\"endDate\":\"yyyy-MM-dd\",\"cancel_policy\":{\"cancelPolicyType\":1} },{\"date\":\"yyyy-MM-dd\",\"startDate\":\"yyyy-MM-dd\",\"endDate\":\"yyyy-MM-dd\",\"cancel_policy\":{\"cancelPolicyType\":4,\"policyInfo\":{\"48\":10,\"24\":20}}}]" } ] } ',
'standard_xitem_infos':' { "actionType": "BOUND", "outXCode": "123456", "subTypeCode": "70000_200", "name": "下午茶更新", "poi": "杭州西湖", "poiAddition": "杭州西湖addition", "subProducts": [ { "name": "早餐", "amount": 1,#如果子产品是早餐,份数建议与rate_quota_map这个价库字段的nop一致;若加赠早餐场景下,份数可自行控制 "price": 38 } ], "availableSubAmount": 3, "priceValue": { "price": 100, "sellingPrice": 100 }, "useRule": { "receptionTime": [ { "startTime": "00:00", "endTime": "01:00" }, { "startTime": "02:00", "endTime": "03:00" }, { "startTime": "03:00", "endTime": "04:00" } ], "adultAmount": 2, "childAmount": 1, "childHeight": "120", "childAge": "8", "bookingRule": 1, "bookingMinAmount": 2, "bookingUnit": 1, "contactNumber": "05316776678", "acquireType": 1, "effectiveType": 0, "additionalReminder": "补充提醒" }, "actionDimension": 1, "startDateTime": "2023-07-13 00:00:01", "endDateTime": "2024-07-13 00:00:01", "displayStartTime": "2023-07-13 00:00:01", "displayEndTime": "2024-07-13 00:00:01", "availableWeekDays": "1,2,3,4,5,6,7", "amount": 2, "childAmount": 2 } '
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})