Skip to content

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

NameValueRequiredDescriptionRestrictions
card_cvcstringConditional*Credit card cvc value3 or 4 digits
card_expirationstringConditional*Credit card expiration dateYYYY-MM format
card_holder_namestringConditional*Credit card holder name
card_numberstringConditional* Credit card numberMust be valid card number
card_typestringConditional*Credit card typeVisa / MasterCard
codestringyesProduct code that have been retrieved from provision response
emailstringConditional*Guest email addressMust be valid email address
formatstringnoType of the data document that is going to be received as a response.Only JSON is currently supported
namestringyesMust be name=1,firstname,lastname,type format (1 refers room number, type can be adult/child)200 Characters, max.
phone_numberstringConditional*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_requeststringnoA free text section where the personal making the hotel reservation can make special requests.255 Characters, max.
agency_ref_idstringno255 Characters, max.
expected_price**floatOptionalexpected_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

json
{
  "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

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.
feeslistList of fees. It contains fee details if it is available.
typestringFee Type. Available types: Resort Fee, Others
amountdecimalFee Amount in related currency(Use fee currency in response)
inclusivebooleanIt shows whether fee amount is included in price or not
detailstringFee details, if it is available
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

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.

Released under the MIT License.