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>
Name | Value | Required | Type | Description |
---|---|---|---|---|
code | string | No | - | 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_date | string | No | Query string | This is the booking date for filtering the bookings from the from_date(YYYY-MM-DD). |
to_date | string | No | Query string | This is the booking date for filtering the bookings until the to_date(YYYY-MM-DD). |
format | string | No | Query string | Only JSON supported |
agency_ref_id | string | no | This 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
{
"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"
}
Name | Value | Description |
---|---|---|
code | string | booking code |
created_at | string | Time of the booking |
checkin | dateobject | Indicates check-in date |
checkout | dateobject | Indicates check-out date |
pay_at_hotel | boolean | Information of the payment either the customer can pay at the time of arrival to the hotel itself or not |
price | decimal | Total price of the booking |
currency | string | Currency code |
client_nationality | string | Indicates two letter country code of the client nationality |
destination_code | string | The unique code for the destination |
hotel_code | string | The unique code for the hotel |
mealtype_code | string | The unique code for the meal type |
policies | list | Policies list including days_remaining and ratio (GMT+3) |
taxes | list | List of taxes. It contains tax details if it is available. |
type | string | Tax Type. Available types: VAT, City Tax, Others |
amount | decimal | Tax Amount in related currency(Use tax currency in response) |
inclusive | boolean | It shows whether tax amount is included in price or not |
detail | string | Tax details, if it is available |
nonrefundable | boolean | Flag 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. |
view | boolean | Information about if the room has a view. |
supports_cancellation | boolean | Indicates the product whether can cancel or not over api |
status | string | Status of the booking Possible status list; 'Succeeded', 'Failed', 'Cancelled' |
confirmation_numbers | list | A 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_price | decimal | It is the minimum selling price to the end |
special_request | string | Given free format text to inform hotel (remember that, it could be unsent) |
hotel_confirmation_number | string | Hotel confirmation Number assigned to identify, record, and trace a confirmed booking with Hotelier. |
hotel_confirmation_number_date | string | Time which taken hotel confirmation number |
cancellation_price | decimal | If the book is cancelled, we return the cancellation cost. Otherwise its NULL. |