TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
XhotelRateplanUpdateRequest req = new XhotelRateplanUpdateRequest();
req.setRpid(100000L);
req.setName("含早提前3天");
req.setEnglishName("aaa");
req.setBreakfastCount(1L);
req.setFeeBreakfastCount(2L);
req.setFeeBreakfastAmount(1L);
req.setFeeGovTaxAmount(1L);
req.setFeeGovTaxPercent(1L);
req.setFeeServiceAmount(150L);
req.setFeeServicePercent(15L);
req.setExtendFee("aaa");
req.setMinDays(1L);
req.setMaxDays(180L);
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");
req.setChannel("A");
req.setOccupancy(3L);
req.setVendor("taobao");
req.setRateplanCode("12345AAA");
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.setPaymentType(1L);
req.setRpType("1");
req.setHourage("4");
req.setCanCheckinEnd("16:00");
req.setCanCheckinStart("08:00");
req.setMaxChildAge(5L);
req.setMinChildAge(5L);
req.setMaxInfantAge(5L);
req.setMinInfantAge(5L);
req.setDinningDesc("西餐");
req.setIsStudent(1L);
req.setHid(1L);
req.setRid(1L);
req.setOutRid("1");
req.setOutHid("1");
req.setSuperRpFlag(1L);
req.setBaseRpFlag(1L);
req.setGuaranteeMode(1L);
req.setOperator("0");
req.setParentRpCode("0");
req.setParentRpid(0L);
req.setTagJson("{\"non-direct-RP\":1,\"super-could-price-change-RP\":0,\"base-could-derived-RP\":1,\"ebk-tail-room-RP\":0,\"free-room\":1}");
req.setAllotmentReleaseTime("0");
req.setPackRoomFlag("0");
req.setBottomPriceFlag("0");
req.setDisplayName("0");
req.setSource(0L);
req.setCommonAllotReleaseTime("0");
req.setCompanyAssist(1L);
req.setHotelCompanyMappingDOS("[]");
req.setResourceType("1");
req.setCanCheckoutEnd("16:00");
req.setMemDiscFlag(1L);
req.setMemberDiscountCal("[{c:\"8\",t:1,s: \"20191211\",e:\"20191225\"}]");
req.setBenefits("benefits");
req.setActivityType("1");
req.setGuestLimit("入住人限制");
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\": \"eot\", “value“: \"1,2,3,4,5,6\"}]");
req.setFreeRoomChargeDstRole("hotel");
req.setChildrenPricePolicy("{\"childrenPricePolicyList\":[{\"max\":1,\"min\":0,\"t\":\"1\",\"v\":\"30.23\"},{\"max\":17,\"min\":2,\"t\":\"2\",\"v\":\"20000\"}]}");
XhotelRateplanUpdateResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
XhotelRateplanUpdateRequest req = new XhotelRateplanUpdateRequest();
req.Rpid = 100000L;
req.Name = "含早提前3天";
req.EnglishName = "aaa";
req.BreakfastCount = 1L;
req.FeeBreakfastCount = 2L;
req.FeeBreakfastAmount = 1L;
req.FeeGovTaxAmount = 1L;
req.FeeGovTaxPercent = 1L;
req.FeeServiceAmount = 150L;
req.FeeServicePercent = 15L;
req.ExtendFee = "aaa";
req.MinDays = 1L;
req.MaxDays = 180L;
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";
req.Channel = "A";
req.Occupancy = 3L;
req.Vendor = "taobao";
req.RateplanCode = "12345AAA";
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.PaymentType = 1L;
req.RpType = "1";
req.Hourage = "4";
req.CanCheckinEnd = "16:00";
req.CanCheckinStart = "08:00";
req.MaxChildAge = 5L;
req.MinChildAge = 5L;
req.MaxInfantAge = 5L;
req.MinInfantAge = 5L;
req.DinningDesc = "西餐";
req.IsStudent = 1L;
req.Hid = 1L;
req.Rid = 1L;
req.OutRid = "1";
req.OutHid = "1";
req.SuperRpFlag = 1L;
req.BaseRpFlag = 1L;
req.GuaranteeMode = 1L;
req.Operator = "0";
req.ParentRpCode = "0";
req.ParentRpid = 0L;
req.TagJson = "{\"non-direct-RP\":1,\"super-could-price-change-RP\":0,\"base-could-derived-RP\":1,\"ebk-tail-room-RP\":0,\"free-room\":1}";
req.AllotmentReleaseTime = "0";
req.PackRoomFlag = "0";
req.BottomPriceFlag = "0";
req.DisplayName = "0";
req.Source = 0L;
req.CommonAllotReleaseTime = "0";
req.CompanyAssist = 1L;
req.HotelCompanyMappingDOS = "[]";
req.ResourceType = "1";
req.CanCheckoutEnd = "16:00";
req.MemDiscFlag = 1L;
req.MemberDiscountCal = "[{c:\"8\",t:1,s: \"20191211\",e:\"20191225\"}]";
req.Benefits = "benefits";
req.ActivityType = "1";
req.GuestLimit = "入住人限制";
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\": \"eot\", “value“: \"1,2,3,4,5,6\"}]";
req.FreeRoomChargeDstRole = "hotel";
req.ChildrenPricePolicy = "{\"childrenPricePolicyList\":[{\"max\":1,\"min\":0,\"t\":\"1\",\"v\":\"30.23\"},{\"max\":17,\"min\":2,\"t\":\"2\",\"v\":\"20000\"}]}";
XhotelRateplanUpdateResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new XhotelRateplanUpdateRequest;
$req->setRpid("100000");
$req->setName("含早提前3天");
$req->setEnglishName("aaa");
$req->setBreakfastCount("1");
$req->setFeeBreakfastCount("2");
$req->setFeeBreakfastAmount("1");
$req->setFeeGovTaxAmount("1");
$req->setFeeGovTaxPercent("1");
$req->setFeeServiceAmount("150");
$req->setFeeServicePercent("15");
$req->setExtendFee("aaa");
$req->setMinDays("1");
$req->setMaxDays("180");
$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");
$req->setChannel("A");
$req->setOccupancy("3");
$req->setVendor("taobao");
$req->setRateplanCode("12345AAA");
$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->setPaymentType("1");
$req->setRpType("1");
$req->setHourage("4");
$req->setCanCheckinEnd("16:00");
$req->setCanCheckinStart("08:00");
$req->setMaxChildAge("5");
$req->setMinChildAge("5");
$req->setMaxInfantAge("5");
$req->setMinInfantAge("5");
$req->setDinningDesc("西餐");
$req->setIsStudent("1");
$req->setHid("1");
$req->setRid("1");
$req->setOutRid("1");
$req->setOutHid("1");
$req->setSuperRpFlag("1");
$req->setBaseRpFlag("1");
$req->setGuaranteeMode("1");
$req->setOperator("0");
$req->setParentRpCode("0");
$req->setParentRpid("0");
$req->setTagJson("{\"non-direct-RP\":1,\"super-could-price-change-RP\":0,\"base-could-derived-RP\":1,\"ebk-tail-room-RP\":0,\"free-room\":1}");
$req->setAllotmentReleaseTime("0");
$req->setPackRoomFlag("0");
$req->setBottomPriceFlag("0");
$req->setDisplayName("0");
$req->setSource("0");
$req->setCommonAllotReleaseTime("0");
$req->setCompanyAssist("1");
$req->setHotelCompanyMappingDOS("[]");
$req->setResourceType("1");
$req->setCanCheckoutEnd("16:00");
$req->setMemDiscFlag("1");
$req->setMemberDiscountCal("[{c:\"8\",t:1,s: \"20191211\",e:\"20191225\"}]");
$req->setBenefits("benefits");
$req->setActivityType("1");
$req->setGuestLimit("入住人限制");
$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\": \"eot\", “value“: \"1,2,3,4,5,6\"}]");
$req->setFreeRoomChargeDstRole("hotel");
$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.update' \
-d 'partner_id=apidoc' \
-d 'session=fa1189c6-1eda-43ea-93b2-79aeab93e6db' \
-d 'sign=8BB92505EF6018D19520096BF3047C93' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-23+17%3A30%3A11' \
-d 'v=2.0' \
-d 'activity_type=1' \
-d 'agreement=2' \
-d 'allotment_release_time=0' \
-d 'base_rp_flag=1' \
-d 'benefits=benefits' \
-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=16%3A00' \
-d 'can_checkin_start=08%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=0' \
-d 'company_assist=1' \
-d 'deadline_time=2000-01-01+00%3A00%3A00' \
-d 'dinning_desc=%E8%A5%BF%E9%A4%90' \
-d 'display_name=0' \
-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=2' \
-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=hotel' \
-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=%E5%85%A5%E4%BD%8F%E4%BA%BA%E9%99%90%E5%88%B6' \
-d 'hid=1' \
-d 'hotel_company_mapping_d_o_s=null' \
-d 'hourage=4' \
-d 'is_student=1' \
-d 'max_adv_hours=3' \
-d 'max_child_age=5' \
-d 'max_days=180' \
-d 'max_infant_age=5' \
-d 'mem_disc_flag=1' \
-d 'member_discount_cal=%7Bc%3A%228%22%2Ct%3A1%2Cs%3A+%2220191211%22%2Ce%3A%2220191225%22%7D' \
-d 'member_level=1' \
-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=3' \
-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 'pack_room_flag=0' \
-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+%22eot%22%2C+%E2%80%9Cvalue%E2%80%9C%3A+%221%2C2%2C3%2C4%2C5%2C6%22%7D' \
-d 'rp_type=1' \
-d 'rpid=100000' \
-d 'source=0' \
-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%2C%5C%22free-room%5C%22%3A1%7D' \
-d 'vendor=taobao'
# -*- coding: utf-8 -*-
import top.api
req=top.api.XhotelRateplanUpdateRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.rpid=100000
req.name="含早提前3天"
req.english_name="aaa"
req.breakfast_count=1
req.fee_breakfast_count=2
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=180
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"
req.channel="A"
req.occupancy=3
req.vendor="taobao"
req.rateplan_code="12345AAA"
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.payment_type=1
req.rp_type="1"
req.hourage="4"
req.can_checkin_end="16:00"
req.can_checkin_start="08: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=1
req.hid=1
req.rid=1
req.out_rid="1"
req.out_hid="1"
req.super_rp_flag=1
req.base_rp_flag=1
req.guarantee_mode=1
req.operator="0"
req.parent_rp_code="0"
req.parent_rpid=0
req.tag_json="{\"non-direct-RP\":1,\"super-could-price-change-RP\":0,\"base-could-derived-RP\":1,\"ebk-tail-room-RP\":0,\"free-room\":1}"
req.allotment_release_time="0"
req.pack_room_flag="0"
req.bottom_price_flag="0"
req.display_name="0"
req.source=0
req.common_allot_release_time="0"
req.company_assist=1
req.hotel_company_mapping_d_o_s="[]"
req.resource_type="1"
req.can_checkout_end="16:00"
req.mem_disc_flag=1
req.member_discount_cal="[{c:\"8\",t:1,s: \"20191211\",e:\"20191225\"}]"
req.benefits="benefits"
req.activity_type="1"
req.guest_limit="入住人限制"
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\": \"eot\", “value“: \"1,2,3,4,5,6\"}]"
req.free_room_charge_dst_role="hotel"
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.update");
add_param(pRequest,"rpid","100000");
add_param(pRequest,"name","含早提前3天");
add_param(pRequest,"english_name","aaa");
add_param(pRequest,"breakfast_count","1");
add_param(pRequest,"fee_breakfast_count","2");
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","180");
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");
add_param(pRequest,"channel","A");
add_param(pRequest,"occupancy","3");
add_param(pRequest,"vendor","taobao");
add_param(pRequest,"rateplan_code","12345AAA");
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,"payment_type","1");
add_param(pRequest,"rp_type","1");
add_param(pRequest,"hourage","4");
add_param(pRequest,"can_checkin_end","16:00");
add_param(pRequest,"can_checkin_start","08: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","1");
add_param(pRequest,"hid","1");
add_param(pRequest,"rid","1");
add_param(pRequest,"out_rid","1");
add_param(pRequest,"out_hid","1");
add_param(pRequest,"super_rp_flag","1");
add_param(pRequest,"base_rp_flag","1");
add_param(pRequest,"guarantee_mode","1");
add_param(pRequest,"operator","0");
add_param(pRequest,"parent_rp_code","0");
add_param(pRequest,"parent_rpid","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,\"free-room\":1}");
add_param(pRequest,"allotment_release_time","0");
add_param(pRequest,"pack_room_flag","0");
add_param(pRequest,"bottom_price_flag","0");
add_param(pRequest,"display_name","0");
add_param(pRequest,"source","0");
add_param(pRequest,"common_allot_release_time","0");
add_param(pRequest,"company_assist","1");
add_param(pRequest,"hotel_company_mapping_d_o_s","");
add_param(pRequest,"resource_type","1");
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,"benefits","benefits");
add_param(pRequest,"activity_type","1");
add_param(pRequest,"guest_limit","入住人限制");
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": "eot", “value“: "1,2,3,4,5,6"}");
add_param(pRequest,"free_room_charge_dst_role","hotel");
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.update', {
'rpid':'100000',
'name':'含早提前3天',
'english_name':'aaa',
'breakfast_count':'1',
'fee_breakfast_count':'2',
'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':'180',
'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',
'channel':'A',
'occupancy':'3',
'vendor':'taobao',
'rateplan_code':'12345AAA',
'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',
'payment_type':'1',
'rp_type':'1',
'hourage':'4',
'can_checkin_end':'16:00',
'can_checkin_start':'08:00',
'max_child_age':'5',
'min_child_age':'5',
'max_infant_age':'5',
'min_infant_age':'5',
'dinning_desc':'西餐',
'is_student':'1',
'hid':'1',
'rid':'1',
'out_rid':'1',
'out_hid':'1',
'super_rp_flag':'1',
'base_rp_flag':'1',
'guarantee_mode':'1',
'operator':'0',
'parent_rp_code':'0',
'parent_rpid':'0',
'tag_json':'{\"non-direct-RP\":1,\"super-could-price-change-RP\":0,\"base-could-derived-RP\":1,\"ebk-tail-room-RP\":0,\"free-room\":1}',
'allotment_release_time':'0',
'pack_room_flag':'0',
'bottom_price_flag':'0',
'display_name':'0',
'source':'0',
'common_allot_release_time':'0',
'company_assist':'1',
'hotel_company_mapping_d_o_s':'',
'resource_type':'1',
'can_checkout_end':'16:00',
'mem_disc_flag':'1',
'member_discount_cal':'{c:"8",t:1,s: "20191211",e:"20191225"}',
'benefits':'benefits',
'activity_type':'1',
'guest_limit':'入住人限制',
'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": "eot", “value“: "1,2,3,4,5,6"}',
'free_room_charge_dst_role':'hotel',
'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);
})