Wrapper (B2C) Async API

Overview

The Wrapper B2C Async API - extends the functionality of the B2C Wrapper API search by incorporating asynchronous search capabilities.

This allows for the initial search results to be returned within seconds, enabling you to present them to end users almost immediately.

As more results become returned, new hotels returned can be retrieved with a simple "Get Async Results" request, allowing partners to continuously populate additional hotel options without the need to wait to all suppliers responses.

Wrapper (B2C) Async API serves as an enhanced version of Hotels Async API, offering additional functionalities specifically designed for B2C workflows. This API is distinguished by its focus on improving user experience.

Key Features

Hotels Filtering

The B2C (wrapper) API provides comprehensive filtering and async options to tailor the hotel search experience.

👍

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 B2C Wrapper Async 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) Async API Flow

RequestExplanation
LoginLogin using user credentials to establish a Session.
Search AsyncThe Search Async request enables you to search for hotels by either geolocations or Hotel IDs.
The first response is returned as defined in the request, while the search continues to aggregate additional results in the background.
Get Async ResultsThe Get Async Results call retrieves the updated search response, including all additional properties gathered since the first results were returned.
GetPageRetrieves a specific page from the results.
Get PackagesRetrieves the Rooms details and information of a specific Hotel.
Get Cancellation PolicyThis function sends a request for the cancellation policy and should be used before sending a booking
request.
Get Payment PreferencesPayment Preferences is used to retrieve the booking payment possibilities for a selected package.
Get Hotel ContentRetrieves the Content of a specific Hotel.
Get Supplier BreakdownRetrieves a breakdown/summary of the available results per Supplier.
BookSubmits 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 Async

The Search Async request allows you to search for Hotels based on :

  • Geo Locations (latitude and longitude) with a radius of up to 75 km.
  • HotelID/s (up to 3,000 hotel IDs in a single request).

👍

The first response is returned as defined in the 'AwaitTimeForInitialResults' field, while the search continues to aggregate additional results in the background according to the 'TimeoutSeconds' field.

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 Async examples (Postman) - Click here.

Get Async Results

The Get Async Results call retrieves the updated search response, including all additional properties gathered since the first results were returned.

👍

Explained:

If the 'Search Async' response is returned after 2 seconds, for example, the search will continue to aggregate additional results in the background.

When you initiate the 'Get Async Results' request, all additional properties gathered after those initial 2 seconds will also be included.

Get Async Results example (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.

Book API examples (Postman) - Click here.


Post Booking

After successfully booking a hotel using the recommended booking flow, there are further optional requests you can use after the booking made .

Cancel a Segment

This function submits a request to cancel an existing Segment with Status 'OK'.

reservations with multi rooms:
(1) there are suppliers that return a single booking confirmation id for all rooms together - on HSP all rooms will be under single Segment ID.

(2) there are suppliers that return for each room a unique booking confirmation id - on HSP each room will have wis own single Segment ID (correlated with supplier).

'Cancel Book' request supports single Segment ID only.

for case (1): all rooms will be cancelled at once
for case (2): requires to send multi calls for 'Cancel Book' in order to cancel all rooms / Segments,
or can cancel part of the rooms by relevant Segment ID

Cancel Segment examples (Postman) - Click here.


Check Status

This function submits a request to retrieve the updated status and booking data.

Check Status examples (Postman) - Click here.