Migration Guide

## Timing and support for v1: - New features will only be added to v2 of the API. - Major bugfixes and support will continue for v1 until July 2, 2018. After that, v1 will no longer be supported. Bugs will no longer be fixed, and users who request support for v1 will instead be directed to upgrade to v2 in order to obtain support. - Users may migrate one endpoint at a time and use a combination of v1 and v2 endpoints as they transition. ## What's new in v2 of the Demand API? - v2 is faster, more stable, and much simpler to use. - The static content endpoints have been totally reworked so that getting content is easier, faster, and more intuitive. Content like photos and descriptions are now provided by a single **hotels** call which provides exactly the requested content. - The way changed content is monitored and delivered with **changedHotels** has been greatly improved. - All endpoint names and parameters have been standardized across the entire API. - Versioning the API allows many improvements to be launched at the same time, while allowing partners to test the new functionality before migrating. - The API usage guides at developers.booking.com have been completely revised. - Many other improvements have been made, please see below! ## Multiple endpoints - Strict output typing has been implemented: - Strict typing of JSON (booleans, integers, floats, strings) - Strict typing of XML-RPC (all types XML-RPC supports) - Specifying **json** is no longer required in URL paths and JSON will be provided by default. - Booleans: output is now **true** or **false** now instead of 0 or 1. - All image URLs will be HTTPS only. - All bad parameter errors will return HTTP status code 400. This includes unknown parameters and parameters with empty values. - XML-RPC calls must have correct 'Content/Type=text/xml'. - The way endpoints supports multiple translations has changed, instead of one item per translation, there is a 'translations' nested field with the translations (if available). **Note:** some parameters and endpoints are restricted based on partner permissions. For example, **processBooking** requires a special contract and a partner SSL certificate. ## Policies The GetPolicies endpoint has been removed. Default policies will be returned from the **hotels** endpoint. Other policies can be retrieved from **blockAvailability**, per block. ## Static Content: the hotels endpoint The following endpoints have all been replaced with with the v2 **hotels** endpoint: - GetHotels - GetHotelTranslations - GetHotelDescriptionTranslations - GetHotelDescriptionPhotos - GetHotelFacilities - GetHotelPhotos - GetCreditcards - GetPolicies - GetRooms - GetRoomTranslations - GetRoomFacilities - GetRoomPhotos - GetDistrictHotels - GetRegionHotels - GetChains - GetHotelLogoPhotos Please see the technical documentation for details on how to use the **hotels** endpoint. ## Changes to Specific Endpoints **Note:** Only more complex changes are listed here. For renamed parameters and other changes, see the mapping table. **blockAvailability** - HTML has been removed from the policies output. - The following fields were removed from the policies output: - Meal plans, Extra charges, Title (POLICY_TITLE) - In v2, meal plan information can be output by passing extras=mealplan - In v2, extra charges can be output by including extras=extra_charges - room_desc field from block_text was moved to block object and renamed to room_description. - block_text content was moved to block object. - hotel_text content was moved to hotel object. - The split_block_text parameter was removed. - cancellation policy that was shown in block object now can be found in block's policies list. - For examples see the technical documentation. ## changedHotels - Output is now more granular per specific hotel information that has changed. - See the technical documentation for examples and more information. ## bookingDetails - The status field has been changed. - Previous values: S, F, C, and NS. - New values: stayed, booked, cancelled, and no_show. ## processBooking Booker address must be included for properties that require it. The **hotels** endpoint contains this information. ## getHotelAvailability (legacy version) - In v1 of the API, there were two distinct availability endpoints with similar names: - getHotelAvailability (v1) - getHotelAvailabilityV2 - The older v1 endpoint has been retired and is not included in v2 of the API. - The endpoint getHotelAvailabilityV2 has been renamed to hotelAvailability in v2 of the API. - For details about other changes, see the mapping table. ## Mapping Table See the [mapping table between v1 and v2 endpoints](https://bstatic.com/backend_static/common/dist/affiliate_api/V2 endpoint input param and output field changes.pdf).