hotels

Poll the result of a booking started with POST /hotels/book

Poll every ~20s. status moves from in_progress to succeeded, failed or attention, all three final. succeeded carries the confirmation and total_price. If the hotel raises the price while booking (more than 0.5%; smaller rises are absorbed), the job stays in_progress with a price_change object {old_total, new_total, extra, currency, expires_at, accept_url, decline_url}: nothing is booked or charged until the guest accepts (they are also e-mailed), and no answer by expires_at fails the job and releases the hold.

get/hotels/booking/{booking_job_id}

Request

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

Path parameters

booking_job_idstring required

booking_job_id returned by POST /hotels/book.

Response

Current booking status, with the confirmation and total_price once succeeded.

booking_job_idstring
booking_idstring
status'in_progress' | 'succeeded' | 'failed' | 'attention'

succeeded: booked and paid; the hold is captured. failed: nothing was booked; the hold is released and nothing was charged. attention: the outcome could not be settled automatically; the hold is kept (nothing charged) while a person checks with the supplier. succeeded, failed and attention are all final: do not book again.

poll_after_secondsinteger

Present while status is in_progress.

confirmationstring

The supplier confirmation. Present when succeeded, and on attention when known.

hotelstring
roomstring
total_pricenumber

Present when succeeded: what the guest is charged, in currency (the captured amount).

currencystring
supplier_paidnumber

What the supplier was paid, in supplier_currency.

supplier_currencystring
payment_statusstring

The supplier-side payment status, e.g. "paid".

refundableboolean
free_cancellation_untilstring nullable
termsobject nullable
errorstring

Present when failed or attention, written for the guest.

Example response

{
  "supplier_currency": "PLN"
}

Changes

No recorded changes to this operation across all 1 revision of this API.