文档中心 > API类目 > 酒店商品API

taobao.xhotel.rates.lite.incr.update (酒店价格库存轻量级增量接口)

多个rate的库存房价开关的增量更新接口

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
rate_list_inv_info String 必须 [{"rp_code":"031612_181220000074_F1_1","out_rid":"031612_HD","vendor":"taobao","useRoomInv":0,"invAndSwitch":[{"date":"2020-01-09","price":1200,"quota":23,"rateStatus":1},{"date":"2020-01-10","price":1200,"quota":23,"rateStatus":0}]},{"rp_code":"1234","out_rid":"123456","vendor":"taobao","useRoomInv":0,"invAndSwitch":[{"date":"yyyy-MM-dd","price":1200,"quota":23,"rateStatus":1},{"date":"yyyy-MM-dd","price":1200,"quota":23,"rateStatus":1}]}] json格式: [{"rp_code":"031612_181220000074_F1_1","out_rid":"031612_HD","vendor":"taobao","useRoomInv":0,"invAndSwitch":[{"date":"2020-01-09","price":1200,"quota":23,"rateStatus":1},{"date":"2020-01-10","price":1200,"quota":23,"rateStatus":0}]},{"rp_code":"1234","out_rid":"123456","vendor":"taobao","useRoomInv":0,"invAndSwitch":[{"date":"yyyy-MM-dd","price":1200,"quota":23,"rateStatus":1},{"date":"yyyy-MM-dd","price":1200,"quota":23,"rateStatus":1}]}] rp_code:房价code,out_rid:房型code,必传字段 useRoomInv: 表示是否使用房型库存(1表示是,0表示否),可选字段 invAndSwitch: 表示要更新的日历化价格库存以及开关,增量更新,更新哪天就传那天的日历化单元, 可选字段 invAndSwitch.date: 表示日历化单元里的日期,格式:yyyy-MM-dd, 在 invAndSwitch 里的每个日历化单元里是必填字段 invAndSwitch.price: 表示要更新的价格,单位 分, 可选字段 invAndSwitch.quota: 表示要更新的普通库存,可选字段 invAndSwitch.rateStatus: 表示要更新的价格开关,1表示开,0表示关,可选字段。请注意,该接口为轻量级批量增量更新接口,只能更新未来4天内价格库存开关信息,传入的参数日期超过4天了会报错。该接口核心是解决近几天价格库存实时性。

响应参数

名称 类型 示例值 描述
result ResultSet result
  • └ first_result
  • String
  • {12343:true,432:"更新失败"}
  • 多个rate的更新结果
  • └ error_code
  • String
  • 0
  • errorCode
  • └ error_msg
  • String
  • 0
  • errorMsg
  • └ success
  • Boolean
  • true
  • success

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
XhotelRatesLiteIncrUpdateRequest req = new XhotelRatesLiteIncrUpdateRequest();
req.setRateListInvInfo("[{\"rp_code\":\"031612_181220000074_F1_1\",\"out_rid\":\"031612_HD\",\"vendor\":\"taobao\",\"useRoomInv\":0,\"invAndSwitch\":[{\"date\":\"2020-01-09\",\"price\":1200,\"quota\":23,\"rateStatus\":1},{\"date\":\"2020-01-10\",\"price\":1200,\"quota\":23,\"rateStatus\":0}]},{\"rp_code\":\"1234\",\"out_rid\":\"123456\",\"vendor\":\"taobao\",\"useRoomInv\":0,\"invAndSwitch\":[{\"date\":\"yyyy-MM-dd\",\"price\":1200,\"quota\":23,\"rateStatus\":1},{\"date\":\"yyyy-MM-dd\",\"price\":1200,\"quota\":23,\"rateStatus\":1}]}]");
XhotelRatesLiteIncrUpdateResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<xhotel_rates_lite_incr_update_response>
    <result>
        <first_result>{12343:true,432:&quot;更新失败&quot;}</first_result>
        <error_code>0</error_code>
        <error_msg>0</error_msg>
        <success>true</success>
    </result>
</xhotel_rates_lite_incr_update_response>

异常示例

  • XML示例
  • JSON示例
<error_response>
    <code>50</code>
    <msg>Remote service error</msg>
    <sub_code>isv.invalid-parameter</sub_code>
    <sub_msg>非法参数</sub_msg>
</error_response>

错误码解释

错误码 错误描述 解决方案

API工具

如何获得此API

FAQ

返回
顶部