Book Multiple Rooms

In all use cases, the Actor is the developer implementing the interface between the JSON APIs and your company's application that provides travel results to your company's end users. Actors here are not searching/booking travel for themselves but instead are implementing this data handling for input from your company's travel customers.

This use case identifies how to book multiple rooms for multiple guests.

Prerequisites

  • Authentication

  • Either:

    • v11: Search and Availability, sending the number of guests to book for in each request; you do not send a room quantity in previous requests.

    • v12: SearchComplete, sending the number of guests to book for, but not room quantity.

Next steps

None required. This step books the requested rooms and completes the workflow.

Use case

Book rooms using the Create Reservation reference payload request

Action

Goals and steps

Code Example

Request

  1. In the  Create Reservation reference payload, to specify the number of rooms. enter the following:

    • NumberOfRooms set to the number of rooms to book. If you are booking only 1 room, you do not need to send NumberOfRooms. The API books one room by default.

  2. For each traveler, send one instance of the Traveler object with all required details:

    • name in the PersonName objects

    • telephone in the Traveler/Telephone objects

    • email in Traveler/email

"ReservationQueryBuild": {

"@type": "ReservationQueryBuild",

"ReservationBuild": {

"@type": "ReservationBuildFromCatalogOffering",

"BuildFromCatalogOfferingHospitality": {

"@type": "BuildFromCatalogOfferingHospitality",

"NumberOfRooms": 2,

 

"Traveler": [

{

"@type": "Traveler",

"PersonName": {

"Given": "Mariah",

"Surname": "Roberts",

"Title": "Ms"

},

"Telephone": [

{

"@type": "TelephoneDetail",

"countryAccessCode": "91",

"areaCityCode": "011",

"phoneNumber": "9891766469",

"cityCode": "DL"

}

],

"Email": [

{

"value": "roberts@none.com"

}

],

 

Response

The booking response returns room and guest count at the top of the Product object:

  • Quantity=2 notes that two rooms were booked

  • guests=4 notes that four guests are on the booking

{

"ReservationResponse": {

"Reservation": {

"@type": "ReservationDetail",

"Offer": [

{

"@type": "Offer",

"id": "O1",

"Identifier": {

"value": "6269ddc1-a017-40cb-bce6-140d5e74e104:cc3280205f5ae9a9b7944c1002c88b33",

"authority": "TVPT"

},

"Product": [

{

"@type": "ProductHospitality",

"Quantity": 2,

"bookingCode": "T00AABT",

"guests": 4,