文档中心 > 酒店客栈-线上预订

国际酒店商家 接口接入必读文档

更新时间:2023/11/02 访问次数:2118

1、上传酒店接口(taobao.xhotel.update)

在使用这个接口上传酒店的时候,一定要填写这两个字段,vendor和supplier,具体填写的值可以联系对应的BD(运营)

image


2、登陆mock接口调试页面,提示:权限不足,请用有权限的帐号登录

mock接口调试页面链接

image

解决方法:将商家的hotel或者fliggy账号提供给对接群内的技术同学,添加白名单即可


3、mock接口调试页面和测试用例

mock工具中填写的是商家自定义的服务地址、用户名、密码,用来访问商家环境

商家在这个mock平台上对技术同学提供的测试用例进行接口请求调试,测试用例请在群中 @技术同学 进行获取

image


4、「Hotel Detail」和「Room Availability」接口的返回值

接口自测时,重点关注Hotel Detail和Room Availability这两个接口的返回值(商家侧返回),确保字段值大小写、value值都是正确的


特别注意:RoomTypeCode的值 需要和 推送房型接口(taobao.xhotel.roomtype.update)中的outer_id字段值保持一致


Hotel Detail接口示例返回值

<HotelRoomsResponse>
    <ResponseTimestamp>1693900759</ResponseTimestamp>
    <Hotel>
        <Name>The Manhattan at Times Square</Name>
        <EnglishName>The Manhattan at Times Square</EnglishName>
        <Address>23165</Address>
        <CityCode>905457</CityCode>
        <HotelCode>6295</HotelCode>
        <CheckIn>2024-01-02</CheckIn>
        <CheckOut>2024-01-03</CheckOut>
        <PaymentType>1</PaymentType>
        <MinPrice>122.43</MinPrice>
        <MinTaxPrice>0.00</MinTaxPrice>
        <CurrencyCode>USD</CurrencyCode>
        <RoomTypes>
            <RoomType>
                <RoomTypeName>Standard Queen Room</RoomTypeName>
                <RoomTypeCode>6295_R1QS</RoomTypeCode>
                <RoomTypeEnglishName>Standard Queen Room</RoomTypeEnglishName>
                <MaxRoomOccupancy>2</MaxRoomOccupancy>
                <RateInfos>
                    <RateInfo>
                        <RateKey>754e17ba-bdcb-4c55-b0d2-a1376a5d29c4__0</RateKey>
                        <RateCode>RO--X--X--X</RateCode>
                        <RateName>Normal Rate</RateName>
                        <RateEnglishName>Normal Rate</RateEnglishName>
                        <Allotment>1</Allotment>
                        <Refundable>true</Refundable>
                        <Board>
                            <BoardCode>No</BoardCode>
                            <BoardCount>0</BoardCount>
                        </Board>
                        <PaymentType>1</PaymentType>
                        <CurrencyCode>USD</CurrencyCode>
                        <TotalBasePrice>122.43</TotalBasePrice>
                        <TotalPrice>122.43</TotalPrice>
                        <TotalTaxAndFee>0</TotalTaxAndFee>
                        <CancelPolicyInfos>
                            <CancelPolicyInfo>
                                <CancelTime>12:00</CancelTime>
                                <StartWindowHours>0</StartWindowHours>
                                <Amount>122.43</Amount>
                                <TimeZone>+00:00</TimeZone>
                                <CurrencyCode>USD</CurrencyCode>
                            </CancelPolicyInfo>
                            <CancelPolicyInfo>
                                <CancelTime>12:00</CancelTime>
                                <StartWindowHours>48</StartWindowHours>
                                <Amount>0</Amount>
                                <TimeZone>+00:00</TimeZone>
                                <CurrencyCode>USD</CurrencyCode>
                            </CancelPolicyInfo>
                        </CancelPolicyInfos>
                        <RateComments>
                            <RateComment>A Resort Fee totaling $40.16 will be charged for the stay.</RateComment>
                        </RateComments>
                        <PaxPriceRooms>
                            <PaxPriceRoom>
                                <RoomIndex>1</RoomIndex>
                                <Adults>2</Adults>
                                <Children>0</Children>
                                <DailyInfos>
                                    <DailyInfo>
                                        <Day>2024-01-02</Day>
                                        <BasePrice>122.43</BasePrice>
                                        <Price>122.43</Price>
                                        <TaxAndFee>0</TaxAndFee>
                                        <CurrencyCode>USD</CurrencyCode>
                                    </DailyInfo>
                                </DailyInfos>
                            </PaxPriceRoom>
                        </PaxPriceRooms>
                        <MaxOccupancy>3</MaxOccupancy>
                        <MaxChildren>1</MaxChildren>
                    </RateInfo>
                    <RateInfo>
                        <RateKey>754e17ba-bdcb-4c55-b0d2-a1376a5d29c4__1</RateKey>
                        <RateCode>RO--NRF--X--X</RateCode>
                        <RateName>NON_REFUNDABLE</RateName>
                        <RateEnglishName>NON_REFUNDABLE</RateEnglishName>
                        <Allotment>1</Allotment>
                        <Refundable>false</Refundable>
                        <Board>
                            <BoardCode>No</BoardCode>
                            <BoardCount>0</BoardCount>
                        </Board>
                        <PaymentType>1</PaymentType>
                        <CurrencyCode>USD</CurrencyCode>
                        <TotalBasePrice>146.04</TotalBasePrice>
                        <TotalPrice>146.04</TotalPrice>
                        <TotalTaxAndFee>0</TotalTaxAndFee>
                        <RateComments>
                            <RateComment>A Resort Fee totaling $40.16 will be charged for the stay.</RateComment>
                        </RateComments>
                        <PaxPriceRooms>
                            <PaxPriceRoom>
                                <RoomIndex>1</RoomIndex>
                                <Adults>2</Adults>
                                <Children>0</Children>
                                <DailyInfos>
                                    <DailyInfo>
                                        <Day>2024-01-02</Day>
                                        <BasePrice>146.04</BasePrice>
                                        <Price>146.04</Price>
                                        <TaxAndFee>0</TaxAndFee>
                                        <CurrencyCode>USD</CurrencyCode>
                                    </DailyInfo>
                                </DailyInfos>
                            </PaxPriceRoom>
                        </PaxPriceRooms>
                        <MaxOccupancy>3</MaxOccupancy>
                        <MaxChildren>1</MaxChildren>
                    </RateInfo>
                </RateInfos>
            </RoomType>
        </RoomTypes>
    </Hotel>
