Wrapper (B2C) API
Overview
Wrapper (B2C) API serves as an enhanced version of Hotels API, offering additional functionalities specifically designed for B2C workflows. This API is distinguished by its focus on improving user experience.
Notably, it utilizes static data, which eliminates the delay typically associated with waiting for supplier responses or Database queries.
Key Features
Hotels Filtering
The B2C (wrapper) API provides comprehensive filtering options to tailor the hotel search experience. These options include:
- Price Range - Filter hotels based on minimum and maximum price limits.
- Amenities - Select hotels offering specific amenities like fitness centers, parking, pet-friendliness, Wi-Fi, etc.
- Hotel Chains - Filter based on specific hotel chains.
- Refundability - Find hotels offering refundable booking options.
- Room Basis - Filter by types of accommodation, such as Bed and Breakfast (BB), Half Board (HB), or Room Only (RO).
- Room Class - Choose from various room classes like Business, Deluxe, Executive with view, etc.
- Room Type - Select specific room types such as Double, King, Dorm, Queen.
- Star Rating - Filter hotels based on their star ratings.
- Supplier - Choose hotels from specific suppliers.
Note
To enable filtering options in the Search step, suppliers must support the retrieval of hotel and room information during the Search step.
Some suppliers only provide this information in the GetPackages step, which does not support filtering options.
Pagination
Pagination in an API, like the Wrapper API, facilitates the efficient management of large data sets. By enabling the retrieval of data in smaller, manageable chunks, it prevents the overload that can occur when attempting to fetch all data in a single request.
Enhanced User Experience
Implementing Wrapper API enhances the user experience. Users can navigate through the data more easily, accessing specific sections of information without being overwhelmed by an excess of data at once. This approach is particularly useful in applications where user interaction with data is a key aspect.
B2C (wrapper) API Flow
Request | Explanation |
---|---|
Login | Login using user credentials to establish a Session. |
Search | Hotel Search request allows you to search for Hotels, either by Geolocations or by HotelIDs. |
GetPage | Retrieves a specific page from the results. |
Get Packages | Retrieves the Rooms details and information of a specific Hotel. |
Get Cancellation Policy | This function sends a request for the cancellation policy and should be used before sending a booking request. |
Get Payment Preferences | Payment Preferences is used to retrieve the booking payment possibilities for a selected package. |
Get Hotel Content | Retrieves the Content of a specific Hotel. |
Get Supplier Breakdown | Retrieves a breakdown/summary of the available results per Supplier. |
Book | Submits a new booking request for the selected hotel and returns the booking reference and booking status. |
Login
The Wrapper API is a session-based service, so proper session creation and management are crucial.
The "Login" request is mandatory in this API - as it establishes a connection and retrieves the sessionID.
Login API examples (Postman) - Click here.
Search
The Search request provides the capability to find hotels using the following criteria:
- Geo Locations, specified by latitude and longitude, within a radius of up to 75 km.
- Hotel IDs, with the option to include up to 3,000 hotel IDs in a single request.
Before initiating the Search request, you can select the number of results to display on each page. The results will also include the 'TotalPages' information, which can be accessed through the GetPage request.
To apply filterings in the Search step - please set “IsPaginatedSearch” flag is set to “True” in the request, otherwise no entities will be returned in the response. (If not defined, default is False). - This is not recommended !
NOTE:
The Search Request not only provides search results but also generates and builds and returns available filters in the response.
This allows users to utilize these filters when making GetPage requests to filter the returned hotels.
Search API examples (Postman) - Click here.
Get Page
The GetPage request is used to fetch a particular page from the search results. Within the GetPage response, you will find information regarding the total number of pages, referred to as 'TotalPages'.
This enables you to request subsequent pages, starting with page 0 and progressing to the last page.
Additionally, the GetPage request allows you to fine-tune your hotel search by applying various filters, such as Minimum Price, Maximum Price, Star Rating, Basis, Class, Name, and more.
NOTE :
The available filters in the GetPage step are the ones returned in the Search step.
By specifying these filters, you can narrow down the results to include only hotels that meet your specific criteria.
Suppliers need to support room information at the search step.
For suppliers who return room information in a separate call, the filtering option will not be available because this information is missing from the search step.
NOTE:
You have the flexibility to control the 'ResultsPerPage' parameter, allowing you to adjust the number of results displayed on each page.
This can be particularly useful to reduce the total number of pages and streamline your search process.
Get Page API examples (Postman) - Click here.
Get Packages
GetPackages - GetPackages request is used to get updated room information in a specific a hotel.
In order to send this request, all you need is the hotelID & sessionID which returned in the Search Hotels response.
GetPackages API examples (Postman) - Click here.
Get Cancellation Policy
This function sends a request for the cancellation policy and should be used before sending a booking
request.
In order to send this request, all you need is the hotelID , PackageID & sessionID that was returned in the GetPackages response.
NOTE :
When initiating Multi-Cxl-Policy -
this call should be used only once the end-user wants to retrieve information for a specific rate and under no circumstances should be used to retrieve ALL cancellation policies for all package IDs returned.
Get Cancellation Policy API examples (Postman) - Click here.
Get Payment Preferences
Payment Preferences is used to retrieve the booking payment possibilities for a selected package.
In order to send this request, all you need is the hotelID , PackageID & sessionID that was returned in the GetPackages response.
Payment preferences will specify if the user (whose credentials were used to access the API and to
create the session) is allowed to make a booking, if he/she can pay by credit card (internal/external),
cash or other alternative method (pay upon arrival).
Get Payment Preferences API examples (Postman) - Click here.
Get Hotel Content
The Content request allows you to retrieve specific content for a particular hotel. You have the option to choose which types of content you need, such as images, descriptions, and facilities/amenities information, depending on your requirements.
Get Hotel Content API examples (Postman) - Click here.
Get Supplier Breakdown
The request retrieves a summary breakdown of the available results per supplier. This breakdown includes information on the number of suppliers, the count of hotels provided by each supplier, and the count of rooms offered by each supplier.
Get Supplier Breakdown API examples (Postman) - Click here.
Book
The Booking request allows you to submit a new booking request for the selected hotel, and returns the booking reference and booking status as a response.
It's important to note that you can only book items that were returned in the last search within the same session, ensuring that you're booking from the most recent and relevant search results.
The Book response may take up to 180 seconds, as it relies on responses from suppliers and, in certain instances, incorporates SmartBook logic or Dynamic Markups that utilize sophisticated business logic.
Book API examples (Postman) - Click here.
Updated 5 days ago