The current non-production staging/sandbox environment contains only a limited
set of places and hotels. It is designed for integration testing and is not a
complete production catalogue. Use a destination returned by the environment’s
autocomplete endpoint; a production place or hotel ID may not exist there.
1. Configure the Sandbox
Sign in at unifystays.com, select the Sandbox environment, then:- Add the credentials for a hotel supplier.
- Enable the supplier.
- Create a sandbox API key.
2. Set Your API Key
3. Find a Destination
type and matching ID in the search request: hotel_id for a hotel or place_id for a place. See Destination Autocomplete for complete fields, response details, and caching guidance.
If your preferred destination is not returned, test with another place available in
the environment or contact support to request staging coverage. An empty result
for an unavailable destination does not mean your authentication or request format is
incorrect.
4. Search Hotels
search_id. When pricing_mode is instant, poll for live supplier prices.
data.updated_prices into your visible hotel list using
(hotel_id, supplier_code) as the unique quote key. Each quote includes
supplier_code and supplier_name. The API returns every supplier price and
does not choose which one your UI should display.
5. Continue to Rooms
Pick a hotel from the search response and request room options:data.sse_stream_url. Connect to it immediately to receive
live supplier options:
sse_stream_url returned by your room
request. Every provider_options event contains complete bookable options.
Each option includes:
booking_token: send the selected option’s token to prebook.rooms[].room_allocation_id: identifies each exact room slot, including rooms with no static catalogue mapping.rooms[].provider_room: supplier-room content available for every mapping status, including its name and any supplied images, amenities, bed, and occupancy data.rooms[].unifystays_room: complete mapped Unifystays room snapshot, or null.rooms[].occupancy: the adult and child mix that must be assigned during booking.
unifystays_room when present; otherwise render
provider_room. Keep the option bookable in either case.
6. Prebook the Selected Option
Keephotel_id from the room request and booking_token from an option on that
request’s stream:
data.revalidation.decision is READY_TO_BOOK, or after the
customer explicitly accepts a RECONFIRMATION_REQUIRED result. Keep
data.prebooking_id, data.offer.offer_id, and every room’s
room_allocation_id and occupancy for the immediate booking request.
unifystays_room may be null; booking identity comes from room_allocation_id.
7. Create the Booking
Send every allocation returned by prebook exactly once. Attach the guests for that room and use one persistent idempotency key for the booking attempt:data.booking_id and use it to poll booking status. If a
network retry is needed, resend the identical body with the same
Idempotency-Key.
The requirement IDs above are examples. Always copy the actual IDs from the
accepted prebook offer’s booking_requirements; never construct them.
Continue with the Hotel Booking Flow or open any
endpoint in the API Reference.