Book

This operation allows you to place a reservation request. We support single as well as multi-room bookings in this version of the API.

See the DOCS tab on the Reservation GraphQL Docs for detailed information about the type definitions.

Schema

The schema remains the same for both single and multi-room bookings.

mutation book($Book: BookRequestInput) {
  book(bookRequest: $Book) {
    htConfirmationCode
    clientConfirmationCode
    otaConfirmationCode
    consolidatedComments
    consolidatedHTMLComments
    bookingDate
    specialRequests
    propertyDetails {
      ...propertyDetails
    }
    rooms {
      ...roomDetails
    }
  }
}

fragment addressDetails on Address {
  address1
  address2
  cityName
  countryCode
  stateName
  zipCode
}

fragment propertyDetails on PropertyResponseEntity {
  address {
    ...addressDetails
  }
  checkInTime
  checkOutTime
  city
  hotelImageUrl
  latitude
  longitude
  propertyId
  propertyName
  starRating
  checkInPolicy
  minAdultAgeForCheckIn
}

fragment roomDetails on RoomResponse {
  cancellationDate
  cancellationFee
  cancelled
  cancellationPolicies {
    ...cancelPolicyDetails
  }
  checkInDate
  checkOutDate
  clientRoomConfirmationCode
  htRoomConfirmationCode
  crsConfirmationCode
  crsCancelConfirmationCode
  pmsConfirmationCode
  refundable
  roomName
  rateplanTag
  mealplanOptions {
    mealplanDescription
    mealplanCode
    mealplanName
  }
  rates {
    ...ratesDetails
  }
  occupancy {
    guestAges
  }
  guests {
    ...guestDetails
  }
  roomSpecialRequests
}
fragment cancelPolicyDetails on HtCancellationPolicy {
  startWindowTime
  endWindowTime
  currency
  cancellationCharge
  timeZone
  timeZoneUTC
}
fragment ratesDetails on RoomRatesResponseEntity {
  bar
  binding
  commissionable
  commissionAmount
  currencyCode
  netPrice
  tax
  grossPrice
  dailyPrice
  dailyTax
  payAtProperty
  aggregateTaxInfo {
    payAtBooking {
      description
      name
      currency
      value
    }
    payAtProperty {
      description
      name
      currency
      value
    }
  }
}
fragment guestDetails on RoomGuestResponseEntity {
  adult
  age
  email
  firstName
  lastName
  phone
  primary
}

Single Room Bookings

Sample Request

{

    "Book": {
        "clientConfirmationCode": "tc-test-0711013",
        "otaConfirmationCode": "test-client-3286",
        "otaClientName": "htrader",
        "specialRequests": [
            "reservation test commentä"
        ],
        "paymentInformation": null,
        "rooms": [
            {
                "htIdentifier": "6131514161|1312101315121|1419131812141|121012131-112-11101|121012131-112-112|1816101c121e16131-1e1816131-141d1f131-191a16191-131416191715191d1b13201|1116192315111814131113191|1O1D1C22131|1K111",
                "clientRoomConfirmationCode": "tc-test-0711013-1",
                "roomSpecialRequests": [
                    "room test commentä"
                ],
                "rates": {
                    "netPrice": 300.17,
                    "tax": 30.01,
                    "grossPrice": 330.18,
                    "payAtProperty": 50,
                    "dailyPrice": [
                        300.17
                    ],
                    "dailyTax": [
                        30.01
                    ]
                },
                "occupancy": {
                    "guestAges": "30,5"
                },
                "guests": [
                    {
                        "firstName": "test",
                        "lastName": "booking",
                        "email": "test@hoteltrader.com",
                        "adult": true,
                        "age": 24,
                        "phone": "1234567890",
                        "primary": true
                    },
                    {
                        "firstName": "test1",
                        "lastName": "booking1",
                        "email": "test@hoteltrader.com",
                        "adult": true,
                        "age": 24,
                        "phone": "1234567890",
                        "primary": true
                    }
                ]
            }
        ]
    }
}

Sample Response

