loading
Book your holiday
select destination from list type using auto-suggest
search by hotel name do not search hotel name
Choose a Date
Choose a Date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Holiday Offers Email

Sign up to receive our best holiday
deals delivered to your inbox FREE!

API Documentation

 Guest Hotels XML

Booking System API Documentation

API Overview

The Guest Hotels API allows you to search for, and book, flights and hotels globally quickly and easily.

All requests to the API must be authenticated using HTTP Basic Authentication.

The API may be run in test mode by adding the following parameter onto your requests

mode: test

In test mode the booking will be run through as though it is a full booking, emails will be sent out, but no flight or hotel booking will be completed.

POST requests can either be made using standard form encoding or JSON key value pairs.

The API is broken down into two sections.  The first section relates to information gathering and data that you will need to make search and booking requests.  The second section relates to the end points required to search and make bookings.  All requests to booking end points will contain the following in the response:

session_token: The unique session identifier to be used in every request and set in the  X_SESSION_TOKEN header

result: boolean reperesenting the success or failure of the requested action

errors: an array of error messages on request failure

mode: ‘test’ or ‘production’ to indicate if the API is running in test mode where no booking will be made.

Section 1:  Information End Points

There are four information end points.  The information gathered from these locations is used when making hotel bookings.  Flight bookings require only the 3 digit airport code so this information is not required.

URL:api/resort

Method:  GET

Returns:  a JSON array of all resorts and resort Ids supported by our system and used in searches.  Searches will take place on all children of the selected resort as well as the selected resort itself.

Example:

{“ID”:”1″,”ParentID”:”16357″,”CountryID”:”184″,”Name”:”USA”}

URL: /api/countries

Method:  GET

Returns:  a JSON array of all countries supported by our system and used in searches

Example:

{“ID”:”1″,”Name”:”Afghanistan”,”FormalName”:”Islamic State of Afghanistan”,”Capital”:”Kabul”,”ISO31662Code”:”AF”,”ISO31663Code”:”AFG”,”ISO3166Number”:”4″}

URL: /api/board_types

Method:  GET

Returns:  a JSON array of all board types supported in searches on the system.

Example:

{“Name”:”All Inclusive”,”Code”:”AI”}

URL: /api/hotel_info/{accommodation_code}

Method:  GET

Returns:  An object with both info and image attributes.  The info attribute is a series of key (title), value (text) elements.  The image attribute contains an array of objects each with a url attribute and an alt text attribute.

Important: Hotel info requires a header of X_SESSION_TOKEN to be set matching a session id returned in search results

Params:

accommodation_code:  The accommodation code as per information returned in search results

URL: /api/salutations

Method:  GET

Returns:  a JSON array of all valid salutations for passengers when added to the basket

Example:

{“ID”:”1″,”Name”:”Mr”,”Adult”:”True”,”Child”:”False”,”Infant”:”False”}

Section 2:  Booking End Points

There are four booking end points that must be accessed in sequence to make a booking.

First of all a search must be made, then availability is checked.  Items are then added to a basket including passenger details and any optional extras or room / board type changes.  Once a basket is confirmed the booking can be made.

The end point in sequence are

/api/search:  Make a search on our system

/api/availability:  Confirmed costing and provides a list of all available optional extras or room / board type options

/api/basket:  Confirm passenger details, optional extras and room / board type.

/api/book:  Confirm the booking of the basket

Section 2.1:  Search

URL: /api/search

Parameters (apply to all search types):

currency (optional):  Three digit currency code (USD, EUR, GBP)

search_type (required):  ‘flight’ or ‘hotel’

Section 2.1.1:  Search flight

Parameters (as per 2.1 and also):

departure_date (required):  Departure date in YYYY-MM-DD format

return_depature_date (optional):  Return departure date in YYYY-MM-DD format

flexibility (optional):  Number of days before or after the departure date to include in the search

direct_flight (optional):  Set this to a value of ‘on’ to only search for flights with a single leg

departure_airport (required): Three letter airport code

destination_airport (required): Three letter airport code

adults (required):  Number of adults on the booking

children (required):  Number of children on the booking

infants (required):  Number of infants on the booking

child_age (conditional): An array of children and their ages.  Eg {“child_age”: { “1”: “12”, “2”:”8″}}

