Skip to main content
This guide takes you from portal setup to your first hotel search. After this, continue through the booking flow guides.
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:
  1. Add the credentials for a hotel supplier.
  2. Enable the supplier.
  3. Create a sandbox API key.
Supplier credentials and API keys are managed directly in the portal.

2. Set Your API Key

Use the production base URL and a production API key only when you are ready to send live traffic.

3. Find a Destination

Use the returned 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

The response includes hotel results and a search_id. When pricing_mode is instant, poll for live supplier prices.
Merge 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:
The response returns data.sse_stream_url. Connect to it immediately to receive live supplier options:
Replace the example path with the exact 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.
When rendering a room, use unifystays_room when present; otherwise render provider_room. Keep the option bookable in either case.

6. Prebook the Selected Option

Keep hotel_id from the room request and booking_token from an option on that request’s stream:
Continue when 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:
Persist the returned 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.