</HotelRoomsResponse>


5、取消政策

若可取消:<Refundable>true</Refundable> + 取消政策代码

若不可取消:<Refundable>false</Refundable> (不加取消政策代码)

取消政策代码只填写2段<CancelPolicyInfo>的代码块,示例值:

image.png


6、Hotel Detail Query 商家侧如果发生价格/库存发生变化,飞猪侧能否刷新最新价格?

答复:我们会将请求商家的结果缓存起来,下次同样的请求可能使用的是本地的缓存,方便页面渲染。

如果请求商家有新的数据变更的话,一定是展示的是最新数据


7、Hotel Detail Query 中的RateKey需要如何填写?

答复:RateKey是唯一值,对接的接口文档中有描述,如果不确定取什么值的话,可以和RateCode保持一致(前提是需要唯一)


8、与飞猪技术同学进行测试联调的流程是怎样的?

答复:商家先在mock工具中将技术同学提供的测试文档case自测通过后(商家线上环境),再在技术对接群里@技术同学 进行线上验证测试,具体的联调流程见群公告


9、非法或过期的SessionKey参数

现象:返回的报文中出现如下信息

{

  "Result": null,

  "ErrCode": "27",

  "ErrMsg": "Invalid session",

  "SubErrCode": "invalid-sessionkey",

  "SubErrMsg": "非法或过期的SessionKey参数,请使用有效的SessionKey参数",

  "RequestId": "16mfw931tb5hz",

  "Body": "<?xml version=\"1.0\" encoding=\"utf-8\" ?><error_response><code>27</code><msg>Invalid session</msg><sub_code>invalid-sessionkey</sub_code><sub_msg>非法或过期的SessionKey参数,请使用有效的SessionKey参数</sub_msg><request_id>16mfw931tb5hz</request_id></error_response><!--top033079187105.center.na620-->",

  "IsError": true

}


解决方法:打开BD(运营)同学提供的入驻开放平台文档,将应用进行上线并授权;若之前的应用已经上线,则打开SessionKey重新授权链接,输入应用的appkey,获取授权后的SessionKey(3个月的有效期,sessionkey即将过期前,在淘宝开放平台会有站内信提醒用户

image

image


10、提示:isv.permission-api-package错误

现象:提示访问淘宝API错误,sub_code=isv.permission-api-package-lim_msg=scope ids is 381 10881 12159 19779

原因:

  1. 在开放平台后台未申请酒店商品API权限包
  2. SDK在酒店商品API权限包还未申请结束后就进行下载

解决方法:

打开BD(运营)同学提供的入驻开放平台文档,里面的第4步和第6步有进行解答说明

  1. 国际酒店商家申请:酒店商品API权限包
  2. 等申请的 酒店商品API权限包 审批通过之后再去下载对应语言版本的SDK


FAQ

关于此文档暂时还没有FAQ
返回
顶部