curl "$UNIFYSTAYS_BASE_URL/hotels/book/by-idempotency-key" \
-H "x-api-key: $UNIFYSTAYS_API_KEY" \
-H "Idempotency-Key: order-2987349823-booking-1"
{
"contract_version": "1",
"success": true,
"message": "Booking request accepted and is being processed.",
"data": {
"booking_id": "ubk_eGQ0dW9uV1Vi",
"accepted_offer_id": "off_01J...",
"status": "PROCESSING",
"is_terminal": false,
"provider": {
"code": "TBO",
"booking_id": "100055869",
"booking_code": "REZ6A5A81E9",
"hotel_confirmation_number": "HCN-482910",
"hotel_confirmation_status": "Confirmed",
"hotel_confirmation_note": {},
"hotel_contact_phone": {},
"hotel_contact_name": {}
},
"next_poll_after_ms": 5000,
"processing_reason": "SUPPLIER_CONFIRMATION_PENDING",
"action_required": true,
"available_actions": [
"GET_STATUS"
],
"hold_deadline_at": "<string>",
"created_at": "2026-04-15T12:12:11.000Z",
"updated_at": "2026-04-15T12:12:11.000Z",
"review_expires_at": "<string>"
}
}Bookings
Find Booking by Idempotency-Key
Recover a booking whose create response never reached you.
GET
/
hotels
/
book
/
by-idempotency-key
curl "$UNIFYSTAYS_BASE_URL/hotels/book/by-idempotency-key" \
-H "x-api-key: $UNIFYSTAYS_API_KEY" \
-H "Idempotency-Key: order-2987349823-booking-1"
{
"contract_version": "1",
"success": true,
"message": "Booking request accepted and is being processed.",
"data": {
"booking_id": "ubk_eGQ0dW9uV1Vi",
"accepted_offer_id": "off_01J...",
"status": "PROCESSING",
"is_terminal": false,
"provider": {
"code": "TBO",
"booking_id": "100055869",
"booking_code": "REZ6A5A81E9",
"hotel_confirmation_number": "HCN-482910",
"hotel_confirmation_status": "Confirmed",
"hotel_confirmation_note": {},
"hotel_contact_phone": {},
"hotel_contact_name": {}
},
"next_poll_after_ms": 5000,
"processing_reason": "SUPPLIER_CONFIRMATION_PENDING",
"action_required": true,
"available_actions": [
"GET_STATUS"
],
"hold_deadline_at": "<string>",
"created_at": "2026-04-15T12:12:11.000Z",
"updated_at": "2026-04-15T12:12:11.000Z",
"review_expires_at": "<string>"
}
}If a Create Booking call times out, or your
system fails before saving
data.booking_id, look the booking up with the same
Idempotency-Key you sent on the create call. The response has the same shape
as Get Booking Status.
Request Example
curl "$UNIFYSTAYS_BASE_URL/hotels/book/by-idempotency-key" \
-H "x-api-key: $UNIFYSTAYS_API_KEY" \
-H "Idempotency-Key: order-2987349823-booking-1"
Reading the result
- 200: a booking exists for the key. Save
data.booking_idand continue with the normal polling or webhook flow. - 404
BOOKING_NOT_FOUND: no booking was created with the key. Retrying Create Booking with the same key and payload is safe; if the original request is still in flight, the retry returns that same booking instead of creating a second one.
Authorizations
Environment-specific API key created in the Unifystays portal
Headers
The key sent on the original POST /hotels/book.
Hotel API contract version. Missing defaults to v1.
Available options:
1