Skip to main content

Cancel

The cancel operation allows you to cancel a booking made via Travelgate. The returned fields include:

  • status
  • reference
  • price
  • holder
  • hotel
  • rooms
  • rates

Cancel Inputs​

When creating your cancel query, you have two different inputs to fill based on your specific needs:

  1. Criteria
  2. Settings
mutation {
hotelX {
cancel
criteria: {}
settings: {}
}
}
Remember
It's important to note that even if certain fields in the "criteria" or "settings" inputs are labeled as optional, we still need to use some value internally. This value will either come from your query/mutation request or your default settings. You have the ability to manage your default API settings by visiting the API Settings section on our website.

1. Input​

This mutation offers versatility in cancellation, with all fields marked as optional (accessCode, language, hotelCode etc.). You can decide between the two options for cancellation, either by reference or by bookingID, empowering you with the choice that suits you best.

To specify your cancel input you need to use the input HotelCancelInput in your mutation variables.

If you decide to cancel using only the bookingID from the booking response, here's how you should structure your input:

{
"input" : {
"bookingID" : "1@1[241028[241029[230918[1[es[EUR[2[test_0123456789[2596391"
}
}

On the other hand, if you prefer to cancel using the accessCode, hotelCode, and reference from the booking response, here's the format you should follow:

{
"input" : {
"accessCode" : "2",
"hotelCode" : "1",
"reference" : {
"supplier" : "2596391"
}
}
}

Optional criteria

  • reference
  • bookingID
  • accessCode
  • language
  • hotelCode
Keep in mind

While not all criteria are required, you'll need to do one of two things to cancel a reservation: either use the bookingID from the booking response, or provide all the other criteria, including accessCode, hotel, and reference. This ensures a successful cancellation of the reservation.

2. Settings​

Settings are the common configurations used to construct requests to the supplier/s. By default, we apply the same configuration to all Hotel-X clients.

To specify your cancel settings you need to use the HotelSettingsInput input in your mutation variables:

{
"settings": {
"client": "client_demo",
"context": "HOTELTEST",
"testMode": true,
"auditTransactions": false,
"timeout": 60000
}
}

Mandatory Settings:

  • client
  • context
  • timeout (Timeout in milliseconds for all supplier connections. Won't close client connection if exceeded.)

Optional Settings:

  • group
  • auditTransactions
  • suppliers (Each one contains its own code, settings and accesses)
  • plugins
  • testMode (This flag allows only the accesses checked as test)
  • clientTokens (Used to identify the origin of the request, this is only used in plugins)
  • commitRequired (Indicates if the book will be confirmed in 1 or 2 steps. It only should be used in Book)
  • businessRules
  • operationTimeout (Timeout in milliseconds for Hotel-X connection. Will close Buyer connection if exceeded. Must be higher than timeout.)
Remember

Keep in mind that if you leave some of the fields in the settings inputs unspecified, we will use the values from your default settings. You can review and control your default API settings by visiting the API Settings section on our website.

Requests Examples​

Cancel with the bookingID from the book response​

Cancel using the accessCode, hotelCode and reference from the book response​

Cancel Response​

Keep in mind that the content of the Cancel response can differ depending on the Sellers. For instance, some Sellers might provide details about the hotel, while others may only offer information about the status and locators/references.

Cancel output fields

Explore all the cancel output fields and their descriptions in our detailed Graphql API Reference section here.

Next, we'll provide important information about some of the returned fields.

Cancel Status​

Once a Cancel method is run, our API response will provide its cancel status. This status represents the current status of the cancellation and can be categorized into four possible values:

StatusDescription
CANCELLEDThe reservation is cancelled.
OKThe reservation status is OK, is not cancelled.
ON_REQUESTThe reservation was completed but the product is still not available by the Seller, so the reservation goes into a waiting list. It is the Buyer’s responsibility to check if the booking is OK.
UNKNOWNThe cancellation process through Travelgate was completed but due to a supplier error or a timeout, the reservation status is unknown. It is the Buyer’s responsibility to check if the booking is cancelled.
Important

If you receive any of the "common errors" or a status other than "CANCELLED", it will be your responsibility as a Buyer to check the final status of the cancellation in the Seller's system.

Cancel Penalty​

Cancellation always takes into account the day and time of the destination in order to calculate what cancellation policy should be applied. UTC time.

Frequently Asked Questions​

How are cancellation costs calculated and displayed?

Depending on the specifications provided by a Seller, cancellation costs can be calculated using three different penalty types. It is important to keep in mind that a booking may have more than one penalty type associated with it.

  • NIGHTS: It indicates the number of nights to be penalized.
  • PERCENT: It indicates the percentage to pay based on the option price (possible values between 0 and 100).
  • IMPORT: It Indicates the exact amount payable.
Is it possible to retrieve the cancellation costs without canceling the option?
If the seller provides cancel policies information, you can access it either through the Hotel-X Quote Query or, if the reservation has already been made, with the Hotel-X Booking Query.