{
    "book": {
        "htConfirmationCode": "HT-NZGQNS",
        "clientConfirmationCode": "tc-test-0711013",
        "otaConfirmationCode": "test-client-3286",
        "consolidatedComments": "Hotel Check In Policy: Major credit card required at check-in for deposit and incidentals. Any additional fees such as parking, pet fees, etc. are solely at the discretion of the hotel, are subject to change at any point and should be paid directly by the guest.. Reservation is refundable but nonModifiable. Minimum adult age at check in is 21 years. Free Breakfast. A Resort Fee totaling EUR50.00 will be charged for the stay. Mandatory Charge. Plus applicable taxes.. ",
        "consolidatedHTMLComments": "<ul><li>Hotel Check In Policy: Major credit card required at check-in for deposit and incidentals. Any additional fees such as parking, pet fees, etc. are solely at the discretion of the hotel, are subject to change at any point and should be paid directly by the guest.. </li><li>Reservation is refundable but nonModifiable. </li><li>Minimum adult age at check in is 21 years. </li><li>Free Breakfast. </li><li>A Resort Fee totaling EUR50.00 will be charged for the stay. Mandatory Charge. Plus applicable taxes.. </li></ul>",
        "bookingDate": "2023-11-07T10:12:54.000+0200",
        "specialRequests": [
            "reservation test commentä"
        ],
        "propertyDetails": {
            "address": {
                "address1": "Sarigerme Tourism Center, PO11",
                "address2": null,
                "cityName": "Mugla",
                "countryCode": "TR",
                "stateName": null,
                "zipCode": "48610"
            },
            "checkInTime": "3:00 PM",
            "checkOutTime": "12:00 PM",
            "city": "Mugla",
            "hotelImageUrl": null,
            "latitude": "36.708",
            "longitude": "28.724",
            "propertyId": 2257146,
            "propertyName": "Hilton Dalaman Sarigerme Resort & Spa",
            "starRating": 4,
            "checkInPolicy": "Major credit card required at check-in for deposit and incidentals. Any additional fees such as parking, pet fees, etc. are solely at the discretion of the hotel, are subject to change at any point and should be paid directly by the guest.",
            "minAdultAgeForCheckIn": 21
        },
        "rooms": [
            {
                "cancellationDate": null,
                "cancellationFee": null,
                "cancelled": false,
                "cancellationPolicies": [
                    {
                        "startWindowTime": "2023-11-09 23:59:00",
                        "endWindowTime": "2023-11-10 16:00:00",
                        "currency": "EUR",
                        "cancellationCharge": 330.18,
                        "timeZone": "Europe/Istanbul",
                        "timeZoneUTC": "+03:00"
                    }
                ],
                "checkInDate": "2023-11-10",
                "checkOutDate": "2023-11-11",
                "clientRoomConfirmationCode": "tc-test-0711013-1",
                "htRoomConfirmationCode": "HT-NZGQNS-1",
                "crsConfirmationCode": "360241042",
                "crsCancelConfirmationCode": null,
                "pmsConfirmationCode": "3355390763",
                "refundable": true,
                "roomName": "KING GUEST ROOM WITH GARDEN VIEW",
                "rateplanTag": null,
                "mealplanOptions": {
                    "mealplanDescription": "Free Breakfast",
                    "mealplanCode": "BBF",
                    "mealplanName": "Free Breakfast"
                },
                "rates": {
                    "bar": null,
                    "binding": null,
                    "commissionable": false,
                    "commissionAmount": null,
                    "currency": "EUR",
                    "netPrice": 300.17,
                    "tax": 30.01,
                    "grossPrice": 330.18,
                    "dailyPrice": [
                        300.17
                    ],
                    "dailyTax": [
                        30.01
                    ],
                    "payAtProperty": 50,
                    "aggregateTaxInfo": {
                        "payAtBooking": [
                            {
                                "description": null,
                                "name": "percent",
                                "currency": "EUR",
                                "value": 30.01
                            }
                        ],
                        "payAtProperty": [
                            {
                                "description": "Mandatory Charge. Plus applicable taxes.",
                                "name": "Mandatory Charge",
                                "currency": "EUR",
                                "value": 50
                            }
                        ]
                    }
                },
                "occupancy": {
                    "guestAges": "30,5"
                },
                "guests": [
                    {
                        "adult": true,
                        "age": null,
                        "email": "test@hoteltrader.com",
                        "firstName": "test",
                        "lastName": "booking",
                        "phone": "1234567890",
                        "primary": true
                    },
                    {
                        "adult": true,
                        "age": null,
                        "email": "test@hoteltrader.com",
                        "firstName": "test1",
                        "lastName": "booking1",
                        "phone": "1234567890",
                        "primary": false
                    }
                ],
                "roomSpecialRequests": [
                    "room test commentä"
                ]
            }
        ]
    }
}

