Skip to main content
POST
Call this endpoint after the customer selects a hotel. Send the same dates, occupancy, and nationality used for hotel search. Unifystays calls the active suppliers in parallel and normalizes their room options. This endpoint immediately returns the hotel’s static room catalogue and a short-lived SSE stream URL. Live supplier options then arrive through that stream. Each streamed option creates the two identifiers used by the next steps:
  • booking_token identifies one complete supplier option and is sent to prebook.
  • room_allocation_id identifies one exact room slot inside that option and is later used to assign guests during booking.

Request Example

Request Fields

If the customer changes the hotel, dates, nationality, number of rooms, or any room’s occupancy, request room options again. Tokens from the old request must not be reused.

Initial Response Example

The POST response is intentionally fast. data.options is initially empty; connect to data.sse_stream_url to receive live provider_options events.

Use the Response

The initial response contains the static room catalogue and a stream_id with sse_stream_url. Live supplier options are delivered progressively through the stream. Every streamed bookable option includes a short signed booking_token required by Prebook a Room.
mapping_status: "UNMAPPED" and unifystays_room: null do not make an option unbookable. Supplier-to-catalogue room matching is best-effort. The booking flow uses booking_token and room_allocation_id, which are created for every quoted room regardless of mapping status.
The mapper evaluates each supplier’s complete hotel room lineup rather than matching every room name independently. It combines semantic room attributes, hotel-local distinguishing phrases, and a globally stable one-to-one assignment. Successful mappings are persisted and reused. Name-only suppliers use an internal deterministic fingerprint, while their public provider_room.id remains null. Compact semantic signatures on mapping rows allow independently verified suppliers to confirm the same core-room target.

Choose the Room Object to Render

Each streamed room already carries its mapped unifystays_room snapshot. If it is null, render provider_room. Do not perform a client-side catalogue join and do not hide an option because a static mapping is unavailable.
The two room shapes are intentionally different. A mapped Unifystays room uses fields such as room_name, photos, and max_occupancy; a provider room uses name, images, and occupancy.max_allowed. Adapt both shapes to your own UI view model after selecting the fallback.
  • Keep the selected option’s booking_token only for the immediate prebook step; it is time-sensitive.
  • Connect to Stream Room Updates to obtain the bookable options and their identifiers.
  • Request fresh room options if the stay dates, guest mix, nationality, or selected hotel changes.
Do not cache room options or reuse their booking tokens as a checkout guarantee. Supplier-backed availability and price can change.
The OpenAPI section below provides the complete request body and response fields, including room options and stream identifiers.

Authorizations

x-api-key
string
header
required

Environment-specific API key created in the Unifystays portal

Headers

X-Unifystays-Contract-Version
enum<string>
default:1

Hotel API contract version. Missing defaults to v1.

Available options:
1

Path Parameters

hotel_id
string
required

Unifystays hotel ID from hotel search or destination autocomplete (bigint as string).

Example:

"123456"

Body

application/json
check_in
string
required

Check-in date in YYYY-MM-DD format. Must be today or a future date.

Example:

"2026-07-01"

check_out
string
required

Check-out date in YYYY-MM-DD format. Must be after check_in.

Example:

"2026-07-04"

residency
string
required

Guest country of residence — ISO alpha-2 code. Used for residency-restricted rates.

Example:

"IN"

rooms
object[]
required

Room configurations — 1 to 8 rooms. Each room specifies adults and optional child ages.

Required array length: 1 - 8 elements
Example:
nationality
string

Guest citizenship/nationality — ISO alpha-2 code. Defaults to residency when omitted.

Example:

"IN"

language
string

Requested response language (for example en).

Example:

"en"

Response

contract_version
string
required
Example:

"1"

success
boolean
required
Example:

true

message
string
required
Example:

"Rooms fetched successfully"

data
object
required