infant_age (conditional): An array of infants and their ages.  Eg {“infant_age”: { “1”: “0”}}

Response:

The response to a flight search will be a JSON array with each element containing the following:

session_token: Unique session token for these search results.  Used in all subsequent requests and passed using the X_SESSION_TOKEN http header.

result: Boolean indicating whether the search has been successful or not

errors: An array of errors – if any are present.

results:  an object containing:

flights: an array of objects containing:

id: The unique id that identifies this flight in this session

airline_logo: Url for airline logo

out_airline_logo: Url for outbound airline logo

ret_airline_logo: Url for return airline logo

duration: Days between outbound and return flights

total_price_pp: Total price divided by each passenger

total_price: Total price for all passengers

one_way: Boolean value representing if this is a one way flight

currency: 3 digit currency code

carrier: Carrier Code

outbound_flight_code: Outbound flight code

return_flight_code: Return flight code (not applicable for one way flights)

outbound_carrier:  Outbound flight carrier code

return_carrier: Return flight carrier code

outbound_airline: Outbound flight airline name

return_airline: Return flight airline name

outbound_cabin_class: Outbound flight cabin class

return_cabin_class: Return flight cabin class

departure_airport: Departure Airport name

departure_airport_code: Departure Airport 3 digit code

destination_airport: Destination Airport name

destination_airport_code: Destination Airport 3 digit code

depart_time: Outbound flight departure time in YYYY-MM-DD HH:MM format

arrive_time: Outbound flight arrival time in YYYY-MM-DD HH:MM format

return_depart_time: Return flight departure time in YYYY-MM-DD HH:MM format

return_arrive_time: Return flight arrival time in YYYY-MM-DD HH:MM format

flights:

An array containing two child arrays ‘outbound’ and ‘return’.  Each of these child arrays contain an array of flights that make up that section.  Each section contains the following information:

departure_airport: Departure Airport name

departure_airport_code: Departure Airport 3 digit code

destination_airport: Destination Airport name

destination_airport_code: Destination Airport 3 digit code

depart_time: Flight departure time in YYYY-MM-DD HH:MM format

arrive_time: Flight arrival time in YYYY-MM-DD HH:MM format

operator: Operator name

code: Flight code

Section 2.1.2:  Search hotel

Parameters (as per 2.1 and also):

start_date (required):  Booking start date in YYYY-MM-DD format

end_date (required):  Booking  end date in YYYY-MM-DD format

board (optional):  Board code (see board types end point above) or empty for all

destination_id (required):  Resort ID (see resorts end point above) or Hotel ID from hotels excel file

no_rooms (required):  Number of rooms the booking is for

room (required):  An array of room occupanices to match the above number of rooms.  Each room entry must include the number of adults, children and infants in the room along with their ages. 

Example:

A booking with 1 room containing 2 adults, 2 children and 1 infant would look like this

{“room”: { “1”: {“adults”:”2″,”children”:”2″,”infants”:”1″,”child_age”: { “1”: “12”, “2”:”8″},”infant_age”: { “1”: “0”}}}}

Response:

The response to a hotel search will be a JSON object containing the following:

session_token: Unique session token for these search results.  Used in all subsequent requests and passed using the X_SESSION_TOKEN http header.

result: Boolean indicating whether the search has been successful or not

errors: An array of errors – if any are present.

results:  an object containing:

hotels: an array of objects containing:

id: The unique id that identifies this hotel in this session

accommodation_code: The unique identifier for this accommodation

selected_board_code: Selected board code (options may be available at availability)

selected_board_name: Selected board name (options may be available at availability)

name: Hotel name

resort: Resort name

resort_id: Resort id

description: Description of this hotel

currency: 3 digit currency code

class_code: Hotel class code

hotel_type: Hotel or Villa

star_rating: Star rating of this hotel

