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:
- Criteria
- Settings
mutation {
hotelX {
cancel
criteria: {}
settings: {}
}
}
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
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 thantimeout
.)
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.
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:
Status | Description |
---|---|
CANCELLED | The reservation is cancelled. |
OK | The reservation status is OK, is not cancelled. |
ON_REQUEST | The 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. |
UNKNOWN | The 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. |
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.