Book
Overview
This method is the fourth and last step of hotel booking. The method is used to book a product that have made sure available with 'Provision' request. Carry the unique code which has got from Provision response. And also guest information and payment information is used to get. At the end of this method if provision code is not expired and property information is still valid, booking process will be completed.
NOTE: Please don’t forget to add your reference IDs for bookings you will make. You can use agency_ref_id parameter in your booking requests.
Timeout duration: Booking request may take 90 seconds, so client should wait for response.
Request Base Parameters
Name | Value | Required | Description | Restrictions |
---|---|---|---|---|
card_cvc | string | Conditional* | Credit card cvc value | 3 or 4 digits |
card_expiration | string | Conditional* | Credit card expiration date | YYYY-MM format |
card_holder_name | string | Conditional* | Credit card holder name | |
card_number | string | Conditional* Credit card number | Must be valid card number | |
card_type | string | Conditional* | Credit card type | Visa / MasterCard |
code | string | yes | Product code that have been retrieved from provision response | |
string | Conditional* | Guest email address | Must be valid email address | |
format | string | no | Type of the data document that is going to be received as a response. | Only JSON is currently supported |
name | string | yes | Must be name=1,firstname,lastname,type format (1 refers room number, type can be adult/child) | 200 Characters, max. |
phone_number | string | Conditional* | Guest phone number. Phone Numbers must be at least 5 digits long and have at least one different digit (ex:5555555555 is not valid) | |
special_request | string | no | A free text section where the personal making the hotel reservation can make special requests. | 255 Characters, max. |
agency_ref_id | string | no | 255 Characters, max. | |
expected_price** | float | Optional | expected_price should be used in book data request. As long as price changes on book step is under your expected price, booking will be confirmed to you. |
(**) Expected Price: Provision price is 100 EUR and you can cover the booking till 105 EUR. So, you can send expected_price=105 EUR. If in book step, price changes to 105 EUR, booking will be confirmed to you with 105 EUR.
If in book step, price is 110 EUR, booking will failed to you and not confirmed.
- expected_price can not be under provision price.
(*) Conditional: Required for pay_at_hotel payment type.
Example Request Post
POST /api/v2/book/<code>
Request Body
pay_at_hotel type
name&card_cvc&card_expiration&card_holder_name&card_number&card_type&email&phone_number
prepaid
name
expected_price
expected_price
Example Request Body
name=1,John,Doe,adult&expected_price=220.0
###Response Objects Example response for the above booking request is below:
Example Response
POST /api/v2/book/PL77K57A2CLA
{
"code": "B3CJBKKDU43F",
"created_at": "2016-12-09 07:03:03.367699+00:00",
"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
}
],
"fees": [
{
"currency": "EUR",
"amount": "6.00",
"type": "Resort Fee",
"detail": "",
"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": "succeeded",
"confirmation_numbers": [
{
"confirmation_number": "164-3015081",
"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"
}
Response Object Parameters
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. |
fees | list | List of fees. It contains fee details if it is available. |
type | string | Fee Type. Available types: Resort Fee, Others |
amount | decimal | Fee Amount in related currency(Use fee currency in response) |
inclusive | boolean | It shows whether fee amount is included in price or not |
detail | string | Fee details, if it is available |
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 |
Unsaved Condition Recovery
When you send a book request and receive no response due to network problems (timeout issues, losing connection, etc.), you need to use the /api/v2/bookings/<code>
endpoint to double-check the booking result and ensure if the book request is confirmed/completed or not.
Nightly Price Information
DANGER
Nightly price is coming from our partners for only information. Some partners give supplements, fees, taxes, meal price, etc separately not included in the nightly prices and that is why they may not be equal to the total price.
DANGER
Clients should show the total price as final price and nightly price should be only for information.