1. Help Center
  2. Buying on TravelgateX
  3. Hotel-X Development/Booking Flow: Book

Hotel-X Development - Book Mutation

All about Hotel-X Book Mutation

Book operation requests a booking confirmation for the specified optionId returned in Quote. It returns a brief summary of the option plus the status of the reservation - note that the information returned may vary between Sellers.

Some of the fields to be added to Book mutation are:

  • Holder
  • Hotel
  • Price
  • Cancel Policy
  • Status - make sure you add this field to your Query in order to receive the reservation status in BookRS.
  • Client reference - the booking locator in your system (alphanumerical value).
  • Supplier reference - make sure you add this field to your Query in order to receive the provider locator in BookRS.

Delta price: what is it and why should I use it:

DeltaPriceInput indicates the price variation allowed by the Buyer, so that an error will be returned if the new price does not abide to DeltaPrice. You will find more information on Delta Price and Price Change here.

 

Payment details in Book:

They depend on the paymenType of the option to be booked - receiving one payment type or the other depends on your commercial agreement with the Seller. You will find more information on the payment type options available in TravelgateX here:

1. No Credit Card Details required:

When the option returned in Search is marked as "paymentType": Merchant, there is no need to pass CC details in the BookRQ. E.g.:

{"query":"mutation ($bookInput: HotelBookInput!, $settings: HotelSettingsInput) {\n hotelX {\n book(input: $bookInput, settings: $settings) {\n booking {\n\t\t\t\thotel {\n\t\t\t\t\thotelCode\n\t\t\t\t}\n price {\n currency\n binding\n net\n gross\n exchange {\n currency\n rate\n }\n markups {\n channel\n currency\n binding\n net\n gross\n exchange {\n currency\n rate\n }\n }\n }\n status\n remarks\n reference {\n client\n supplier\n }\n holder {\n name\n surname\n }\n hotel {\n creationDate\n checkIn\n checkOut\n hotelCode\n hotelName\n boardCode\n occupancies {\n id\n paxes {\n age\n }\n }\n rooms {\n code\n description\n occupancyRefId\n price {\n currency\n binding\n net\n gross\n exchange {\n currency\n rate\n }\n markups {\n channel\n currency\n binding\n net\n gross\n exchange {\n currency\n rate\n }\n }\n }\n }\n }\n }\n errors {\n code\n type\n description\n }\n warnings {\n code\n type\n description\n }\n }\n }\n}\n","variables":{"bookInput":{"optionRefId":"","clientReference":"","deltaPrice":{"amount":0,"percent":0,"applyBoth":true},"holder":{"name":"Test TGX","surname":"Test TGX"},"rooms":[{"occupancyRefId":1,"paxes":[{"name":"Test1","surname":"Test1","age":36},{"name":"Test2","surname":"Test2","age":36}]}]},"settings":{"client":"","testMode":true,"context":"","auditTransactions":true}}}

2. Credit Card Details required:

When the option returned in Search is marked with any of the following payment types, you should provide the CC details in BookRQ:

  • Direct
  • Card Booking
  • Card Checking
 {"query":"mutation ($bookInput: HotelBookInput!, $settings: HotelSettingsInput) {\n hotelX {\n book(input: $bookInput, settings: $settings) {\n\t\t\tauditData {\n\t\t\t\ttransactions {\n\t\t\t\t\trequest\n\t\t\t\t\tresponse\n\t\t\t\t}\n\t\t\t\ttimeStamp\n\t\t\t}\n booking {\n price {\n currency\n binding\n net\n gross\n exchange {\n currency\n rate\n }\n markups {\n channel\n currency\n binding\n net\n gross\n exchange {\n currency\n rate\n }\n }\n }\n status\n remarks\n reference {\n client\n supplier\n }\n holder {\n name\n surname\n }\n hotel {\n creationDate\n checkIn\n checkOut\n hotelCode\n hotelName\n boardCode\n occupancies {\n id\n paxes {\n age\n }\n }\n rooms {\n code\n description\n occupancyRefId\n price {\n currency\n binding\n net\n gross\n exchange {\n currency\n rate\n }\n markups {\n channel\n currency\n binding\n net\n gross\n exchange {\n currency\n rate\n }\n }\n }\n }\n }\n }\n errors {\n code\n type\n description\n }\n warnings {\n code\n type\n description\n }\n }\n }\n}\n","variables":{"bookInput":{"optionRefId":"","clientReference":"","remarks":"","paymentCard":{"type":"","holder":{"name":"Test1","surname":"Test1"},"number":"","CVC":"","expire":{"month":3,"year":25}},"deltaPrice":{"amount":10,"percent":10,"applyBoth":true},"holder":{"name":"Test KL","surname":"Test KL"},"rooms":[{"occupancyRefId":1,"paxes":[{"name":"Test1","surname":"Test1","age":30},{"name":"Test1","surname":"Test1","age":30}]}]},"settings":{"client":"","testMode":true,"context":"","auditTransactions":true}}}

 

Any missing information from your BookRS? Don't forget to check our Documentation and API Schema for further information on the mandatory and optional fields to be returned in BookRS.

If the Seller returns the information but it's not being displayed in our response, please submit a ticket to our Customer Care team.