Book
Close the booking with the supplier, using the key from Prebook. The status in the response tells you whether the room is confirmed. A 200 response on its own does not.
Branch on the status
Keep what the guest sees separate from the API status. Show "Confirmed" only for BOOKED. Treat any status not listed here as "needs a person", never as success. More detail in Booking statuses.
If Book times out
A suggested reconciliation sequence. It is a design recommendation, not a documented procedure.
Wait a minute. Your externalReference is already saved.
List today's bookings with GET /booking/bookings. Each entry carries its bookingReference and status.
Read each candidate with getBookings and compare its agencyBookingReference with your externalReference, then the hotel code and dates.
Only if nothing matches, and the key (60 minutes) and token are still valid, call Book again with the same key. Otherwise start again from Quote and tell the guest.
Simulate outcomes with fakeBooking
Add fakeBooking: { "status": "BOOK_ERROR" }, or BOOKED, to the Book request to rehearse an outcome without involving a supplier.
- The response is HTTP
200with the status you asked for, which is one more reason to branch onstatusand never on the HTTP code. ABOOK_ERRORcarriesaccommodation.errorMessage,Booking not confirmed. BOOK_ERROR. - The references are made up for the occasion:
bookingReferencelooks likeFAKE-1043andaccommodation.bookingReferencelikeFAKE-ACCOMMODATION-1043. - Nothing is saved and nothing reaches a supplier, even in production. Booking detail answers
404 Booking reference not foundfor a fake booking, so test post-booking calls on real bookings in your test account.
Testing
- Test suppliers may not behave exactly like real suppliers, so don't assume a test booking closes
BOOKED. Ask your Nava account manager how they respond. - Use fakeBooking to rehearse
BOOK_ERROR, and real test bookings for everything after Book.
Prebook
Send the guests' details and re-validate the offer with the supplier. Prebook returns the combinationKey for Book, so compare its offer with Confirm before you book.
Booking detail
Read a booked hotel from the platform's stored data, without a call to the supplier. Use it to poll bookings that are on request and to read back your own order id.