Sessions, Timeouts & Retries
The operational details that determine whether your integration is robust under real-world conditions — slow networks, supplier outages, and request retries. Skipping this page is the most common cause of duplicate bookings.
Session expiry
Two values issued during Search must be used within their lifetime:
| Token | Issued by | Used in | Lifetime | On expiry |
|---|---|---|---|---|
SearchSessionId | findhotel / findhotelbyid | Pre-Book, Booking | 30 min | Re-run Search |
BookingKey | findhotel / findhotelbyid | Cancel Policy, Pre-Book, Booking | 30 min | Re-run Search |
Once a Booking call succeeds, the SearchSessionId and BookingKey have served their purpose and can be discarded. From that point onward, the BookingId and BookingCode are the references.
Do not cache SearchSessionId or BookingKey across user sessions. They are short-lived and tied to a specific search. Caching them produces stale-token errors and confuses your users.
Recommended HTTP client timeouts
Use these as starting values; tune based on observed P95 latency in your environment.
| Endpoint | Recommended timeout | Notes |
|---|---|---|
findhotel / findhotelbyid | 30 seconds | Search aggregates multiple suppliers |
prebook | 30 seconds | Re-validates with the actual supplier |
bookhotel | 60 seconds | Booking is the most variable. See retry guidance below. |
cancelhotel | 30 seconds | Acknowledges immediately; cancellation processed asynchronously |
getbookingdetails / getConfirmationDetails | 20 seconds | Reads from RezLive cache; usually fast |
The booking-retry trap
This is the single most important operational rule in the API.
What to do when a Booking call times out
- Do NOT retry POST /bookhotel.
- Call
POST /getbookingdetailsusing theAgentRefNoyou sent on the original Booking request. - Inspect the response: if a booking exists with that AgentRefNo, the original call succeeded — store the BookingCode and proceed.
- If no booking is found, only then is it safe to retry POST /bookhotel.
It is the only way to deduplicate a booking after a network failure. Without a unique AgentRefNo, you cannot tell whether a timed-out booking succeeded or failed. The result is either a missed booking or a duplicate booking, both visible to the guest.
Retry guidance — other endpoints
| Endpoint | Safe to retry? | Strategy |
|---|---|---|
findhotel / findhotelbyid | Yes — idempotent | Exponential backoff: 1s, 2s, 4s. Stop at 3 retries. |
getcancellationpolicy | Yes — idempotent | Same as Search. |
prebook | Yes — idempotent | A small price drift between calls is normal; surface to user only if it exceeds your tolerance. |
bookhotel | No — verify first | See the booking-retry trap above. Always /getbookingdetails first. |
cancelhotel | Yes — idempotent | If the original cancel succeeded, retry returns "already cancelled." |
getbookingdetails | Yes — read-only | — |
getConfirmationDetails | Yes — read-only | May return Pending until hotel confirms. |