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

taobao.xhotel.get (酒店查询接口)

酒店查询接口

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
hid Number 可选 100000 废弃,请使用outer_id
outer_id String 可选 123123131
  • 最大长度:64
  • 卖家系统中的酒店ID。
    vendor String 可选 taobao
  • 最大长度:50
  • 系统商,一般不用填写,使用须申请
    need_sale_info Boolean 可选 false
  • 默认值:false
  • 是否需要在售状态(默认false不需要)

    响应参数

    名称 类型 示例值 描述
    xhotel FirstResult 查询得到的hotel
    • └ hid
    • Number
    • 123456
    • 酒店ID
    • └ status
    • Number
    • 0
    • 酒店状态:0: 正常;-2:停售;-1:删除
    • s_hotel
    • Shotel
    • 淘宝标准酒店信息
    • └ shid
    • Number
    • 123456
    • 酒店ID
    • └ name
    • String
    • 60
    • name
    • └ used_name
    • String
    • aaa
    • used_name
    • └ type
    • String
    • 连锁品牌,家庭旅馆
    • 酒店类型
    • └ domestic
    • Number
    • 0
    • 0:国内;1:国外
    • └ country
    • String
    • China
    • 国家编码
    • └ city_tag
    • String
    • 11,33
    • 地区标签
    • └ province
    • Number
    • 110000
    • 省份编码
    • └ city
    • Number
    • 110100
    • 城市编码
    • └ district
    • Number
    • 110101
    • 区域编码
    • └ business
    • String
    • aaa
    • business
    • └ address
    • String
    • 王府井
    • 酒店地址
    • └ level
    • String
    • A
    • 酒店级别
    • └ longitude
    • String
    • 2222.44
    • longitude
    • └ latitude
    • String
    • 123456.777
    • latitude
    • └ position_type
    • Number
    • 1
    • position_type
    • └ tel
    • String
    • 0086#010#12345678
    • 酒店电话
    • └ fax
    • String
    • 0086#010#12345678
    • 传真
    • └ opening_time
    • String
    • 2012
    • 开业年份
    • └ decorate_time
    • String
    • 2013
    • 装修年份
    • └ storeys
    • String
    • 11
    • 楼层数
    • └ extend
    • String
    • {"keyword":”上地”}
    • 扩展信息的JSON
    • └ rooms
    • Number
    • 100
    • 房间数
    • └ desc
    • String
    • 北京饭店在王府井位于XXX
    • 酒店介绍
    • └ service
    • String
    • {"airportShuttle":true}
    • 交通距离与设施服务。JSON格式。
    • └ hotel_facilities
    • String
    • {"会议室":true,"中式餐厅":true}
    • 酒店设施
    • └ room_facilities
    • String
    • {"宽带上网":true,"空调":true}
    • 房间设施
    • └ pic_url
    • String
    • http://img01.taobaocdn.com/bao/uploaded/i3/T1Ym4bXeJBXXbPV7.9_104339.jpg
    • 酒店图片url
    • └ created_time
    • Date
    • 2000-01-01 00:00:00
    • 创建时间
    • └ modified_time
    • Date
    • 2000-01-01 00:00:00
    • 修改时间
    • └ status
    • Number
    • 1
    • 0:营业中;-1:筹建中;- 4:失效
    • └ postal_code
    • String
    • 100072
    • 邮编
    • └ brand
    • String
    • aaa
    • brand
    • └ fee
    • String
    • 0
    • 杂费
    • └ name_e
    • String
    • aaa
    • 标准酒店英文名
    • └ is_kezhan
    • Number
    • 1
    • 0:酒店 1:客栈
    • └ error_info
    • String
    • 酒店不存在
    • 未通过时的拒绝原因等。
    • └ outer_id
    • String
    • 1111111
    • 卖家自己系统的id
    • └ name
    • String
    • 北京饭店
    • 酒店名称
    • └ domestic
    • Number
    • 0
    • 0:国内;1:国外
    • └ country
    • String
    • China
    • 国家编码
    • └ used_name
    • String
    • 北京大酒店
    • 曾用名
    • └ province
    • Number
    • 110100
    • 省份编码
    • └ city
    • Number
    • 110101
    • 城市编码
    • └ district
    • Number
    • 110101
    • 地区编码
    • └ business
    • String
    • aaa
    • 商圈信息
    • └ address
    • String
    • 北京市朝阳区
    • 酒店地址
    • └ longitude
    • String
    • 100.122
    • 经度
    • └ latitude
    • String
    • 110.122
    • 纬度
    • └ position_type
    • String
    • A
    • 坐标类型
    • └ tel
    • String
    • 0086#010#12345678
    • 酒店电话
    • └ extend
    • String
    • {"keyword":”上地”}
    • 扩展信息
    • └ match_status
    • Number
    • 1
    • hotel匹配状态: 0:待系统匹配 1:已系统匹配,匹配成功,待卖家确认 2:已系统匹配,匹配失败,待人工匹配 3:已人工匹配,匹配成功,待卖家确认 4:已人工匹配,匹配失败 5:卖家已确认,确认“YES” 6:卖家已确认,确认“NO” 7:已系统匹配,但是匹配重复,待人工确认
    • └ created_time
    • Date
    • 2000-01-01 00:00:00
    • 创建时间
    • └ modified_time
    • Date
    • 2000-01-01 00:00:00
    • 修改时间
    • └ data_confirm_str
    • String
    • 待审核
    • 匹配结果
    • └ credit_card_types
    • String
    • 1,2,3
    • 逗号分隔的字符串 1visa;2万事达卡;3美国运通卡;4发现卡;5大来卡;6JCB卡;7银联卡
    • └ name_e
    • String
    • Beijing hotel
    • 卖家酒店英文名称
    • └ vendor
    • String
    • taobao
    • vendor
    • └ tag_json
    • String
    • {"pure-direct-hotel":0,"direct-manual-order-hotel":1,"ebk-direct-hotel":0,"non-direct-hotel":1,"allow-dingding-business-travel-hotel":1,"willing-dingding-bussiness-travel-hotel":0,"calendar-room-package-hotel":1,"dijiajiajia-hotel":0,"ebk-number-of-confirm-room-hotel":1}
    • 酒店维度特殊标签含义, json: {"pure-direct-hotel":0,"direct-manual-order-hotel":1,"ebk-direct-hotel":0,"non-direct-hotel":1,"allow-dingding-business-travel-hotel":1,"willing-dingding-bussiness-travel-hotel":0,"calendar-room-package-hotel":1,"dijiajiajia-hotel":0,"ebk-number-of-confirm-room-hotel":1} , key含义: pure-direct-hotel 表示纯直连酒店, direct-manual-order-hotel 和 ebk-direct-hotel 和 non-direct-hotel 这三个key对应value都是0 . direct-manual-order-hotel 表示 人工承接失败订单的酒店标签。如果某个直连酒店打了该标签,那么直连下单失败以后,允许人工承接订单,由人工跟进 . ebk-direct-hotel 表示 ebk直连酒店标。如果某个酒店打了该标签,那么这个酒店下允许通过ebk发布直连rp . non-direct-hotel 表示 卖家非直连酒店标签。如果某个酒店打了该标签,那么该酒店下单不会走直连交易。 allow-dingding-business-travel-hotel 表示 允许进入阿里商旅渠道(钉钉)售卖信用住的单体酒店 willing-dingding-bussiness-travel-hotel 表示 已签协议愿意加入阿里商旅渠道售卖信用住的单体酒店 . calendar-room-package-hotel 表示 酒店可以参加日历房套餐活动包括创建,修改,删除活动信息(高星集团GMV项目) dijiajiajia-hotel 表示 底价加价酒店权限标。只有打了该标的酒店才允许维护底价加价规则和包房rp . ebk-number-of-confirm-room-hotel 表示ebk确认订单,是否要输入外部确认号 . nonstandard-project-hotel 表示该酒店是否参加非标项目
    • └ billing_process_type
    • Number
    • 0
    • 标识该酒店所走的 结算流程,如果是null 默认是 国内结算流程,否则是其他的,比如:海外信用住结算流程
    • └ currency_code_name
    • String
    • 0
    • 货币类型(编码,字母编码),hid 维度支持的币种信息,目前只能 add 时添加,不支持 update时更新,,如果DB中是null ,则默认是人民币 CNY
    • └ ali_nick
    • String
    • 旺旺号
    • 酒店对应的旺旺号
    • └ standard_room_facilities
    • String
    • {"10002":"12:00","10001":"14:00","10006":"凭身份证等有效身份证件办理入住"}
    • 资源方房型设施
    • └ standard_hotel_service
    • String
    • {"24152":true,"24153":true,"24005":true}
    • 资源方酒店服务
    • └ standard_hotel_facilities
    • String
    • {"24152":true,"24153":true,"24005":true}
    • 资源方酒店设施
    • └ standard_booking_notice
    • String
    • {"24152":true,"24153":true,"24005":true}
    • 资源方预订须知
    • └ standard_amuse_facilities
    • String
    • {"24152":true,"24153":true,"24005":true}
    • 资源方娱乐设施
    • └ on_sale
    • Number
    • 1
    • 离线数据,该酒店在售1,不在售0,未知-1
    • └ hot_search
    • Number
    • 1
    • 离线数据,该酒店热搜1,非热搜0,未知-1
    • └ hot_sale
    • Number
    • 1
    • 离线数据,该酒店热卖1,非热卖0,未知-1

    请求示例

    • JAVA
    • .NET
    • PHP
    • CURL
    • Python
    • C/C++
    • NodeJS
    TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
    XhotelGetRequest req = new XhotelGetRequest();
    req.setHid(100000L);
    req.setOuterId("123123131");
    req.setVendor("taobao");
    req.setNeedSaleInfo(false);
    XhotelGetResponse rsp = client.execute(req, sessionKey);
    System.out.println(rsp.getBody());

    响应示例

    • XML示例
    • JSON示例
    <xhotel_get_response>
        <xhotel>
            <hid>123456</hid>
            <status>0</status>
            <s_hotel>
                <shid>123456</shid>
                <name>60</name>
                <used_name>aaa</used_name>
                <type>连锁品牌,家庭旅馆</type>
                <domestic>0</domestic>
                <country>China</country>
                <city_tag>11,33</city_tag>
                <province>110000</province>
                <city>110100</city>
                <district>110101</district>
                <business>aaa</business>
                <address>王府井</address>
                <level>A</level>
                <longitude>2222.44</longitude>
                <latitude>123456.777</latitude>
                <position_type>1</position_type>
                <tel>0086#010#12345678</tel>
                <fax>0086#010#12345678</fax>
                <opening_time>2012</opening_time>
                <decorate_time>2013</decorate_time>
                <storeys>11</storeys>
                <extend>{&quot;keyword&quot;:”上地”}</extend>
                <rooms>100</rooms>
                <desc>北京饭店在王府井位于XXX</desc>
                <service>{&quot;airportShuttle&quot;:true}</service>
                <hotel_facilities>{&quot;会议室&quot;:true,&quot;中式餐厅&quot;:true}</hotel_facilities>
                <room_facilities>{&quot;宽带上网&quot;:true,&quot;空调&quot;:true}</room_facilities>
                <pic_url>http://img01.taobaocdn.com/bao/uploaded/i3/T1Ym4bXeJBXXbPV7.9_104339.jpg</pic_url>
                <created_time>2000-01-01 00:00:00</created_time>
                <modified_time>2000-01-01 00:00:00</modified_time>
                <status>1</status>
                <postal_code>100072</postal_code>
                <brand>aaa</brand>
                <fee>0</fee>
                <name_e>aaa</name_e>
                <is_kezhan>1</is_kezhan>
            </s_hotel>
            <error_info>酒店不存在</error_info>
            <outer_id>1111111</outer_id>
            <name>北京饭店</name>
            <domestic>0</domestic>
            <country>China</country>
            <used_name>北京大酒店</used_name>
            <province>110100</province>
            <city>110101</city>
            <district>110101</district>
            <business>aaa</business>
            <address>北京市朝阳区</address>
            <longitude>100.122</longitude>
            <latitude>110.122</latitude>
            <position_type>A</position_type>
            <tel>0086#010#12345678</tel>
            <extend>{&quot;keyword&quot;:”上地”}</extend>
            <match_status>1</match_status>
            <created_time>2000-01-01 00:00:00</created_time>
            <modified_time>2000-01-01 00:00:00</modified_time>
            <data_confirm_str>待审核</data_confirm_str>
            <credit_card_types>1,2,3</credit_card_types>
            <name_e>Beijing hotel</name_e>
            <vendor>taobao</vendor>
            <tag_json>{&quot;pure-direct-hotel&quot;:0,&quot;direct-manual-order-hotel&quot;:1,&quot;ebk-direct-hotel&quot;:0,&quot;non-direct-hotel&quot;:1,&quot;allow-dingding-business-travel-hotel&quot;:1,&quot;willing-dingding-bussiness-travel-hotel&quot;:0,&quot;calendar-room-package-hotel&quot;:1,&quot;dijiajiajia-hotel&quot;:0,&quot;ebk-number-of-confirm-room-hotel&quot;:1}</tag_json>
            <billing_process_type>0</billing_process_type>
            <currency_code_name>0</currency_code_name>
            <ali_nick>旺旺号</ali_nick>
            <standard_room_facilities>{&quot;10002&quot;:&quot;12:00&quot;,&quot;10001&quot;:&quot;14:00&quot;,&quot;10006&quot;:&quot;凭身份证等有效身份证件办理入住&quot;}</standard_room_facilities>
            <standard_hotel_service>{&quot;24152&quot;:true,&quot;24153&quot;:true,&quot;24005&quot;:true}</standard_hotel_service>
            <standard_hotel_facilities>{&quot;24152&quot;:true,&quot;24153&quot;:true,&quot;24005&quot;:true}</standard_hotel_facilities>
            <standard_booking_notice>{&quot;24152&quot;:true,&quot;24153&quot;:true,&quot;24005&quot;:true}</standard_booking_notice>
            <standard_amuse_facilities>{&quot;24152&quot;:true,&quot;24153&quot;:true,&quot;24005&quot;:true}</standard_amuse_facilities>
            <on_sale>1</on_sale>
            <hot_search>1</hot_search>
            <hot_sale>1</hot_sale>
        </xhotel>
    </xhotel_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>

    错误码解释

    错误码 错误描述 解决方案
    isv.invalid-parameter:NOTNULL 参数不能为空 请检查参数
    isv.invalid-parameter:ERROR 参数不正确 请检查参数
    isv.biz-error:STATUS_NOT_CORRECT 状态不正确 请检查状态
    isv.biz-error:NOT_RIGHTS_TO_PUBLISH_ERROR 非消保酒店卖家不能发布修改酒店、房型或宝贝 请使用消保酒店卖家操作
    isv.biz-error:HAS_NOT_MATCH_SHOTEL 酒店尚未匹配到标准酒店 请先进行酒店匹配
    isv.biz-error:HAS_NOT_CONFRIM_HOTEL 酒店匹配结果尚未确认 请先进行酒店匹配结果确认
    isv.invalid-parameter:HOTEL_EXIST 酒店已经存在 请不要重复添加酒店
    isv.invalid-parameter:HOTEL_NOT_EXIST 酒店不存在 请检查输入参数
    isv.biz-error:UPDATE_HOTEL_ERROR 更新酒店失败 请稍后重试
    isv.biz-error:CAN_NOT_UPDATE_HOTEL 酒店处于待匹配待确认或已确认成功状态无法更新 请检查匹配状态或稍后重试
    isv.invalid-parameter:BUSINESS_AREA_NOT_EXIST 商圈不存在 请检查商圈信息
    isv.biz-error:ALREADY_EXIST_SHOTEL 该卖家已经有酒店匹配了该标准酒店 请检查酒店信息,不要重复匹配
    isv.permission-error:NO_PERMISSIONS_ERROR 权限不够、非法访问 请申请权限
    isv.remote-service:CONVERT_ERROR 转换对象时出错 请检查输入参数

    API工具

    如何获得此API

    FAQ

    返回
    顶部