酒店产品库rate添加
名称 | 类型 | 是否必须 | 示例值 | 更多限制 | 描述 |
---|---|---|---|---|---|
gid | Number | 可选 | 100000 | gid酒店商品id | |
rpid | Number | 可选 | 100000 | 酒店RPID | |
vendor | String | 可选 | ChinaOnline |
|
用于标示该宝贝的售卖渠道信息,允许同一个卖家酒店房型在淘宝系统发布多个售卖渠道的宝贝的价格。 |
rateplan_code | String | 可选 | 12345AAA |
|
卖家自己系统的Code,简称RateCode |
out_rid | String | 可选 | abc123 |
|
卖家房型ID, 这是卖家自己系统中的房型ID,注意:需按照规则组合 |
rate_switch_cal | String | 可选 | [{"date":"yyyy-MM-dd","rate_status":1},{"date":"yyyy-MM-dd","rate_status":0}] | 在添加新rate时,同时添加rate开关日历。可以只设定想设定的某些天,可以不连续。date:开关状态控制的是那一天rate_status:开关状态。0,关闭;1,打开 | |
name | String | 可选 | aaa |
|
名称 |
inventory_price | String | 必须 | {"use_room_inventory":false,"inventory_price":[{"date":"2017-10-10","quota":10,"price":100,"alQuota":10,"genAlQuota":10,"tax":10,"taxes":[{"taxId":0,"type":"Excluded","valueType":"percentage","amount":20},{"taxId":3,"type":"Mandatory","valueType":"percentage","amount":10}]},{"date":"2017-10-11","quota":10,"price":200,"tax":10,"taxes":[{"taxId":0,"type":"Excluded","valueType":"percentage","amount":20},{"taxId":3,"type":"Mandatory","valueType":"percentage","amount":10}]},{"date":"2017-10-13","quota":10,"price":300,"alQuota":10,"genAlQuota":10,"tax":10,"taxes":[{"taxId":0,"type":"Excluded","valueType":"percentage","amount":20},{"taxId":3,"type":"Mandatory","valueType":"percentage","amount":10}]}]} | 价格和库存信息。A:use_room_inventory:是否使用room级别共享库存,可选值 true false 1、true时:使用room级别共享库存(即使用gid对应的XRoom中的inventory),rate_quota_map 的json 数据中不需要录入库存信息,录入的库存信息会忽略 2、false时:使用rate级别私有库存,此时要求价格和库存必填。B:date 日期必须为 T---T+90 日内的日期(T为当天),且不能重复C:price 价格 int类型 取值范围1-99999999 单位为分D:quota 库存 int 类型 取值范围 0-999(数量库存) 60000(状态库存关) 61000(状态库存开) E:taxes:税费明细,是一个数组,每个数组元素是一个包含税费信息的对象。包括:taxId:税费 ID,类型:int,必填:是,具体枚举:taxId=0=其他税(OTHER),taxId=3=住宿税(RENTAL_TAX);type:税费类型,类型:string、必填:是,可选值:Mandatory:预付税费(包含在总价中),Excluded:到店税费(不包含在总价中);valueType:费率类型,类型:string,必填:否,可选值:percentage:百分比、fixed:固定金额;amount:具体金额,类型:string,必填:否,单位:分/百分比。 注意:每个taxes数组里的含税金额相加要与tax的值一致,否则将会报错,当tax字段为空时则不会校验;当某税费不知道金额时则可不传tax字段,仅taxes字段里传对应信息即可;未知税费,请在taxId里选择其他税类,住宿税只能传1个,当传多个时飞猪则以第一个为主,若因传多个导致的问题,需由商家自行负责。 | |
add_bed | Number | 可选 | 1 | 额外服务-是否可以加床,1:不可以,2:可以 | |
add_bed_price | Number | 可选 | 1 | 额外服务-加床价格 | |
currency_code | Number | 可选 | 1 | 币种(仅支持CNY) | |
shijia_tag | Number | 可选 | 1 | 实价有房标签(RP支付类型为全额支付) | |
jishiqueren_tag | Number | 可选 | 1 | “即时确认”标识,此类商品预订后直接发货。 | |
lock_end_time | String | 可选 | 2016-07-15 00:00:00 | 锁库存截止时间,如果当前时间是在锁库存开始时间和截止时间之间,那么不允许修改该活动库存(包含开始时间和截止时间) | |
lock_start_time | String | 可选 | 2016-07-15 00:00:00 | 锁库存开始时间,如果当前时间是在锁库存开始时间和截止时间之间,那么不允许修改该活动库存(包含开始时间和截止时间) | |
currency_code_name | String | 可选 | CNY | 币种信息,默认是CNY, @see com.taobao.trip.hotel.model.enums.CurrencyEnum | |
operator | String | 可选 | XXX小二 | 操作人信息 | |
source | Number | 可选 | 2 | 默认是2 , | |
status | Number | 可选 | 1 | 1是开,0是关, 不填默认是开, rate状态 | |
online_booking_binding_info | String | 可选 | [{"itemId":1234235235,"skuId":1234235235,"priceRuleInfoList":[{"priceRuleNumber":"14235253"},{"priceRuleNumber":"14235253"},{"priceRuleNumber":"14235253"}]},{"itemId":1234235235,"skuId":1234235235,"priceRuleInfoList":[{"priceRuleNumber":"14235253"},{"priceRuleNumber":"14235253"},{"priceRuleNumber":"14235253"}]}] | 在线预约关联关系推送,priceRuleNumber:加价规则序号 | |
hotel_xitem_infos | String | 可选 | [{"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":""}] | 是一个JSONArray 字符串 actionType 操作类型 BOUND: 绑定,UNBOUND:解绑; outXcode 元素编码 ; subTypeCode x 元素子类型, 参考:https://open.alitrip.com/docs/doc.htm?spm=0.0.0.0.9MjTPx&docType=1&articleId=121402&previewCode=787DFB0895F05C90D167579A04BD32E3; status: 状态是否生效0 失效, 1生效; shortName x元素标题; time 服务时间段(18:00-21:00); value 商品价值(100 - 999900 单位分); itemDesc 商品使用说明; dimensionType 附加产品使用维度 1:每间房维度 2:每间夜维度; picList 图片格式化信息 [{"url":"https://xxxxx/","isMain":true}]; adultCount 成人数量 (1-99); childCount 儿童数量 (0-99); itemLimit 使用限制, 文字描述,200 字内; checkInStart 入住生效开始时间; checkInEnd 入住生效结束时间; bookStartTime 预定生效开始时间; bookStartEnd 预定生效截止时间; featureDetail 详细信息json字符串 [{"detailName":"免费寄存","detailValue":[""],"type":"single","priority":1}] | |
breakfast | Number | 可选 | 1 | rate早餐 | |
breakfast_cal | String | 可选 | [{"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}] | 在更新rateplan时,同时新增或更新早餐日历。 date:早餐政策属于具体哪一天 breakfast_count:这一天早餐的数量。>=0,<=99 如果date为空,那么会去读取startDate和endDate(格式都为"yyyy-MM-dd"),即早餐正常属于一个时间段。-1为状态早餐,和最终绑定的几人价有关,如果是一人价那么就是我一份早餐,二人价就是两份早餐。请注意,该字段仅能维护从当前时间开始,10年以内的数据,如果超过10年,会报错。 |
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
gid_and_rpid | String | aaaaa | 酒店商品id-酒店rpID |
results | String [] | 112-34,rateId#14555 | results |
warn_message | String | warnMessage | warnMessage |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret); XhotelRateAddRequest req = new XhotelRateAddRequest(); req.setGid(100000L); req.setRpid(100000L); req.setVendor( "ChinaOnline" ); req.setRateplanCode( "12345AAA" ); req.setOutRid( "abc123" ); req.setRateSwitchCal( "[{\"date\":\"yyyy-MM-dd\",\"rate_status\":1},{\"date\":\"yyyy-MM-dd\",\"rate_status\":0}]" ); req.setName( "aaa" ); req.setInventoryPrice( "{\"use_room_inventory\":false,\"inventory_price\":[{\"date\":\"2017-10-10\",\"quota\":10,\"price\":100,\"alQuota\":10,\"genAlQuota\":10,\"tax\":10,\"taxes\":[{\"taxId\":0,\"type\":\"Excluded\",\"valueType\":\"percentage\",\"amount\":20},{\"taxId\":3,\"type\":\"Mandatory\",\"valueType\":\"percentage\",\"amount\":10}]},{\"date\":\"2017-10-11\",\"quota\":10,\"price\":200,\"tax\":10,\"taxes\":[{\"taxId\":0,\"type\":\"Excluded\",\"valueType\":\"percentage\",\"amount\":20},{\"taxId\":3,\"type\":\"Mandatory\",\"valueType\":\"percentage\",\"amount\":10}]},{\"date\":\"2017-10-13\",\"quota\":10,\"price\":300,\"alQuota\":10,\"genAlQuota\":10,\"tax\":10,\"taxes\":[{\"taxId\":0,\"type\":\"Excluded\",\"valueType\":\"percentage\",\"amount\":20},{\"taxId\":3,\"type\":\"Mandatory\",\"valueType\":\"percentage\",\"amount\":10}]}]}" ); req.setAddBed(1L); req.setAddBedPrice(1L); req.setCurrencyCode(1L); req.setShijiaTag(1L); req.setJishiquerenTag(1L); req.setLockEndTime( "2016-07-15 00:00:00" ); req.setLockStartTime( "2016-07-15 00:00:00" ); req.setCurrencyCodeName( "CNY" ); req.setOperator( "XXX小二" ); req.setSource(2L); req.setStatus(1L); req.setOnlineBookingBindingInfo( "[{\"itemId\":1234235235,\"skuId\":1234235235,\"priceRuleInfoList\":[{\"priceRuleNumber\":\"14235253\"},{\"priceRuleNumber\":\"14235253\"},{\"priceRuleNumber\":\"14235253\"}]},{\"itemId\":1234235235,\"skuId\":1234235235,\"priceRuleInfoList\":[{\"priceRuleNumber\":\"14235253\"},{\"priceRuleNumber\":\"14235253\"},{\"priceRuleNumber\":\"14235253\"}]}]" ); req.setHotelXitemInfos( "[{\"actionType\":\"BOUND\",\"outXcode\":\"123456\",\"subTypeCode\":\"40000_105\",\"shortName\":\"延时14点退房\",\"time\":\"00:00-23:59\",\"value\":1200,\"itemDesc\":\"可延时到14点退房\",\"dimensionType\":1,\"picList\":[],\"adultCount\":1,\"childCount\":1,\"itemLimit\":\"\",\"checkInStart\":\"2023-07-13 00:00:01\",\"checkInEnd\":\"2023-07-13 00:00:01\",\"bookStartTime\":\"2023-07-13 00:00:01\",\"bookStartEnd\":\"2023-07-13 00:00:01\",\"featureDetail\":\"\"}]" ); req.setBreakfast(1L); 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}]" ); XhotelRateAddResponse rsp = client.execute(req, sessionKey); System.out.println(rsp.getBody()); |
1 2 3 4 5 6 7 8 | < xhotel_rate_add_response > < gid_and_rpid >aaaaa</ gid_and_rpid > < results > < string >112-34</ string > < string >rateId#14555</ string > </ results > < warn_message >warnMessage</ warn_message > </ xhotel_rate_add_response > |
1 2 3 4 5 6 | < error_response > < code >50</ code > < msg >Remote service error</ msg > < sub_code >isv.invalid-parameter</ sub_code > < sub_msg >非法参数</ sub_msg > </ error_response > |
错误码 | 错误描述 | 解决方案 |
---|---|---|
isv.invalid-parameter:FORMAT_ERROR | 参数格式不正确 | 请检查输入参数 |
isv.invalid-parameter:ERROR | 参数不正确 | 请检查输入参数 |
isv.permission-error:NO_PERMISSIONS_ERROR | 权限不够、非法访问 | 请申请权限或者使用正确的账号操作 |
isv.invalid-parameter: RATE_REPEAT_ERROR | 定价信息已经存在 | 请不要重复添加定价信息 |
isv.biz-error: RATEPLAN_NOT_EXIST_ERROR | 定价信息关联的价格计划不存在 | 请检查输入参数 |
isv.biz-error:BIZ_ERROR | 业务异常 | 请稍后重试 |
isv.biz-error: INVENTORY_NOT_EXSIT_ERROR | 库存不存在 | 请检查输入参数 |
isv.invalid-parameter:NOTNULL | 参数不能为空 | 参数不能为空 |
isv.remote-service:CONVERT_ERROR | 转换对象时出错 | 请检查输入参数 |
isv.invalid-parameter:RATEPLAN_TYPE_NOT_EXIST | RP不存在 | 发布RP |
isv.room-error:ROOM_NOT_EXIST | 房型不存在 | 房型不存在,请检查房型参数 |
isp.service-unavailable | 服务不可用 | 服务不可用 |