Multi-Room Bookings

For sending multi-room booking requests, there should be a child node corresponding to each room in the rooms node.

Sample Request

{
  "Book": {
    "clientConfirmationCode": "tc-test-1207",
    "otaConfirmationCode": "test-client-3286",
    "otaClientName": "test-htrader-graphql",
    "specialRequests": [
      "reservation test comment"
    ],
    "paymentInformation": null,
    "rooms": [
      {
        "htIdentifier": "11019171|1117101511101|111416142|121012141-10111-10111|121012141-10111-10121|14101c191b1013181-1e1311191-141e131f1-191510131-1016121416181b1c19161e1b1|111618161517131410161112171",
        "clientRoomConfirmationCode": "tc-test-1207-1",
        "roomSpecialRequests": [
          "room test comment"
        ],
        "rates": {
          "netPrice": 242.42,
          "tax": 14.64,
          "grossPrice": 257.06,
          "payAtProperty": 30,
          "dailyPrice": [
            242.42
          ],
          "dailyTax": [
            14.64
          ]
        },
        "occupancy": {
          "guestAges": "30,5"
        },
        "guests": [
          {
            "firstName": "test",
            "lastName": "booking",
            "email": "test@hoteltrader.com",
            "adult": true,
            "age": 24,
            "phone": "1234567890",
            "primary": true
          }
        ]
      },
      {
        "htIdentifier": "11019171|1117101511101|111416142|121012141-10111-11151|121012141-10111-11181|14101c191b1013181-1e1311191-141e131f1-191510131-1016121416181b1c19161e1b1|111618161517131410161113101",
        "clientRoomConfirmationCode": "tc-test-1207-2",
        "roomSpecialRequests": [
          "room test comment"
        ],
        "rates": {
          "netPrice": 690,
          "tax": 41.49,
          "grossPrice": 731.49,
          "payAtProperty": 90,
          "dailyPrice": [
            230,
            230,
            230
          ],
          "dailyTax": [
            13.83,
            13.83,
            13.83
          ]
        },
        "occupancy": {
          "guestAges": "30,5"
        },
        "guests": [
          {
            "firstName": "test",
            "lastName": "booking",
            "email": "test@hoteltrader.com",
            "adult": true,
            "age": 24,
            "phone": "1234567890",
            "primary": true
          }
        ]
      }
    ]
  }
}

Sample Response

