TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
XhotelRateplanAddRequest req = new XhotelRateplanAddRequest();
req.setRateplanCode("12345AAA");
req.setName("含早提前3天");
req.setEnglishName("aaa");
req.setPaymentType(1L);
req.setBreakfastCount(1L);
req.setFeeBreakfastCount(1L);
req.setFeeBreakfastAmount(1L);
req.setFeeGovTaxAmount(1L);
req.setFeeGovTaxPercent(1L);
req.setFeeServiceAmount(150L);
req.setFeeServicePercent(15L);
req.setExtendFee("aaa");
req.setMinDays(1L);
req.setMaxDays(90L);
req.setMinAmount(1L);
req.setMinAdvHours(1L);
req.setMaxAdvHours(3L);
req.setStartTime("00:00");
req.setEndTime("00:00");
req.setCancelPolicy("{\"cancelPolicyType\":1}|{\"cancelPolicyType\":2}|{\"cancelPolicyType\":4,\"policyInfo\":{\"48\":10,\"24\":20}}|{\"cancelPolicyType\":5,\"policyInfo\":{\"timeBefore\":6}}|{\"cancelPolicyType\":6,\"policyInfo\":{\"14\":1}}");
req.setExtend("1");
req.setStatus(1L);
req.setGuaranteeType(1L);
req.setGuaranteeStartTime("18:00");
req.setMemberLevel("1,2,3,4,5,6");
req.setChannel("A");
req.setOccupancy(2L);
req.setVendor("taobao");
req.setFirstStay(1L);
req.setAgreement(2L);
req.setCancelBeforeDay(2L);
req.setCancelBeforeHour("6");
req.setBreakfastCal("[{\"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}]");
req.setCancelPolicyCal("[{\"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.setGuaranteeCal("[{\"date\":\"yyyy-MM-dd\",\"startDate\":\"yyyy-MM-dd\",\"endDate\":\"yyyy-MM-dd\",\"guarantee\":{\"guaranteeType\":2,\"guaranteeStartTime\":\"HH:mm\"}},{\"date\":\"yyyy-MM-dd\",\"startDate\":\"yyyy-MM-dd\",\"endDate\":\"yyyy-MM-dd\",\"guarantee\":{\"guaranteeType\":3,\"guaranteeStartTime\":\"HH:mm\"}}]");
req.setEffectiveTime(StringUtils.parseDateTime("2000-01-01 00:00:00"));
req.setDeadlineTime(StringUtils.parseDateTime("2000-01-01 00:00:00"));
req.setRpType("1");
req.setHourage("4");
req.setCanCheckinEnd("08:00");
req.setCanCheckinStart("16:00");
req.setMaxChildAge(5L);
req.setMinChildAge(5L);
req.setMaxInfantAge(5L);
req.setMinInfantAge(5L);
req.setDinningDesc("西餐");
req.setIsStudent(0L);
req.setHid(1L);
req.setRid(1L);
req.setOutHid("1");
req.setOutRid("1");
req.setSuperRpFlag(1L);
req.setBaseRpFlag(1L);
req.setGuaranteeMode(1L);
req.setParentRpCode("0");
req.setParentRpid(0L);
req.setOperator("0");
req.setTagJson("{\"non-direct-RP\":1,\"super-could-price-change-RP\":0,\"base-could-derived-RP\":1,\"ebk-tail-room-RP\":0}");
req.setSource(1L);
req.setAllotmentReleaseTime("6");
req.setCommonAllotReleaseTime("6");
req.setResourceType("1");
req.setBottomPriceFlag(0L);
req.setCanCheckoutEnd("16:00");
req.setMemDiscFlag(1L);
req.setMemberDiscountCal("[{\"c\":\"8\",\"t\":1,\"s\": \"20191211\",\"e\":\"20191225\"}]");
req.setGuestLimit("{\"guestArea\":1,\"guestSex\":\"MAN\",\"minGuestAge\":0,\"maxGuestAge\":99}");
req.setActivityType("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.setRights("[{\"type\": \"eeo\", \"value\": \"1,2,3,4\"}]");
req.setFreeRoomChargeDstRole("seller");
req.setChildrenPricePolicy("{\"childrenPricePolicyList\":[{\"max\":1,\"min\":0,\"t\":\"1\",\"v\":\"30.23\"},{\"max\":17,\"min\":2,\"t\":\"2\",\"v\":\"20000\"}]}");
XhotelRateplanAddResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
XhotelRateplanAddRequest req = new XhotelRateplanAddRequest();
req.RateplanCode = "12345AAA";
req.Name = "含早提前3天";
req.EnglishName = "aaa";
req.PaymentType = 1L;
req.BreakfastCount = 1L;
req.FeeBreakfastCount = 1L;
req.FeeBreakfastAmount = 1L;
req.FeeGovTaxAmount = 1L;
req.FeeGovTaxPercent = 1L;
req.FeeServiceAmount = 150L;
req.FeeServicePercent = 15L;
req.ExtendFee = "aaa";
req.MinDays = 1L;
req.MaxDays = 90L;
req.MinAmount = 1L;
req.MinAdvHours = 1L;
req.MaxAdvHours = 3L;
req.StartTime = "00:00";
req.EndTime = "00:00";
req.CancelPolicy = "{\"cancelPolicyType\":1}|{\"cancelPolicyType\":2}|{\"cancelPolicyType\":4,\"policyInfo\":{\"48\":10,\"24\":20}}|{\"cancelPolicyType\":5,\"policyInfo\":{\"timeBefore\":6}}|{\"cancelPolicyType\":6,\"policyInfo\":{\"14\":1}}";
req.Extend = "1";
req.Status = 1L;
req.GuaranteeType = 1L;
req.GuaranteeStartTime = "18:00";
req.MemberLevel = "1,2,3,4,5,6";
req.Channel = "A";
req.Occupancy = 2L;
req.Vendor = "taobao";
req.FirstStay = 1L;
req.Agreement = 2L;
req.CancelBeforeDay = 2L;
req.CancelBeforeHour = "6";
req.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}]";
req.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.GuaranteeCal = "[{\"date\":\"yyyy-MM-dd\",\"startDate\":\"yyyy-MM-dd\",\"endDate\":\"yyyy-MM-dd\",\"guarantee\":{\"guaranteeType\":2,\"guaranteeStartTime\":\"HH:mm\"}},{\"date\":\"yyyy-MM-dd\",\"startDate\":\"yyyy-MM-dd\",\"endDate\":\"yyyy-MM-dd\",\"guarantee\":{\"guaranteeType\":3,\"guaranteeStartTime\":\"HH:mm\"}}]";
req.EffectiveTime = DateTime.Parse("2000-01-01 00:00:00");
req.DeadlineTime = DateTime.Parse("2000-01-01 00:00:00");
req.RpType = "1";
req.Hourage = "4";
req.CanCheckinEnd = "08:00";
req.CanCheckinStart = "16:00";
req.MaxChildAge = 5L;
req.MinChildAge = 5L;
req.MaxInfantAge = 5L;
req.MinInfantAge = 5L;
req.DinningDesc = "西餐";
req.IsStudent = 0L;
req.Hid = 1L;
req.Rid = 1L;
req.OutHid = "1";
req.OutRid = "1";
req.SuperRpFlag = 1L;
req.BaseRpFlag = 1L;
req.GuaranteeMode = 1L;
req.ParentRpCode = "0";
req.ParentRpid = 0L;
req.Operator = "0";
req.TagJson = "{\"non-direct-RP\":1,\"super-could-price-change-RP\":0,\"base-could-derived-RP\":1,\"ebk-tail-room-RP\":0}";
req.Source = 1L;
req.AllotmentReleaseTime = "6";
req.CommonAllotReleaseTime = "6";
req.ResourceType = "1";
req.BottomPriceFlag = 0L;
req.CanCheckoutEnd = "16:00";
req.MemDiscFlag = 1L;
req.MemberDiscountCal = "[{\"c\":\"8\",\"t\":1,\"s\": \"20191211\",\"e\":\"20191225\"}]";
req.GuestLimit = "{\"guestArea\":1,\"guestSex\":\"MAN\",\"minGuestAge\":0,\"maxGuestAge\":99}";
req.ActivityType = "1";
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.Rights = "[{\"type\": \"eeo\", \"value\": \"1,2,3,4\"}]";
req.FreeRoomChargeDstRole = "seller";
req.ChildrenPricePolicy = "{\"childrenPricePolicyList\":[{\"max\":1,\"min\":0,\"t\":\"1\",\"v\":\"30.23\"},{\"max\":17,\"min\":2,\"t\":\"2\",\"v\":\"20000\"}]}";
XhotelRateplanAddResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new XhotelRateplanAddRequest;
$req->setRateplanCode("12345AAA");
$req->setName("含早提前3天");
$req->setEnglishName("aaa");
$req->setPaymentType("1");
$req->setBreakfastCount("1");
$req->setFeeBreakfastCount("1");
$req->setFeeBreakfastAmount("1");
$req->setFeeGovTaxAmount("1");
$req->setFeeGovTaxPercent("1");
$req->setFeeServiceAmount("150");
$req->setFeeServicePercent("15");
$req->setExtendFee("aaa");
$req->setMinDays("1");
$req->setMaxDays("90");
$req->setMinAmount("1");
$req->setMinAdvHours("1");
$req->setMaxAdvHours("3");
$req->setStartTime("00:00");
$req->setEndTime("00:00");
$req->setCancelPolicy("{\"cancelPolicyType\":1}|{\"cancelPolicyType\":2}|{\"cancelPolicyType\":4,\"policyInfo\":{\"48\":10,\"24\":20}}|{\"cancelPolicyType\":5,\"policyInfo\":{\"timeBefore\":6}}|{\"cancelPolicyType\":6,\"policyInfo\":{\"14\":1}}");
$req->setExtend("1");
$req->setStatus("1");
$req->setGuaranteeType("1");
$req->setGuaranteeStartTime("18:00");
$req->setMemberLevel("1,2,3,4,5,6");
$req->setChannel("A");
$req->setOccupancy("2");
$req->setVendor("taobao");
$req->setFirstStay("1");
$req->setAgreement("2");
$req->setCancelBeforeDay("2");
$req->setCancelBeforeHour("6");
$req->setBreakfastCal("[{\"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}]");
$req->setCancelPolicyCal("[{\"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->setGuaranteeCal("[{\"date\":\"yyyy-MM-dd\",\"startDate\":\"yyyy-MM-dd\",\"endDate\":\"yyyy-MM-dd\",\"guarantee\":{\"guaranteeType\":2,\"guaranteeStartTime\":\"HH:mm\"}},{\"date\":\"yyyy-MM-dd\",\"startDate\":\"yyyy-MM-dd\",\"endDate\":\"yyyy-MM-dd\",\"guarantee\":{\"guaranteeType\":3,\"guaranteeStartTime\":\"HH:mm\"}}]");
$req->setEffectiveTime("2000-01-01 00:00:00");
$req->setDeadlineTime("2000-01-01 00:00:00");
$req->setRpType("1");
$req->setHourage("4");
$req->setCanCheckinEnd("08:00");
$req->setCanCheckinStart("16:00");
$req->setMaxChildAge("5");
$req->setMinChildAge("5");
$req->setMaxInfantAge("5");
$req->setMinInfantAge("5");
$req->setDinningDesc("西餐");
$req->setIsStudent("0");
$req->setHid("1");
$req->setRid("1");
$req->setOutHid("1");
$req->setOutRid("1");
$req->setSuperRpFlag("1");
$req->setBaseRpFlag("1");
$req->setGuaranteeMode("1");
$req->setParentRpCode("0");
$req->setParentRpid("0");
$req->setOperator("0");
$req->setTagJson("{\"non-direct-RP\":1,\"super-could-price-change-RP\":0,\"base-could-derived-RP\":1,\"ebk-tail-room-RP\":0}");
$req->setSource("1");
$req->setAllotmentReleaseTime("6");
$req->setCommonAllotReleaseTime("6");
$req->setResourceType("1");
$req->setBottomPriceFlag("0");
$req->setCanCheckoutEnd("16:00");
$req->setMemDiscFlag("1");
$req->setMemberDiscountCal("[{\"c\":\"8\",\"t\":1,\"s\": \"20191211\",\"e\":\"20191225\"}]");
$req->setGuestLimit("{\"guestArea\":1,\"guestSex\":\"MAN\",\"minGuestAge\":0,\"maxGuestAge\":99}");
$req->setActivityType("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->setRights("[{\"type\": \"eeo\", \"value\": \"1,2,3,4\"}]");
$req->setFreeRoomChargeDstRole("seller");
$req->setChildrenPricePolicy("{\"childrenPricePolicyList\":[{\"max\":1,\"min\":0,\"t\":\"1\",\"v\":\"30.23\"},{\"max\":17,\"min\":2,\"t\":\"2\",\"v\":\"20000\"}]}");
$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.rateplan.add' \
-d 'partner_id=apidoc' \
-d 'session=a0699b0d-e75d-46b4-9cfb-d542da435b97' \
-d 'sign=15556B27C4550DA4C5A18327DFC628CF' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-23+17%3A34%3A12' \
-d 'v=2.0' \
-d 'activity_type=1' \
-d 'agreement=2' \
-d 'allotment_release_time=6' \
-d 'base_rp_flag=1' \
-d 'bottom_price_flag=0' \
-d 'breakfast_cal=%7B%22date%22%3A%22yyyy-MM-dd%22%2C%22startDate%22%3A%22yyyy-MM-dd%22%2C%22endDate%22%3A%22yyyy-MM-dd%22%2C%22breakfast_count%22%3A0%7D%2C%7B%22date%22%3A%22yyyy-MM-dd%22%2C%22startDate%22%3A%22yyyy-MM-dd%22%2C%22endDate%22%3A%22yyyy-MM-dd%22%2C%22breakfast_count%22%3A1%7D' \
-d 'breakfast_count=1' \
-d 'can_checkin_end=08%3A00' \
-d 'can_checkin_start=16%3A00' \
-d 'can_checkout_end=16%3A00' \
-d 'cancel_before_day=2' \
-d 'cancel_before_hour=6' \
-d 'cancel_policy=%7B%5C%22cancelPolicyType%5C%22%3A1%7D%7C%7B%5C%22cancelPolicyType%5C%22%3A2%7D%7C%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%7C%7B%5C%22cancelPolicyType%5C%22%3A5%2C%5C%22policyInfo%5C%22%3A%7B%5C%22timeBefore%5C%22%3A6%7D%7D%7C%7B%5C%22cancelPolicyType%5C%22%3A6%2C%5C%22policyInfo%5C%22%3A%7B%5C%2214%5C%22%3A1%7D%7D' \
-d 'cancel_policy_cal=%7B%22date%22%3A%22yyyy-MM-dd%22%2C%22startDate%22%3A%22yyyy-MM-dd%22%2C%22endDate%22%3A%22yyyy-MM-dd%22%2C%22cancel_policy%22%3A%7B%22cancelPolicyType%22%3A1%7D+%7D%2C%7B%22date%22%3A%22yyyy-MM-dd%22%2C%22startDate%22%3A%22yyyy-MM-dd%22%2C%22endDate%22%3A%22yyyy-MM-dd%22%2C%22cancel_policy%22%3A%7B%22cancelPolicyType%22%3A4%2C%22policyInfo%22%3A%7B%2248%22%3A10%2C%2224%22%3A20%7D%7D%7D' \
-d 'channel=A' \
-d 'children_price_policy=%7B%5C%22childrenPricePolicyList%5C%22%3A%5B%7B%5C%22max%5C%22%3A1%2C%5C%22min%5C%22%3A0%2C%5C%22t%5C%22%3A%5C%221%5C%22%2C%5C%22v%5C%22%3A%5C%2230.23%5C%22%7D%2C%7B%5C%22max%5C%22%3A17%2C%5C%22min%5C%22%3A2%2C%5C%22t%5C%22%3A%5C%222%5C%22%2C%5C%22v%5C%22%3A%5C%2220000%5C%22%7D%5D%7D' \
-d 'common_allot_release_time=6' \
-d 'deadline_time=2000-01-01+00%3A00%3A00' \
-d 'dinning_desc=%E8%A5%BF%E9%A4%90' \
-d 'effective_time=2000-01-01+00%3A00%3A00' \
-d 'end_time=00%3A00' \
-d 'english_name=aaa' \
-d 'extend=1' \
-d 'extend_fee=aaa' \
-d 'fee_breakfast_amount=1' \
-d 'fee_breakfast_count=1' \
-d 'fee_gov_tax_amount=1' \
-d 'fee_gov_tax_percent=1' \
-d 'fee_service_amount=150' \
-d 'fee_service_percent=15' \
-d 'first_stay=1' \
-d 'free_room_charge_dst_role=seller' \
-d 'guarantee_cal=%7B%22date%22%3A%22yyyy-MM-dd%22%2C%22startDate%22%3A%22yyyy-MM-dd%22%2C%22endDate%22%3A%22yyyy-MM-dd%22%2C%22guarantee%22%3A%7B%22guaranteeType%22%3A2%2C%22guaranteeStartTime%22%3A%22HH%3Amm%22%7D%7D%2C%7B%22date%22%3A%22yyyy-MM-dd%22%2C%22startDate%22%3A%22yyyy-MM-dd%22%2C%22endDate%22%3A%22yyyy-MM-dd%22%2C%22guarantee%22%3A%7B%22guaranteeType%22%3A3%2C%22guaranteeStartTime%22%3A%22HH%3Amm%22%7D%7D' \
-d 'guarantee_mode=1' \
-d 'guarantee_start_time=18%3A00' \
-d 'guarantee_type=1' \
-d 'guest_limit=%7B%5C%22guestArea%5C%22%3A1%2C%5C%22guestSex%5C%22%3A%5C%22MAN%5C%22%2C%5C%22minGuestAge%5C%22%3A0%2C%5C%22maxGuestAge%5C%22%3A99%7D' \
-d 'hid=1' \
-d 'hourage=4' \
-d 'is_student=0' \
-d 'max_adv_hours=3' \
-d 'max_child_age=5' \
-d 'max_days=90' \
-d 'max_infant_age=5' \
-d 'mem_disc_flag=1' \
-d 'member_discount_cal=%7B%22c%22%3A%228%22%2C%22t%22%3A1%2C%22s%22%3A+%2220191211%22%2C%22e%22%3A%2220191225%22%7D' \
-d 'member_level=1%2C2%2C3%2C4%2C5%2C6' \
-d 'min_adv_hours=1' \
-d 'min_amount=1' \
-d 'min_child_age=5' \
-d 'min_days=1' \
-d 'min_infant_age=5' \
-d 'name=%E5%90%AB%E6%97%A9%E6%8F%90%E5%89%8D3%E5%A4%A9' \
-d 'occupancy=2' \
-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=0' \
-d 'out_hid=1' \
-d 'out_rid=1' \
-d 'parent_rp_code=0' \
-d 'parent_rpid=0' \
-d 'payment_type=1' \
-d 'rateplan_code=12345AAA' \
-d 'resource_type=1' \
-d 'rid=1' \
-d 'rights=%7B%22type%22%3A+%22eeo%22%2C+%22value%22%3A+%221%2C2%2C3%2C4%22%7D' \
-d 'rp_type=1' \
-d 'source=1' \
-d 'start_time=00%3A00' \
-d 'status=1' \
-d 'super_rp_flag=1' \
-d 'tag_json=%7B%5C%22non-direct-RP%5C%22%3A1%2C%5C%22super-could-price-change-RP%5C%22%3A0%2C%5C%22base-could-derived-RP%5C%22%3A1%2C%5C%22ebk-tail-room-RP%5C%22%3A0%7D' \
-d 'vendor=taobao'
# -*- coding: utf-8 -*-
import top.api
req=top.api.XhotelRateplanAddRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.rateplan_code="12345AAA"
req.name="含早提前3天"
req.english_name="aaa"
req.payment_type=1
req.breakfast_count=1
req.fee_breakfast_count=1
req.fee_breakfast_amount=1
req.fee_gov_tax_amount=1
req.fee_gov_tax_percent=1
req.fee_service_amount=150
req.fee_service_percent=15
req.extend_fee="aaa"
req.min_days=1
req.max_days=90
req.min_amount=1
req.min_adv_hours=1
req.max_adv_hours=3
req.start_time="00:00"
req.end_time="00:00"
req.cancel_policy="{\"cancelPolicyType\":1}|{\"cancelPolicyType\":2}|{\"cancelPolicyType\":4,\"policyInfo\":{\"48\":10,\"24\":20}}|{\"cancelPolicyType\":5,\"policyInfo\":{\"timeBefore\":6}}|{\"cancelPolicyType\":6,\"policyInfo\":{\"14\":1}}"
req.extend="1"
req.status=1
req.guarantee_type=1
req.guarantee_start_time="18:00"
req.member_level="1,2,3,4,5,6"
req.channel="A"
req.occupancy=2
req.vendor="taobao"
req.first_stay=1
req.agreement=2
req.cancel_before_day=2
req.cancel_before_hour="6"
req.breakfast_cal="[{\"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}]"
req.cancel_policy_cal="[{\"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.guarantee_cal="[{\"date\":\"yyyy-MM-dd\",\"startDate\":\"yyyy-MM-dd\",\"endDate\":\"yyyy-MM-dd\",\"guarantee\":{\"guaranteeType\":2,\"guaranteeStartTime\":\"HH:mm\"}},{\"date\":\"yyyy-MM-dd\",\"startDate\":\"yyyy-MM-dd\",\"endDate\":\"yyyy-MM-dd\",\"guarantee\":{\"guaranteeType\":3,\"guaranteeStartTime\":\"HH:mm\"}}]"
req.effective_time="2000-01-01 00:00:00"
req.deadline_time="2000-01-01 00:00:00"
req.rp_type="1"
req.hourage="4"
req.can_checkin_end="08:00"
req.can_checkin_start="16:00"
req.max_child_age=5
req.min_child_age=5
req.max_infant_age=5
req.min_infant_age=5
req.dinning_desc="西餐"
req.is_student=0
req.hid=1
req.rid=1
req.out_hid="1"
req.out_rid="1"
req.super_rp_flag=1
req.base_rp_flag=1
req.guarantee_mode=1
req.parent_rp_code="0"
req.parent_rpid=0
req.operator="0"
req.tag_json="{\"non-direct-RP\":1,\"super-could-price-change-RP\":0,\"base-could-derived-RP\":1,\"ebk-tail-room-RP\":0}"
req.source=1
req.allotment_release_time="6"
req.common_allot_release_time="6"
req.resource_type="1"
req.bottom_price_flag=0
req.can_checkout_end="16:00"
req.mem_disc_flag=1
req.member_discount_cal="[{\"c\":\"8\",\"t\":1,\"s\": \"20191211\",\"e\":\"20191225\"}]"
req.guest_limit="{\"guestArea\":1,\"guestSex\":\"MAN\",\"minGuestAge\":0,\"maxGuestAge\":99}"
req.activity_type="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.rights="[{\"type\": \"eeo\", \"value\": \"1,2,3,4\"}]"
req.free_room_charge_dst_role="seller"
req.children_price_policy="{\"childrenPricePolicyList\":[{\"max\":1,\"min\":0,\"t\":\"1\",\"v\":\"30.23\"},{\"max\":17,\"min\":2,\"t\":\"2\",\"v\":\"20000\"}]}"
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.rateplan.add");
add_param(pRequest,"rateplan_code","12345AAA");
add_param(pRequest,"name","含早提前3天");
add_param(pRequest,"english_name","aaa");
add_param(pRequest,"payment_type","1");
add_param(pRequest,"breakfast_count","1");
add_param(pRequest,"fee_breakfast_count","1");
add_param(pRequest,"fee_breakfast_amount","1");
add_param(pRequest,"fee_gov_tax_amount","1");
add_param(pRequest,"fee_gov_tax_percent","1");
add_param(pRequest,"fee_service_amount","150");
add_param(pRequest,"fee_service_percent","15");
add_param(pRequest,"extend_fee","aaa");
add_param(pRequest,"min_days","1");
add_param(pRequest,"max_days","90");
add_param(pRequest,"min_amount","1");
add_param(pRequest,"min_adv_hours","1");
add_param(pRequest,"max_adv_hours","3");
add_param(pRequest,"start_time","00:00");
add_param(pRequest,"end_time","00:00");
add_param(pRequest,"cancel_policy","{\"cancelPolicyType\":1}|{\"cancelPolicyType\":2}|{\"cancelPolicyType\":4,\"policyInfo\":{\"48\":10,\"24\":20}}|{\"cancelPolicyType\":5,\"policyInfo\":{\"timeBefore\":6}}|{\"cancelPolicyType\":6,\"policyInfo\":{\"14\":1}}");
add_param(pRequest,"extend","1");
add_param(pRequest,"status","1");
add_param(pRequest,"guarantee_type","1");
add_param(pRequest,"guarantee_start_time","18:00");
add_param(pRequest,"member_level","1,2,3,4,5,6");
add_param(pRequest,"channel","A");
add_param(pRequest,"occupancy","2");
add_param(pRequest,"vendor","taobao");
add_param(pRequest,"first_stay","1");
add_param(pRequest,"agreement","2");
add_param(pRequest,"cancel_before_day","2");
add_param(pRequest,"cancel_before_hour","6");
add_param(pRequest,"breakfast_cal","{"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}");
add_param(pRequest,"cancel_policy_cal","{"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,"guarantee_cal","{"date":"yyyy-MM-dd","startDate":"yyyy-MM-dd","endDate":"yyyy-MM-dd","guarantee":{"guaranteeType":2,"guaranteeStartTime":"HH:mm"}},{"date":"yyyy-MM-dd","startDate":"yyyy-MM-dd","endDate":"yyyy-MM-dd","guarantee":{"guaranteeType":3,"guaranteeStartTime":"HH:mm"}}");
add_param(pRequest,"effective_time","2000-01-01 00:00:00");
add_param(pRequest,"deadline_time","2000-01-01 00:00:00");
add_param(pRequest,"rp_type","1");
add_param(pRequest,"hourage","4");
add_param(pRequest,"can_checkin_end","08:00");
add_param(pRequest,"can_checkin_start","16:00");
add_param(pRequest,"max_child_age","5");
add_param(pRequest,"min_child_age","5");
add_param(pRequest,"max_infant_age","5");
add_param(pRequest,"min_infant_age","5");
add_param(pRequest,"dinning_desc","西餐");
add_param(pRequest,"is_student","0");
add_param(pRequest,"hid","1");
add_param(pRequest,"rid","1");
add_param(pRequest,"out_hid","1");
add_param(pRequest,"out_rid","1");
add_param(pRequest,"super_rp_flag","1");
add_param(pRequest,"base_rp_flag","1");
add_param(pRequest,"guarantee_mode","1");
add_param(pRequest,"parent_rp_code","0");
add_param(pRequest,"parent_rpid","0");
add_param(pRequest,"operator","0");
add_param(pRequest,"tag_json","{\"non-direct-RP\":1,\"super-could-price-change-RP\":0,\"base-could-derived-RP\":1,\"ebk-tail-room-RP\":0}");
add_param(pRequest,"source","1");
add_param(pRequest,"allotment_release_time","6");
add_param(pRequest,"common_allot_release_time","6");
add_param(pRequest,"resource_type","1");
add_param(pRequest,"bottom_price_flag","0");
add_param(pRequest,"can_checkout_end","16:00");
add_param(pRequest,"mem_disc_flag","1");
add_param(pRequest,"member_discount_cal","{"c":"8","t":1,"s": "20191211","e":"20191225"}");
add_param(pRequest,"guest_limit","{\"guestArea\":1,\"guestSex\":\"MAN\",\"minGuestAge\":0,\"maxGuestAge\":99}");
add_param(pRequest,"activity_type","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,"rights","{"type": "eeo", "value": "1,2,3,4"}");
add_param(pRequest,"free_room_charge_dst_role","seller");
add_param(pRequest,"children_price_policy","{\"childrenPricePolicyList\":[{\"max\":1,\"min\":0,\"t\":\"1\",\"v\":\"30.23\"},{\"max\":17,\"min\":2,\"t\":\"2\",\"v\":\"20000\"}]}");
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.rateplan.add', {
'rateplan_code':'12345AAA',
'name':'含早提前3天',
'english_name':'aaa',
'payment_type':'1',
'breakfast_count':'1',
'fee_breakfast_count':'1',
'fee_breakfast_amount':'1',
'fee_gov_tax_amount':'1',
'fee_gov_tax_percent':'1',
'fee_service_amount':'150',
'fee_service_percent':'15',
'extend_fee':'aaa',
'min_days':'1',
'max_days':'90',
'min_amount':'1',
'min_adv_hours':'1',
'max_adv_hours':'3',
'start_time':'00:00',
'end_time':'00:00',
'cancel_policy':'{\"cancelPolicyType\":1}|{\"cancelPolicyType\":2}|{\"cancelPolicyType\":4,\"policyInfo\":{\"48\":10,\"24\":20}}|{\"cancelPolicyType\":5,\"policyInfo\":{\"timeBefore\":6}}|{\"cancelPolicyType\":6,\"policyInfo\":{\"14\":1}}',
'extend':'1',
'status':'1',
'guarantee_type':'1',
'guarantee_start_time':'18:00',
'member_level':'1,2,3,4,5,6',
'channel':'A',
'occupancy':'2',
'vendor':'taobao',
'first_stay':'1',
'agreement':'2',
'cancel_before_day':'2',
'cancel_before_hour':'6',
'breakfast_cal':'{"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}',
'cancel_policy_cal':'{"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}}}',
'guarantee_cal':'{"date":"yyyy-MM-dd","startDate":"yyyy-MM-dd","endDate":"yyyy-MM-dd","guarantee":{"guaranteeType":2,"guaranteeStartTime":"HH:mm"}},{"date":"yyyy-MM-dd","startDate":"yyyy-MM-dd","endDate":"yyyy-MM-dd","guarantee":{"guaranteeType":3,"guaranteeStartTime":"HH:mm"}}',
'effective_time':'2000-01-01 00:00:00',
'deadline_time':'2000-01-01 00:00:00',
'rp_type':'1',
'hourage':'4',
'can_checkin_end':'08:00',
'can_checkin_start':'16:00',
'max_child_age':'5',
'min_child_age':'5',
'max_infant_age':'5',
'min_infant_age':'5',
'dinning_desc':'西餐',
'is_student':'0',
'hid':'1',
'rid':'1',
'out_hid':'1',
'out_rid':'1',
'super_rp_flag':'1',
'base_rp_flag':'1',
'guarantee_mode':'1',
'parent_rp_code':'0',
'parent_rpid':'0',
'operator':'0',
'tag_json':'{\"non-direct-RP\":1,\"super-could-price-change-RP\":0,\"base-could-derived-RP\":1,\"ebk-tail-room-RP\":0}',
'source':'1',
'allotment_release_time':'6',
'common_allot_release_time':'6',
'resource_type':'1',
'bottom_price_flag':'0',
'can_checkout_end':'16:00',
'mem_disc_flag':'1',
'member_discount_cal':'{"c":"8","t":1,"s": "20191211","e":"20191225"}',
'guest_limit':'{\"guestArea\":1,\"guestSex\":\"MAN\",\"minGuestAge\":0,\"maxGuestAge\":99}',
'activity_type':'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"}]}',
'rights':'{"type": "eeo", "value": "1,2,3,4"}',
'free_room_charge_dst_role':'seller',
'children_price_policy':'{\"childrenPricePolicyList\":[{\"max\":1,\"min\":0,\"t\":\"1\",\"v\":\"30.23\"},{\"max\":17,\"min\":2,\"t\":\"2\",\"v\":\"20000\"}]}'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})