taobao.xhotel.bnbpricecmp.get (民宿房源比价查询)

民宿房源比价查询接口

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
price_cmp_param PriceCmpParam 必须 根入参
  • └ srids
  • Number []
  • 可选
  • 标准房型id列表
  • └ hid
  • Number
  • 必须
  • 123456
  • 卖家酒店id
  • └ check_in
  • String
  • 必须
  • 2022-01-01
  • 入住日期
  • └ check_out
  • String
  • 必须
  • 2022-01-02
  • 离店日期
  • └ cmp_type
  • String
  • 必须
  • RATE
  • 比价类型,RATE、ROOM

响应参数

名称 类型 示例值 描述
result ResultSet 结果信息
  • └ error_code
  • String
  • 0
  • 错误码
  • data
  • BnbComparisonDTO []
  • 比价结果集合
  • └ hid
  • Number
  • 123
  • 卖家门店id
  • └ rid
  • Number
  • 234
  • 卖家房源id
  • └ shid
  • Number
  • 345
  • 标准门店id
  • └ srid
  • Number
  • 456
  • 标准房源id
  • └ status
  • Number
  • 3
  • 比价结果,1 -- win;3 -- lose
  • └ breakfast
  • Number
  • 2
  • 早餐 0 -- 无早; 1 -- 单早; 2 -- 双早; 3 -- 3早; 4 -- 多早
  • └ cancel_policy
  • String
  • FREE_CANCELLATION
  • 退改政策,UNKNOWN -- 未知;FREE_CANCELLATION -- 免费取消;LIMITED_CANCELLATION -- 限时取消;REJECT_CANCELLATION -- 不可取消
  • └ diff
  • Number
  • 1000
  • 价差,单位分
  • └ rp_id
  • Number
  • 567
  • 卖家rpid
  • └ price
  • Number
  • 30000
  • 卖家最低价(含营销)
  • └ origin_price
  • Number
  • 32000
  • 卖家最低价原价
  • └ check_in
  • Date
  • 2022-01-01
  • 入住日期
  • └ check_out
  • Date
  • 2022-01-02
  • 离店时间
  • └ error_msg
  • String
  • error
  • 错误信息提示
  • └ success
  • Boolean
  • false
  • 是否成功

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
XhotelBnbpricecmpGetRequest req = new XhotelBnbpricecmpGetRequest();
XhotelBnbpricecmpGetRequest.PriceCmpParam obj1 = new XhotelBnbpricecmpGetRequest.PriceCmpParam();
obj1.setSrids(new Long[] {  };
);
obj1.setHid(123456L);
obj1.setCheckIn("2022-01-01");
obj1.setCheckOut("2022-01-02");
obj1.setCmpType("RATE");
req.setPriceCmpParam(obj1);
XhotelBnbpricecmpGetResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<xhotel_bnbpricecmp_get_response>
    <result>
        <error_code>0</error_code>
        <data>
            <bnb_comparison_d_t_o>
                <hid>123</hid>
                <rid>234</rid>
                <shid>345</shid>
                <srid>456</srid>
                <status>3</status>
                <breakfast>2</breakfast>
                <cancel_policy>FREE_CANCELLATION</cancel_policy>
                <diff>1000</diff>
                <rp_id>567</rp_id>
                <price>30000</price>
                <origin_price>32000</origin_price>
                <check_in>2022-01-01</check_in>
                <check_out>2022-01-02</check_out>
            </bnb_comparison_d_t_o>
        </data>
        <error_msg>error</error_msg>
        <success>false</success>
    </result>
</xhotel_bnbpricecmp_get_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

返回
顶部