Hotels

Start a hotel booking (asynchronous)

Changed on

Returns a booking_job_id, not a booking. The full price is held on the connected card (not taken), LetsFG books the room and pays the supplier, and the hold is captured only once the hotel confirms. A failed booking releases the hold. There is no reservation fee, no deposit and no pay link.

A real booking takes minutes. Poll GET /api/v1/hotels/booking/{booking_job_id} until status is succeeded, failed or attention.

Send expected_price, expected_cost, currency and fx_rate back exactly as the chosen offer returned them. currency defaults to PLN here, so a USD offer sent without it is refused. The booking is also refused if the supplier's price has moved, so a guest is never charged a price they did not agree to.

Guest names, phone and e-mail are checked before anything is held. Never call this again while its job is running — poll it; a retry with the same idempotency_key returns the existing job (duplicate: true) instead of booking twice.

post/api/v1/hotels/book

Request

  • Base URL: https://letsfg.co/developers/api/v1
  • URL: https://letsfg.co/developers/api/v1/api/v1/hotels/book
  • Auth: API key in header X-API-Key

Request body

session_idstring required
hotel_codeinteger required
combination_id_v2string required

Identifies the exact rate. Room name alone is ambiguous.

combination_idinteger
expected_pricenumber required

The offer's price, verbatim.

expected_costnumber required

The offer's expected_cost, verbatim (the supplier's own figure, PLN).

currencystring

The offer's currency, verbatim. A non-PLN offer sent without it is refused.

fx_ratenumber nullable

The offer's fx_rate, verbatim.

hotel_namestring
city_idinteger required
city_namestring required
check_instring date required
check_outstring date required
adultsinteger
emailstring required

The confirmation, and any message about the booking, go here. A typo loses the booking.

phonestring required
phone_country_codestring
special_requestsstring[]
idempotency_keystring

The same key on a retry returns the booking it already opened.

Example request

{
  "guests": [
    {
      "title": "Mr"
    }
  ]
}

Response

Booking started — poll the returned booking_job_id

Changes

    • breaking

      added the new required request property

    • warning

      removed the request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the non-success response with the status

    • info

      endpoint added