What is the Hotel-X Book mutation and what can I expect to receive?

It is the reservation step, where we request to the Seller the confirmation of the booking.

Our Book mutation returns a brief summary of the option plus the status of the reservation in the Seller system.  

The information returned might vary between Sellers. 

Some of the fields that can be added to our Book mutation are:

  • Holder
  • Hotel
  • Price
  • Cancel Policy
  • Status

Depending on the option payment type, it will be required to provide Credit Card details:

No Credit Card Details

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

A mutation example:

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

Credit Card Details Required

When the option returned in Search is marked with any of the following "paymentType":

  • Direct
  • Card Booking
  • Card Checking

Then you should provide the CC details in the Book mutation.

A mutation example:

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

*Receiving one payment type or the other will depend on the commercial agreement you've with the Seller.