image_url: Sample information for this hotel (more information can be obtained from /api/hotel_infousing the provided id

image_caption: Caption to go with the provided image

check_in: Check in date in YYYY-MM-DD format

check_out: Check out date in YYYY-MM-DD format

location: Hotel geographic location

address: Hotel address

price: Total price with selected options (options can be changed later in the process )

Section 2.2: Availability

URL: /api/availability

Note:  A request to the basket endpoint must be accompanied by an X_SESSION_TOKEN http header containing the relevant session id.

Parameters:

id:  The itininerary id as per information returned in search results

Response:

The response to a hotel availability lookup will be a JSON array with the following structure:

session_token: Unique session token for these search results.  Used in all subsequent requests and passed using the X_SESSION_TOKEN http header.

result: Boolean indicating whether the lookup has been successful or not

errors: An array of errors – if any are present.

itinerary:  The itinerary object will be different depending on whether you are looking up a hotel or flights.  Please see the relevant section below for your itinerary type.

Section 2.1.1:  Flight availability itinerary

A flight availability itinerary JSON response will contain:

airline_logo: Url for airline logo

duration: Days between outbound and return flights

total_price_pp: Total price divided by each passenger

total_price: Total price for all passengers

currency: 3 digit currency code

carrier: Carrier Code

outbound_cabin_class: Outbound flight cabin class

return_cabin_class: Return flight cabin class

departure_airport_code: Departure Airport 3 digit code

destination_airport_code: Destination Airport 3 digit code

depart_time: Outbound flight departure time in Y-m-d H:i format

arrive_time: Outbound flight arrival time in Y-m-d H:i format

return_depart_time: Return flight departure time in Y-m-d H:i format

return_arrive_time: Return flight arrival time in Y-m-d H:i format

flights:

An array containing two child arrays ‘outbound’ and ‘return’.  Each of these child arrays contain an array of flights that make up that section.  Each section contains the following information:

departure_airport: Departure Airport name

departure_airport_code: Departure Airport 3 digit code

destination_airport: Destination Airport name

destination_airport_code: Destination Airport 3 digit code

depart_time: Flight departure time in Y-m-d H:i format

arrive_time: Flight arrival time in Y-m-d H:i format

operator: Operator name

code: Flight code

errata: An array of errata from the airline with each array element being an object with a text and a title attribute

flight_options: An array of available options that can be selected in the basket.  The option code is the array index and the value is an object containing information about the selected extra:

description:  Readable description of the optional

option: type:  extra or supplement

type:  A description of the type of optional extra this is (ie baggage)

quantity: The maximum number of the item that can be booked

applyto:  One of:  SelectedPax (one or more can be added per passenger), NoPax (does not relate to passengers), AllPax (applies to all passengers)

unit_price:  Price per unit

reference:  The reference code to use when selecting this extra at the basket stage

Section 2.1.2:  Hotel availability itinerary

A hotel availability itinerary JSON response will contain:

name: Hotel name

price: Total price with selected options (options can be changed later in the process)

selected_board_code: Selected board code that the current price is based on

selected_board_name: Selected board name

selected_rooms: An array with the room number as the index and the currently selected room code as the value

board_options: an array of available board options for this booking.  Used to select a board type whilst adding to the basket.  The board code is the selected array index and the value is an object containing the board type name and the price adjustment if this board type is selected.

Example:

{“board_options”:{“AI”:{“name”:”All Inclusive”,”adjustment”:”0.00″},”FB”:{“name”:”Full Board”,”adjustment”:-85.43}}}

room_options: an array of available room types for this booking.  Used to select a room type whilst adding to the basket.  The room code is the selected array index and the value is an object containing the room type name and the price adjustment if this room type is selected.

Example:

{“room_options”:{“1”:{“1:2:0:DBT-E10:ST”:{“name”:”Double or Twin STANDARD”,”adjustment”:”0.00″}},”2″:{“1:1:1:DBT-E10:ST”:{“name”:”Double or Twin STANDARD”,”adjustment”:”0.00″}}}

Section 2.3: Basket

URL: /api/basket

Note:  A request to the basket endpoint must be accompanied by an X_SESSION_TOKEN http header containing the relevant session id.

A request to the basket will add the items from the previous availability search into the basket.  This will also retyurned confirmed costing for the items

Parameters:

pax: An array of passenger details for the booking in the following format

pax[type (adults, children or infants)][Pax Index] [Salutation] = Valid salutation

pax[type (adults, children or infants)][Pax Index] [Forename] = PAX forename

pax[type (adults, children or infants)][Pax Index] [Surname] = PAX surname

pax[type (adults, children or infants)][Pax Index] [DateOfBirth] = PAX DOB in YYYY-MM-DD

pax[type (adults, children or infants)][Pax Index] [NationalityID] = Valid Country ID

pax[type (adults, children or infants)][Pax Index] [Gender] = Male or Female

For the lead passenger on the booking the following is also required:

pax[type (adults, children or infants)][Pax Index] [Email] = PAX Email Address

pax[type (adults, children or infants)][Pax Index] [Telephone] = PAX Phone Number

example:

{“pax”:{“adults”:{“1”:{“Salutation”:”Mr”,”Forename”:”Test”,”Surname”:”Adult Male”,”DateOfBirth”:”1973-01-01″,”NationalityID”:”183″,”Gender”:”Male”,”Email”:”test@email.com”,”Telephone”:”01234 567890″},”2″:{“Salutation”:”Mrs”,”Forename”:”Test”,”Surname”:”Adult Female”,”DateOfBirth”:”1973-01-01″,”NationalityID”:”183″,”Gender”:”Female”}},”children”:{“1”:{“Salutation”:”Mstr”,”Forename”:”Test”,”Surname”:”Child Male”,”DateOfBirth”:”2012-01-01″,”NationalityID”:”183″,”Gender”:”Male”}}}}

For Hotel Bookings:

The following items are optional and will adjust the price of the booking if selected.

board_code (optional): A board code from the board_options array returned from the availability request.

room_options (optional): An array of room to room option type mappings taken from the room_options array from the availability request.

For Flight Bookings:

The following items are optional and will adjust the price of the booking if selected.

flight_options (optional): An array of flight option selections with each array element being an object containing the following:

reference: Reference taken from the ininerary

quantity:  The number of the options to add.

Response:

The response to a basket request will be a JSON object containing the following:

session_token: Unique session token for these search results.  Used in all subsequent requests and passed using the X_SESSION_TOKEN http header.

result: Boolean indicating whether the lookup has been successful or not

errors: An array of errors – if any are present.

itinerary:  The itinerary object will be different depending on whether you are looking up a hotel or flights.  Please see the relevant section below for your itinerary type.

Section 2.3.1:  Flight basket itinerary

A flight basket itinerary JSON response will contain:

airline_logo: Url for airline logo

duration: Days between outbound and return flights

total_price_pp: Total price divided by each passenger

total_price: Total price for all passengers

currency: 3 digit currency code

carrier: Carrier Code

outbound_cabin_class: Outbound flight cabin class

return_cabin_class: Return flight cabin class

departure_airport_code: Departure Airport 3 digit code

destination_airport_code: Destination Airport 3 digit code

depart_time: Outbound flight departure time in Y-m-d H:i format

arrive_time: Outbound flight arrival time in Y-m-d H:i format

return_depart_time: Return flight departure time in Y-m-d H:i format

return_arrive_time: Return flight arrival time in Y-m-d H:i format

flights:

An array containing two child arrays ‘outbound’ and ‘return’.  Each of these child arrays contain an array of flights that make up that section.  Each section contains the following information:

departure_airport: Departure Airport name

departure_airport_code: Departure Airport 3 digit code

destination_airport: Destination Airport name

destination_airport_code: Destination Airport 3 digit code

depart_time: Flight departure time in Y-m-d H:i format

arrive_time: Flight arrival time in Y-m-d H:i format

operator: Operator name

code: Flight code

errata: An array of errata from the airline with each array element being an object with a text and a title attribute

Section 2.3.2:  Hotel basket itinerary

A hotel basket itinerary JSON response will contain:

name: Hotel name

price: Total price with selected options

selected_board_code: Selected board code that the current price is based on

selected_board_name: Selected board name

selected_rooms: An array with the room number as the index and the currently selected room code as the value

Section 2.4: Book

URL: /api/book

Note:  A request to the basket endpoint must be accompanied by an X_SESSION_TOKEN http header containing the relevant session id.

A call to the book endpoint will book the basket associated with this session and created in the /basket request

Response:

The response to a booking request will be a JSON object containing the following:

session_token: Unique session token.  Used in all requests and passed using the X_SESSION_TOKEN http header.

result: Boolean indicating whether the booking has been successful or not

reference: The booking reference

ls Group

Booking System API Documentation

API Overview

The Guest Hotels API allows you to search for, and book, flights and hotels globally quickly and easily.

All requests to the API must be authenticated using HTTP Basic Authentication.

The API may be run in test mode by adding the following parameter onto your requests

mode: test

In test mode the booking will be run through as though it is a full booking, emails will be sent out, but no flight or hotel booking will be completed.

POST requests can either be made using standard form encoding or JSON key value pairs.

The API is broken down into two sections.  The first section relates to information gathering and data that you will need to make search and booking requests.  The second section relates to the end points required to search and make bookings.  All requests to booking end points will contain the following in the response:

session_token: The unique session identifier to be used in every request and set in the  X_SESSION_TOKEN header

result: boolean reperesenting the success or failure of the requested action

errors: an array of error messages on request failure

mode: ‘test’ or ‘production’ to indicate if the API is running in test mode where no booking will be made.

Section 1:  Information End Points

There are four information end points.  The information gathered from these locations is used when making hotel bookings.  Flight bookings required only the 3 digit airport code so this information is not required.

URL: /api/resorts

Method:  GET

Returns:  a JSON array of all resorts and resort Ids supported by our system and used in searches.  Searches will take place on all children of the selected resort as well as the selected resort itself.

Example:

{“ID”:”1″,”ParentID”:”16357″,”CountryID”:”184″,”Name”:”USA”}

URL: /api/countries

Method:  GET

Returns:  a JSON array of all countries supported by our system and used in searches

Example:

{“ID”:”1″,”Name”:”Afghanistan”,”FormalName”:”Islamic State of Afghanistan”,”Capital”:”Kabul”,”ISO31662Code”:”AF”,”ISO31663Code”:”AFG”,”ISO3166Number”:”4″}

URL: /api/board_types

Method:  GET

Returns:  a JSON array of all board types supported in searches on the system.

Example:

{“Name”:”All Inclusive”,”Code”:”AI”}

URL: /api/hotel_info/{accommodation_code}

Method:  GET

Returns:  An object with both info and image attributes.  The info attribute is a series of key (title), value (text) elements.  The image attribute contains an array of objects each with a url attribute and an alt text attribute.

Important: Hotel info requires a header of X_SESSION_TOKEN to be set matching a session id returned in search results

Params:

accommodation_code:  The accommodation code as per information returned in search results

URL: /api/salutations

Method:  GET

Returns: a JSON array of all valid salutations for passengers when added to the basket.

Example:

{“ID”:”1″,”Name”:”Mr”,”Adult”:”True”,”Child”:”False”,”Infant”:”False”}

Section 2:  Booking End Points

There are four booking end points that must be accessed in sequence to make a booking.

First of all a search must be made, then availability is checked.  Items are then added to a basket including passenger details and any optional extras or room / board type changes.  Once a basket is confirmed the booking can be made.

The end point in sequence are

/api/search:  Make a search on our system

/api/availability:  Confirmed costing and provides a list of all available optional extras or room / board type options

/api/basket:  Confirm passenger details, optional extras and room / board type.

/api/book:  Confirm the booking of the basket

Section 2.1:  Search

URL: /api/search

Parameters (apply to all search types):

currency (optional):  Three digit currency code (USD, EUR, GBP)

search_type (required):  ‘flight’ or ‘hotel’

Section 2.1.1:  Search flight

Parameters (as per 2.1 and also):

departure_date (required):  Departure date in YYYY-MM-DD format

return_depature_date (optional):  Return departure date in YYYY-MM-DD format

flexibility (optional):  Number of days before or after the departure date to include in the search

direct_flight (optional):  Set this to a value of ‘on’ to only search for flights with a single leg

departure_airport (required): Three letter airport code

destination_airport (required): Three letter airport code

adults (required):  Number of adults on the booking

children (required):  Number of children on the booking

infants (required):  Number of infants on the booking

child_age (conditional): An array of children and their ages.  Eg {“child_age”: { “1”: “12”, “2”:”8″}}

infant_age (conditional): An array of infants and their ages.  Eg {“infant_age”: { “1”: “0”}}

Response:

The response to a flight search will be a JSON array with each element containing the following:

session_token: Unique session token for these search results.  Used in all subsequent requests and passed using the X_SESSION_TOKEN http header.

result: Boolean indicating whether the search has been successful or not

errors: An array of errors – if any are present.

results:  an object containing:

flights: an array of objects containing:

id: The unique id that identifies this flight in this session

airline_logo: Url for airline logo

out_airline_logo: Url for outbound airline logo

ret_airline_logo: Url for return airline logo

duration: Days between outbound and return flights

total_price_pp: Total price divided by each passenger

total_price: Total price for all passengers

one_way: Boolean value representing if this is a one way flight

currency: 3 digit currency code

carrier: Carrier Code

outbound_flight_code: Outbound flight code

return_flight_code: Return flight code (not applicable for one way flights)

outbound_carrier:  Outbound flight carrier code

return_carrier: Return flight carrier code

outbound_airline: Outbound flight airline name

return_airline: Return flight airline name

outbound_cabin_class: Outbound flight cabin class

return_cabin_class: Return flight cabin class

departure_airport: Departure Airport name

departure_airport_code: Departure Airport 3 digit code

destination_airport: Destination Airport name

destination_airport_code: Destination Airport 3 digit code

depart_time: Outbound flight departure time in YYYY-MM-DD HH:MM format

arrive_time: Outbound flight arrival time in YYYY-MM-DD HH:MM format

return_depart_time: Return flight departure time in YYYY-MM-DD HH:MM format

return_arrive_time: Return flight arrival time in YYYY-MM-DD HH:MM format

flights:

An array containing two child arrays ‘outbound’ and ‘return’.  Each of these child arrays contain an array of flights that make up that section.  Each section contains the following information:

departure_airport: Departure Airport name

departure_airport_code: Departure Airport 3 digit code

destination_airport: Destination Airport name

destination_airport_code: Destination Airport 3 digit code

depart_time: Flight departure time in YYYY-MM-DD HH:MM format

arrive_time: Flight arrival time in YYYY-MM-DD HH:MM format

operator: Operator name

code: Flight code

Section 2.1.2:  Search hotel

Parameters (as per 2.1 and also):

start_date (required):  Booking start date in YYYY-MM-DD format

end_date (required):  Booking  end date in YYYY-MM-DD format

board (optional):  Board code (see board types end point above) or empty for all

destination_id (required):  Resort ID (see resorts end point above) or Hotel ID from hotels excel file

no_rooms (required):  Number of rooms the booking is for

room (required):  An array of room occupanices to match the above number of rooms.  Each room entry must include the number of adults, children and infants in the room along with their ages. 

Example:

A booking with 1 room containing 2 adults, 2 children and 1 infant would look like this

{“room”: { “1”: {“adults”:”2″,”children”:”2″,”infants”:”1″,”child_age”: { “1”: “12”, “2”:”8″},”infant_age”: { “1”: “0”}}}}

Response:

The response to a hotel search will be a JSON object containing the following:

session_token: Unique session token for these search results.  Used in all subsequent requests and passed using the X_SESSION_TOKEN http header.

result: Boolean indicating whether the search has been successful or not

errors: An array of errors – if any are present.

results:  an object containing:

hotels: an array of objects containing:

id: The unique id that identifies this hotel in this session

accommodation_code: The unique identifier for this accommodation

selected_board_code: Selected board code (options may be available at availability)

selected_board_name: Selected board name (options may be available at availability)

name: Hotel name

resort: Resort name

resort_id: Resort id

description: Description of this hotel

currency: 3 digit currency code

class_code: Hotel class code

hotel_type: Hotel or Villa

star_rating: Star rating of this hotel

image_url: Sample information for this hotel (more information can be obtained from /api/hotel_infousing the provided id

image_caption: Caption to go with the provided image

check_in: Check in date in YYYY-MM-DD format

check_out: Check out date in YYYY-MM-DD format

location: Hotel geographic location

address: Hotel address

price: Total price with selected options (options can be changed later in the process

Section 2.2: Availability

URL: /api/availability

Note:  A request to the basket endpoint must be accompanied by an X_SESSION_TOKEN http header containing the relevant session id.

Parameters:

id:  The itininerary id as per information returned in search results

Response:

The response to a hotel availability lookup will be a JSON array with the following structure:

session_token: Unique session token for these search results.  Used in all subsequent requests and passed using the X_SESSION_TOKEN http header.

result: Boolean indicating whether the lookup has been successful or not

errors: An array of errors – if any are present.

itinerary:  The itinerary object will be different depending on whether you are looking up a hotel or flights.  Please see the relevant section below for your itinerary type.

Section 2.1.1:  Flight availability itinerary

A flight availability itinerary JSON response will contain:

airline_logo: Url for airline logo

duration: Days between outbound and return flights

total_price_pp: Total price divided by each passenger

total_price: Total price for all passengers

currency: 3 digit currency code

carrier: Carrier Code

outbound_cabin_class: Outbound flight cabin class

return_cabin_class: Return flight cabin class

departure_airport_code: Departure Airport 3 digit code

destination_airport_code: Destination Airport 3 digit code

depart_time: Outbound flight departure time in Y-m-d H:i format

arrive_time: Outbound flight arrival time in Y-m-d H:i format

return_depart_time: Return flight departure time in Y-m-d H:i format

return_arrive_time: Return flight arrival time in Y-m-d H:i format

flights:

An array containing two child arrays ‘outbound’ and ‘return’.  Each of these child arrays contain an array of flights that make up that section.  Each section contains the following information:

departure_airport: Departure Airport name

departure_airport_code: Departure Airport 3 digit code

destination_airport: Destination Airport name

destination_airport_code: Destination Airport 3 digit code

depart_time: Flight departure time in Y-m-d H:i format

arrive_time: Flight arrival time in Y-m-d H:i format

operator: Operator name

code: Flight code

errata: An array of errata from the airline with each array element being an object with a text and a title attribute

flight_options: An array of available options that can be selected in the basket.  The option code is the array index and the value is an object containing information about the selected extra:

description:  Readable description of the optional

option: type:  extra or supplement

type:  A description of the type of optional extra this is (ie baggage)

quantity: The maximum number of the item that can be booked

applyto:  One of:  SelectedPax (one or more can be added per passenger), NoPax (does not relate to passengers), AllPax (applies to all passengers)

unit_price:  Price per unit

reference:  The reference code to use when selecting this extra at the basket stage

Section 2.1.2:  Hotel availability itinerary

A hotel availability itinerary JSON response will contain:

name: Hotel name

price: Total price with selected options (options can be changed later in the process)

selected_board_code: Selected board code that the current price is based on

selected_board_name: Selected board name

selected_rooms: An array with the room number as the index and the currently selected room code as the value

board_options: an array of available board options for this booking.  Used to select a board type whilst adding to the basket.  The board code is the selected array index and the value is an object containing the board type name and the price adjustment if this board type is selected.

Example:

{“board_options”:{“AI”:{“name”:”All Inclusive”,”adjustment”:”0.00″},”FB”:{“name”:”Full Board”,”adjustment”:-85.43}}}

room_options: an array of available room types for this booking.  Used to select a room type whilst adding to the basket.  The room code is the selected array index and the value is an object containing the room type name and the price adjustment if this room type is selected.

Example:

{“room_options”:{“1”:{“1:2:0:DBT-E10:ST”:{“name”:”Double or Twin STANDARD”,”adjustment”:”0.00″}},”2″:{“1:1:1:DBT-E10:ST”:{“name”:”Double or Twin STANDARD”,”adjustment”:”0.00″}}}

Section 2.3: Basket

URL: /api/basket

Note:  A request to the basket endpoint must be accompanied by an X_SESSION_TOKEN http header containing the relevant session id.

A request to the basket will add the items from the previous availability search into the basket.  This will also retyurned confirmed costing for the items

Parameters:

pax: An array of passenger details for the booking in the following format

pax[type (adults, children or infants)][Pax Index] [Salutation] = Valid salutation

pax[type (adults, children or infants)][Pax Index] [Forename] = PAX forename

pax[type (adults, children or infants)][Pax Index] [Surname] = PAX surname

pax[type (adults, children or infants)][Pax Index] [DateOfBirth] = PAX DOB in YYYY-MM-DD

pax[type (adults, children or infants)][Pax Index] [NationalityID] = Valid Country ID

pax[type (adults, children or infants)][Pax Index] [Gender] = Male or Female

For the lead passenger on the booking the following is also required:

pax[type (adults, children or infants)][Pax Index] [Email] = PAX Email Address

pax[type (adults, children or infants)][Pax Index] [Telephone] = PAX Phone Number

example:

{“pax”:{“adults”:{“1”:{“Salutation”:”Mr”,”Forename”:”Test”,”Surname”:”Adult Male”,”DateOfBirth”:”1973-01-01″,”NationalityID”:”183″,”Gender”:”Male”,”Email”:”test@email.com”,”Telephone”:”01234 567890″},”2″:{“Salutation”:”Mrs”,”Forename”:”Test”,”Surname”:”Adult Female”,”DateOfBirth”:”1973-01-01″,”NationalityID”:”183″,”Gender”:”Female”}},”children”:{“1”:{“Salutation”:”Mstr”,”Forename”:”Test”,”Surname”:”Child Male”,”DateOfBirth”:”2012-01-01″,”NationalityID”:”183″,”Gender”:”Male”}}}}

For Hotel Bookings:

The following items are optional and will adjust the price of the booking if selected.

board_code (optional): A board code from the board_options array returned from the availability request.

room_options (optional): An array of room to room option type mappings taken from the room_options array from the availability request.

For Flight Bookings:

The following items are optional and will adjust the price of the booking if selected.

flight_options (optional): An array of flight option selections with each array element being an object containing the following:

reference: Reference taken from the itinerary

quantity: The number of the options to add.

Response:

The response to a basket request will be a JSON object containing the following:

session_token: Unique session token for these search results.  Used in all subsequent requests and passed using the X_SESSION_TOKEN http header.

result: Boolean indicating whether the lookup has been successful or not

errors: An array of errors – if any are present.

itinerary:  The itinerary object will be different depending on whether you are looking up a hotel or flights.  Please see the relevant section below for your itinerary type.

Section 2.3.1:  Flight basket itinerary

A flight basket itinerary JSON response will contain:

airline_logo: Url for airline logo

duration: Days between outbound and return flights

total_price_pp: Total price divided by each passenger

total_price: Total price for all passengers

currency: 3 digit currency code

carrier: Carrier Code

outbound_cabin_class: Outbound flight cabin class

return_cabin_class: Return flight cabin class

departure_airport_code: Departure Airport 3 digit code

destination_airport_code: Destination Airport 3 digit code

depart_time: Outbound flight departure time in Y-m-d H:i format

arrive_time: Outbound flight arrival time in Y-m-d H:i format

return_depart_time: Return flight departure time in Y-m-d H:i format

return_arrive_time: Return flight arrival time in Y-m-d H:i format

flights:

An array containing two child arrays ‘outbound’ and ‘return’.  Each of these child arrays contain an array of flights that make up that section.  Each section contains the following information:

departure_airport: Departure Airport name

departure_airport_code: Departure Airport 3 digit code

destination_airport: Destination Airport name

destination_airport_code: Destination Airport 3 digit code

depart_time: Flight departure time in Y-m-d H:i format

arrive_time: Flight arrival time in Y-m-d H:i format

operator: Operator name

code: Flight code

errata: An array of errata from the airline with each array element being an object with a text and and a title attribute

Section 2.3.2:  Hotel basket itinerary

A hotel basket itinerary JSON response will contain:

name: Hotel name

price: Total price with selected options

selected_board_code: Selected board code that the current price is based on

selected_board_name: Selected board name

selected_rooms: An array with the room number as the index and the currently selected room code as the value

Section 2.4: Book

URL: /api/book

Note:  A request to the basket endpoint must be accompanied by an X_SESSION_TOKEN http header containing the relevant session id.

A call to the book endpoint will book the basket associated with this session and created in the /basket request

Response:

The response to a booking request will be a JSON object containing the following:

session_token: Unique session token.  Used in all requests and passed using the X_SESSION_TOKEN http header.

result: Boolean indicating whether the booking has been successful or not

reference: The booking reference

—————————————————————————————————————————————————————————-

Guest Hotels, Passeig Josep Maria Set, 5, Edifico Cedros -PJ7, 17310 Lloret de Mar, Gerona, Spain