Asynchronous Search API

The Asynchronous Search API flow is useful for implementing a polling results behavior commonly seen on B2C websites. This flow keeps the end consumer engaged by displaying rates as received by the suppliers; with the async API, the search becomes as fast as your fastest supplier.

The complete Asynchronous Search API flow consists of three main APIs:

  1. Search Init: Initiates the search process.
  2. Search Results: Retrieves the initial set of search results.
  3. Search Results Polling: Continuously polls for the next set of results, updating the user with new data as it becomes available.

Search Init details:
HTTP: POST
Endpoint:{baseEndpoint}/api/hotel/availability/init

Search Result details::
HTTP: GET
Endpoint:{baseEndpoint}/api/hotel/availability/async/{token}/results

Search Results Polling details:
HTTP: GET
Endpoint:{baseEndpoint}/api/hotel/availability/async/{token}/results?nextResultsKey={{nextResultsKey}}

FAQs

For how long is the token that we received in the response valid?

The token is valid for 60 minutes.

How long should the Async API be polled for fresh results?

When using the Async API, you should continue polling for results until one of two conditions is met:

  1. The API reports Completed status.
  2. Your maximum waiting time (threshold) is reached

Suppose you are waiting for responses from 3 suppliers:

Supplier A responds in 5 seconds.

Supplier B responds in 7 seconds.

Supplier C responds in 20 seconds.

Your configured maximum waiting time (threshold) is 15 seconds.

In this case, you will stop polling at 15 seconds. You will take results from Supplier A and B, and ignore Supplier C because it came too late (20 seconds).

This approach ensures that you don’t keep waiting indefinitely for slower suppliers, while still capturing results from faster ones.

What happens if I don't get the cheapest rate from my fastest supplier?

The Async API will return the updated rate for a hotel once a lower fare is received.

Error Codes

Error CodeError Message
4001Invalid data in request - Please refer to the fields[] for more details.
5000Your request failed due to an unknown system error. Please contact support team with the correlationId.