{
  "data": {
    "book": {
      "htConfirmationCode": "HT-PJJD7H",
      "clientConfirmationCode": "tc-test-1207",
      "otaConfirmationCode": "test-client-3286",
      "consolidatedComments": "Hotel Check In Policy: Major credit card required at check-in for deposit and incidentals. Any additional fees such as parking, pet fees, etc. are solely at the discretion of the hotel, are subject to change at any point and should be paid directly by the guest.. Reservation is refundable but nonModifiable. Minimum adult age at check in is 21 years.  Room#1: Free Breakfast.  Room#2: Free Breakfast.  Room#1: A Resort Fee totaling $30.00 will be charged for the stay. Resort Fee of $30 plus tax per room per night which covers: free local, long distance and international phone calls.  Choice of complimentary wine or water, or both upon check-in.  Complimentary coffee & tea in our lobby each morning. Access to WiFi 24/7 for all devices.  Around the clock access to our fitness center with treadmills, bikes, and weights.  Storage of your luggage and your packages delivered to the hotel while you explore the city..  Room#2: A Resort Fee totaling $90.00 will be charged for the stay. Resort Fee of $30 plus tax per room per night which covers: free local, long distance and international phone calls.  Choice of complimentary wine or water, or both upon check-in.  Complimentary coffee & tea in our lobby each morning. Access to WiFi 24/7 for all devices.  Around the clock access to our fitness center with treadmills, bikes, and weights.  Storage of your luggage and your packages delivered to the hotel while you explore the city.. ",
      "consolidatedHTMLComments": "<ul><li>Hotel Check In Policy: Major credit card required at check-in for deposit and incidentals. Any additional fees such as parking, pet fees, etc. are solely at the discretion of the hotel, are subject to change at any point and should be paid directly by the guest.. </li><li>Reservation is refundable but nonModifiable. </li><li>Minimum adult age at check in is 21 years. </li><li> Room#1: Free Breakfast.  Room#2: Free Breakfast. </li><li> Room#1: A Resort Fee totaling $30.00 will be charged for the stay. Resort Fee of $30 plus tax per room per night which covers: free local, long distance and international phone calls.  Choice of complimentary wine or water, or both upon check-in.  Complimentary coffee & tea in our lobby each morning. Access to WiFi 24/7 for all devices.  Around the clock access to our fitness center with treadmills, bikes, and weights.  Storage of your luggage and your packages delivered to the hotel while you explore the city..  Room#2: A Resort Fee totaling $90.00 will be charged for the stay. Resort Fee of $30 plus tax per room per night which covers: free local, long distance and international phone calls.  Choice of complimentary wine or water, or both upon check-in.  Complimentary coffee & tea in our lobby each morning. Access to WiFi 24/7 for all devices.  Around the clock access to our fitness center with treadmills, bikes, and weights.  Storage of your luggage and your packages delivered to the hotel while you explore the city.. </li></ul>",
      "bookingDate": "2023-06-12T12:42:02.000-0400",
      "specialRequests": [
        "reservation test comment"
      ],
      "propertyDetails": {
        "address": {
          "address1": "3820 North Roosevelt Blvd",
          "address2": "",
          "cityName": "Key West",
          "countryCode": "US",
          "stateName": "Florida",
          "zipCode": "33040"
        },
        "checkInTime": "4:00 PM",
        "checkOutTime": "12:00 PM",
        "city": "Key West",
        "hotelImageUrl": null,
        "latitude": "24.571342",
        "longitude": "-81.75515999999999",
        "propertyId": 553402,
        "propertyName": "24 North Hotel Key West",
        "starRating": 3.5,
        "checkInPolicy": "Major credit card required at check-in for deposit and incidentals. Any additional fees such as parking, pet fees, etc. are solely at the discretion of the hotel, are subject to change at any point and should be paid directly by the guest.",
        "minAdultAgeForCheckIn": 21
      },
      "rooms": [
        {
          "cancellationDate": null,
          "cancellationFee": null,
          "cancelled": false,
          "cancellationPolicies": [
            {
              "startWindowTime": "2023-12-31 16:00:00",
              "endWindowTime": "2025-01-01 16:00:00",
              "currency": "USD",
              "cancellationCharge": 257.06,
              "timeZone": "America/New_York",
              "timeZoneUTC": "-05:00"
            }
          ],
          "checkInDate": "2025-01-01",
          "checkOutDate": "2025-01-02",
          "clientRoomConfirmationCode": "tc-test-1207-1",
          "htRoomConfirmationCode": "HT-PJJD7H-1",
          "crsConfirmationCode": null,
          "crsCancelConfirmationCode": null,
          "pmsConfirmationCode": null,
          "refundable": true,
          "roomName": "Standard | Double Queen-S2Q",
          "rateplanTag": "PACKAGE",
          "mealplanOptions": {
            "mealplanDescription": "Free Breakfast",
            "mealplanCode": "BBF",
            "mealplanName": "Free Breakfast"
          },
          "rates": {
            "bar": null,
            "binding": null,
            "currency": "USD",
            "commissionable": true,
            "commissionAmount": 30.85,
            "netPrice": 242.42,
            "tax": 14.64,
            "grossPrice": 257.06,
            "dailyPrice": [
              213.33
            ],
            "dailyTax": [
              12.88
            ],
            "payAtProperty": 30,
            "aggregateTaxInfo": {
              "payAtBooking": [
                {
                  "description": "State Tax",
                  "name": "State Tax",
                  "currency": "USD",
                  "value": 0.1
                },
                {
                  "description": "City Tax",
                  "name": "City Tax",
                  "currency": "USD",
                  "value": 14.54
                }
              ],
              "payAtProperty": [
                {
                  "description": "Resort Fee of $30 plus tax per room per night which covers: free local, long distance and international phone calls.  Choice of complimentary wine or water, or both upon check-in.  Complimentary coffee & tea in our lobby each morning. Access to WiFi 24/7 for all devices.  Around the clock access to our fitness center with treadmills, bikes, and weights.  Storage of your luggage and your packages delivered to the hotel while you explore the city.",
                  "name": "Resort Fee Pay at property",
                  "currency": "USD",
                  "value": 30
                }
              ]
            }
          },
          "occupancy": {
            "guestAges": "30,5"
          },
          "guests": [
            {
              "adult": true,
              "age": null,
              "email": "test@hoteltrader.com",
              "firstName": "test",
              "lastName": "booking",
              "phone": "1234567890",
              "primary": true
            }
          ],
          "roomSpecialRequests": [
            "room test comment"
          ]
        },
        {
          "cancellationDate": null,
          "cancellationFee": null,
          "cancelled": false,
          "cancellationPolicies": [
            {
              "startWindowTime": "2025-01-14 16:00:00",
              "endWindowTime": "2025-01-15 16:00:00",
              "currency": "USD",
              "cancellationCharge": 731.49,
              "timeZone": "America/New_York",
              "timeZoneUTC": "-05:00"
            }
          ],
          "checkInDate": "2025-01-15",
          "checkOutDate": "2025-01-18",
          "clientRoomConfirmationCode": "tc-test-1207-2",
          "htRoomConfirmationCode": "HT-PJJD7H-2",
          "crsConfirmationCode": null,
          "crsCancelConfirmationCode": null,
          "pmsConfirmationCode": null,
          "refundable": true,
          "roomName": "Standard | Double Queen-S2Q",
          "rateplanTag": "PACKAGE",
          "mealplanOptions": {
            "mealplanDescription": "Free Breakfast",
            "mealplanCode": "BBF",
            "mealplanName": "Free Breakfast"
          },
          "rates": {
            "bar": null,
            "binding": null,
            "currency": "USD",
            "commissionable": true,
            "commissionAmount": 87.78,
            "netPrice": 690,
            "tax": 41.49,
            "grossPrice": 731.49,
            "dailyPrice": [
              202.4,
              202.4,
              202.4
            ],
            "dailyTax": [
              12.17,
              12.17,
              12.17
            ],
            "payAtProperty": 90,
            "aggregateTaxInfo": {
              "payAtBooking": [
                {
                  "description": "State Tax",
                  "name": "State Tax",
                  "currency": "USD",
                  "value": 0.09
                },
                {
                  "description": "City Tax",
                  "name": "City Tax",
                  "currency": "USD",
                  "value": 41.4
                }
              ],
              "payAtProperty": [
                {
                  "description": "Resort Fee of $30 plus tax per room per night which covers: free local, long distance and international phone calls.  Choice of complimentary wine or water, or both upon check-in.  Complimentary coffee & tea in our lobby each morning. Access to WiFi 24/7 for all devices.  Around the clock access to our fitness center with treadmills, bikes, and weights.  Storage of your luggage and your packages delivered to the hotel while you explore the city.",
                  "name": "Resort Fee Pay at property",
                  "currency": "USD",
                  "value": 90
                }
              ]
            }
          },
          "occupancy": {
            "guestAges": "30,5"
          },
          "guests": [
            {
              "adult": true,
              "age": null,
              "email": "test@hoteltrader.com",
              "firstName": "test",
              "lastName": "booking",
              "phone": "1234567890",
              "primary": true
            }
          ],
          "roomSpecialRequests": [
            "room test comment"
          ]
        }
      ]
    }
  }
}

Error Response

The error response format is the same for single and multi-room book requests.

Example 1

{
  "errors": [
    {
      "message": "Duplicate Client Confirmation code received, reservation already exists with same client confirmation number, clientConfirmationCode = tc-123",
      "extensions": {
        "errorCode": 1004
      }
    }
  ],
  "data": {
    "book": null
  }
}

Example 2

{
  "errors": [
    {
      "message": "Invalid htIdentifier, already used for a different request, invalid htIdentifier = 2172|1117101417181|151813111|121012111-11121-10111|121012111-11121-10121|1a131c16101b15122-181f291-141b17111-181c16181-171915131b18101e151e151f1|11162810181723111812161",
      "extensions": {
        "errorCode": 1045
      }
    }
  ],
  "data": {
    "book": null
  }
}