Skip to main content
Every error uses the same JSON envelope and a stable error.code. Branch on the HTTP status and error.code. Show your own guest-friendly message; the message text is English for logs and support and can change.

The error envelope

Every response, successful or not, carries an X-Request-Id header. Validation failures (400) use code VALIDATION_ERROR and list the problems in message and details.

Status codes at a glance

Authentication, access and rate limits

Each response to an authenticated request carries RateLimit-Limit and RateLimit-Remaining headers. See Rate limits.

Hotel API errors

Request, hotel and contract

Rooms and the room stream

Booking token and prebook

A prebook that finds the room sold out, or finds the supplier would book a different room, is not an HTTP error: it returns 200 with success: false, revalidation.decision: "NOT_BOOKABLE" and prebooking_id: null. See Prebook a Room.

Create booking

A request that fails validation creates nothing and does not use up the prebooking_id, so you can fix the body and resend with the same Idempotency-Key.

Confirm hold

An uncertain confirmation (timeout, supplier 5xx) returns 200 with status PROCESSING. Do not call confirm-hold again; it is verified automatically.

Booking lookup and cancellation

Supplier errors

Supplier-native error text is kept private and is not a stable contract. Use the normalized code and error.details.retryable.

Failure codes on a booking

A booking that ends FAILED carries a failure.code in Get Booking Details (and failure_code in booking.failed webhooks and list rows). It uses the same vocabulary, plus these codes: The portal approval flow (BOOKING_REVIEW_INVALID and related 409 responses) is used by the Unifystays portal only. API keys cannot approve or reject a booking.

Retry guidance

Retry rules:
  • Use exponential backoff with jitter (for example 1, 2, 4, 8 seconds, up to about five attempts). Honour Retry-After when present.
  • Do not retry a 400, 401, 402, 403, 404, 406, 422 or 501 until you have changed something.
  • Cap retries so a guest is not left waiting. After the cap, show a recovery option (search again, contact support).
  • Do not retry any 4xx as a loop. A 409 means the state changed; read the state first.

Expired and used values

Contacting support

Send the request_id (or X-Request-Id), the booking_id when you have one, and the time of the call. Do not send API keys or full guest details. See also the IDs and Tokens Cheat Sheet, Hotel Booking Flow and Caching Strategy.