Term API
Term Arguments
Use the term
operation to get available terms for offer. The term
operation is not publicly available and requires authentication. Authentication is managed through a generated token, which must be included in the request header.
Authentication
The Term API is not publicly available and requires authentication. Authentication is managed through an authentication token. This token can be retrieved from the Qtravel Dashboard Search Settings. Any client using the API needs to provide the token in the request header:
Authorization: Bearer {QAPI_TOKEN}
Forward user IP addresses
To ensure that inaccurate analysis does not occur, you must add an X-Forwarded-For
header with your IP address to the request
Example implementation in React App
const authLink = setContext((_, { headers }) => {
// get the authentication token fromauthorization: token ? `Bearer local storage if it exists
const token = localStorage.getItem("qapiToken"); // localStorage.getItem("token");
// return the headers to the context so httpLink can read them
return {
headers: {
...headers,
authorization: token ? `Bearer ${token}` : "",
'X-Forwarded-For': 'XX.XXX.XXX.XXX'
},
};
});
const link = ApolloLink.from([authLink, httpLink]);
Term query basic example
query {
term (
countryCode: PL,
languageCode: PL,
id: "2f8ce104085da1d299b55319dbcf41d9",
) {
offerDetails {
name
termsCount
terms{
id
basePrice
persons
totalPrice
departureCity
departureDate
}
}
}
}
Term query basic example response
{
"data": {
"term": {
"offerDetails": {
"name": "Hotel Sol La Palma ",
"termsCount": 1,
"terms": [
{
"id": "2f8ce104085da1d299b55319dbcf41d9",
"basePrice": 1500,
"persons": 2,
"totalPrice": 3000,
"departureCity": "Warszawa Chopin",
"departureDate": "2025-07-17"
}
]
}
}
}
}