Skip to content

Bookings

This method is also known for 'booking list' and it is for retrieving past booking data.

It has three uses. If you are authorized with a specific consumer, it will get you all the booking data related to that consumer.

Second use is that you can do a request with a specific booking code (or provision code) to retrieve that specific booking data.

You can now search your own booking reference id by using our "/bookings" endpoint. When you make a booking, if you send your own reference in book data like "&agency_ref_id=test1234", you can check the booking details after booking is confirmed like; https://hotel-api.hotelstore.com/api/v2/bookings/?agency_ref_id=test1234

And finally, as it is stated in the "Unsaved Condition Recovery" section, this method should be used to ensure book request status in case of not having a proper booking response.

Request Base Parameters

GET /api/v2/bookings/<code>
NameValueRequiredTypeDescription
codestringNo-This is the code that taken from the response of the bookings request. (Or provision code can be used to make a booking request.)
from_datestringNoQuery stringThis is the booking date for filtering the bookings from the from_date(YYYY-MM-DD).
to_datestringNoQuery stringThis is the booking date for filtering the bookings until the to_date(YYYY-MM-DD).
formatstringNoQuery stringOnly JSON supported
agency_ref_idstringnoThis is the agency_ref_id that was sent in booking request

If code, from_date and to_date parameteres, agency_ref_id are not provided, the result will include the bookings of that day only.

Example Response

GET /api/v2/bookings/B3CJBKKDU43F

or

GET /api/v2/bookings/?agency_ref_id=test1234
json
{
  "code": "B3CJBKKDU43F",
  "created_at": "2016-12-09T07:03:03.367Z",
  "checkin": "2017-01-20",
  "checkout": "2017-01-25",
  "hotel_code": "135f3a",
  "destination_code": "206ec",
  "client_nationality": "gb",
  "pay_at_hotel": false,
  "currency": "EUR",
  "mealtype_code": "RO",
  "nonrefundable": false,
  "view": false,
  "policies": [
    {
      "days_remaining": 44,
      "ratio": "1.00"
    }
  ],
  "taxes": [
    {
      "currency": "EUR", 
      "amount": "6.00", 
      "type": "VAT", 
      "detail": "", 
      "inclusive": true
    }, 
    {
      "currency": "EUR", 
      "amount": "5.00", 
      "type": "City Tax", 
      "detail": "Example data", 
      "inclusive": true
    }
  ],
  "price": "212.38",
  "rooms": [
    {
      "pax": {
        "children_ages": "",
        "adult_quantity": 1
      },
      "room_category": "Shared Facility",
      "room_description": "TWIN WITH SHARED BATHROOM",
      "nightly_prices": {
        "2017-01-20": "42.47",
        "2017-01-21": "42.47",
        "2017-01-22": "42.47",
        "2017-01-23": "42.47",
        "2017-01-24": "42.47"
      },
      "room_type": "SB"
    }
  ],
  "status": "cancelled",
  "confirmation_numbers": [
    {
      "confirmation_number": "164-3015081",
      "agency_ref_id": [
        "test1234"
      ],
      "names": [
        "John Doe"
      ],
      "rooms": [
        {
          "room_description": "TWIN WITH SHARED BATHROOM",
          "room_type": "TWN"
        }
      ]
    }
  ],
  "hotel_payment_info": [
    {
      "hotel_currency": null,
      "hotel_price": null
    }
  ],
  "minimum_selling_price": null,
  "special_request": null,
  "hotel_confirmation_number": "11223344", 
  "hotel_confirmation_number_date": "2018-01-31 20:58:16.429164+00:00",
  "cancellation_price": "0.00"
}
NameValueDescription
codestringbooking code
created_atstringTime of the booking
checkindateobjectIndicates check-in date
checkoutdateobjectIndicates check-out date
pay_at_hotelbooleanInformation of the payment either the customer can pay at the time of arrival to the hotel itself or not
pricedecimalTotal price of the booking
currencystringCurrency code
client_nationalitystringIndicates two letter country code of the client nationality
destination_codestringThe unique code for the destination
hotel_codestringThe unique code for the hotel
mealtype_codestringThe unique code for the meal type
policieslistPolicies list including days_remaining and ratio (GMT+3)
taxeslistList of taxes. It contains tax details if it is available.
typestringTax Type. Available types: VAT, City Tax, Others
amountdecimalTax Amount in related currency(Use tax currency in response)
inclusivebooleanIt shows whether tax amount is included in price or not
detailstringTax details, if it is available
nonrefundablebooleanFlag that determines whether the product can be refunded when cancelled. Some providers are returning us NULL for nonrefundable flag. You may receive NULL for some products.
viewbooleanInformation about if the room has a view.
supports_cancellationbooleanIndicates the product whether can cancel or not over api
statusstringStatus of the booking Possible status list; 'Succeeded', 'Failed', 'Cancelled'
confirmation_numberslistA list dictionaires that has the number of the booking. The names that the booking has been done under and the partner of it.
minimum_selling_pricedecimalIt is the minimum selling price to the end
special_requeststringGiven free format text to inform hotel (remember that, it could be unsent)
hotel_confirmation_numberstringHotel confirmation Number assigned to identify, record, and trace a confirmed booking with Hotelier.
hotel_confirmation_number_datestringTime which taken hotel confirmation number
cancellation_pricedecimalIf the book is cancelled, we return the cancellation cost. Otherwise its NULL.

Released under the MIT License.