文档中心 > API类目 > 飞猪推广平台

alibaba.fliggy.cps.hotel.compare (四海通代订中心酒店比价接口)

四海通代订中心酒店比价接口

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
hotel_compare_price_request HotelComparePriceRequest 可选 请求体
  • └ with_qr_code
  • Boolean
  • 可选
  • true
  • 是否需要二维码 默认需要
  • └ activity_id
  • String
  • 必须
  • test
  • 活动id 由活动主办方提供
  • └ check_in
  • String
  • 必须
  • 2023-06-01
  • 酒店入住日期
  • └ sh_id
  • String
  • 必须
  • xxxxxxx
  • 酒店id 从酒店同步接口获取
  • └ promotion_position_id
  • Number
  • 必须
  • 100000000000
  • 推广位id
  • └ client
  • String
  • 可选
  • weixin
  • 推广端(如微信,默认weixin)
  • └ fliggy_app_key
  • Number
  • 必须
  • 10000000
  • 媒体id
  • └ max_price
  • Number
  • 可选
  • 50000
  • 比价阈值(单位分)
  • └ check_out
  • String
  • 必须
  • 2023-06-02
  • 酒店离店日期(不能和入住同一天)
  • └ user_id
  • Number
  • 必须
  • 123
  • 下单用户id
  • └ sr_id
  • String
  • 必须
  • xxxxxyyyy
  • 酒店房型id从酒店同步接口获取

响应参数

名称 类型 示例值 描述
is_success Boolean true 请求成功标志
result_code String 200 结果状态码
model HotelComparePriceResponse 返回数据体
  • └ is_success
  • Boolean
  • true
  • 比价结果(true为比价成功)
  • └ min_price
  • Number
  • 50000
  • 最低价格(单位分)
  • └ sh_id
  • String
  • xxxxx
  • 酒店id
  • └ hotel_name
  • String
  • 某某酒店
  • 酒店名称
  • └ sr_id
  • String
  • xxxxx
  • 酒店房型id
  • └ sr_name
  • String
  • 大床房
  • 房型名称
  • └ share_material
  • Json
  • {"qrCode":"https://fli.alicdn.com/upload/sht/xxxxxxxx.png", "link":"https://xxxxx/index.html?xxxx", "qrCodeContent":"https:xxxxxxx?fpid=182008&fp_scene=test&fpsid=xxxx&checkIn=2023-06-01&shid=xxxx&checkOut=2023-06-02"}
  • 推广物料返回体
  • └ breakfast_quantity
  • Number
  • 1
  • 最低价格含早餐份数
  • breakfast_dict
  • BreakfastVO
  • 早餐价格字典(受max_price参数过滤)
  • └ zero_breakfast
  • Number
  • 100
  • 无早价格
  • └ one_breakfast
  • Number
  • 200
  • 单早价格
  • └ two_breakfast
  • Number
  • 300
  • 双早价格
  • └ three_breakfast
  • Number
  • 400
  • 三早价格
  • └ four_breakfast
  • Number
  • 500
  • 四早价格
  • └ five_breakfast
  • Number
  • 600
  • 五早价格
result_message String 结果描述信息

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaFliggyCpsHotelCompareRequest req = new AlibabaFliggyCpsHotelCompareRequest();
AlibabaFliggyCpsHotelCompareRequest.HotelComparePriceRequest obj1 = new AlibabaFliggyCpsHotelCompareRequest.HotelComparePriceRequest();
obj1.setWithQrCode(true);
obj1.setActivityId("test");
obj1.setCheckIn("2023-06-01");
obj1.setShId("xxxxxxx");
obj1.setPromotionPositionId(100000000000L);
obj1.setClient("weixin");
obj1.setFliggyAppKey(10000000L);
obj1.setMaxPrice(50000L);
obj1.setCheckOut("2023-06-02");
obj1.setUserId(123L);
obj1.setSrId("xxxxxyyyy");
req.setHotelComparePriceRequest(obj1);
AlibabaFliggyCpsHotelCompareResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<alibaba_fliggy_cps_hotel_compare_response>
    <is_success>true</is_success>
    <result_code>200</result_code>
    <model>
        <is_success>true</is_success>
        <min_price>50000</min_price>
        <sh_id>xxxxx</sh_id>
        <hotel_name>某某酒店</hotel_name>
        <sr_id>xxxxx</sr_id>
        <sr_name>大床房</sr_name>
        <share_material>{&quot;qrCode&quot;:&quot;https://fli.alicdn.com/upload/sht/xxxxxxxx.png&quot;, &quot;link&quot;:&quot;https://xxxxx/index.html?xxxx&quot;, &quot;qrCodeContent&quot;:&quot;https:xxxxxxx?fpid=182008&amp;fp_scene=test&amp;fpsid=xxxx&amp;checkIn=2023-06-01&amp;shid=xxxx&amp;checkOut=2023-06-02&quot;}</share_material>
        <breakfast_quantity>1</breakfast_quantity>
        <breakfast_dict>
            <zero_breakfast>100</zero_breakfast>
            <one_breakfast>200</one_breakfast>
            <two_breakfast>300</two_breakfast>
            <three_breakfast>400</three_breakfast>
            <four_breakfast>500</four_breakfast>
            <five_breakfast>600</five_breakfast>
        </breakfast_dict>
    </model>
    <result_message>无</result_message>
</alibaba_fliggy_cps_hotel_compare_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

返回
顶部