Skip to main content
POST
Prebook is the final supplier-backed availability and price check before creating a booking. Send only the booking_token from the selected room option; Unifystays resolves supplier-specific booking codes and prebook context server-side.

Request Example

Handle the Result

1

Check availability

Continue only when data.status is AVAILABLE. When it is SOLDOUT, return the customer to live room options.
2

Check the price

Inspect data.price_status and data.pricing. Show any new price or pricing condition to the customer before booking.
3

Keep booking inputs

Store data.unifystays_prebooking_id, the returned rooms and their room_ref values, and any applicable compliance requirements.
4

Create the booking

Send the prebooking ID and room-wise guest details to Create Booking.
The prebook response also includes hotel details, cancellation information, important notes, and compliance requirements. Some suppliers can require additional guest documents for particular stays or nationalities; collect and send those details when the response and booking contract require them.
Prebooking is time-sensitive. Do not defer checkout or reuse a stale prebooking ID. If it expires or the price/availability is no longer acceptable, restart from room options.
The OpenAPI section below provides the exact prebook request, availability and price fields, cancellation data, compliance data, and response schema.

Authorizations

x-api-key
string
header
required

Environment-specific API key created in the Unifystays portal

Headers

Body

application/json
booking_token
string
required

Short signed booking token from rooms API option (booking_token). Provider routing and prebook context are resolved server-side from Postgres context.

Example:

"bq1.Y0QxTmtKc21Wbmk.3.6zI4D6fUEw2jVv7KQdM4Kw"

Response

Universal pre-book response with availability status, price status, pricing breakup, and unifystays_prebooking_id.

status
boolean
required
Example:

true

message
string
required
Example:

"Pre-booking completed. Option is available and ready for booking."

data
object
required