Skip to main content

Offer API

Offer Arguments

Use the offer operation to get offer details. The offer 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 Search 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]);

Offer query basic example

query {
offer (
countryCode: PL,
languageCode: PL,
id:66,
) {
offerDetails {
name
}
}
}

Offer query basic example response

{
"data": {
"offer": {
"offerDetails": {
"name": "Hotel Sol La Palma"
}
}
}
}

Offer Term Example

query {
offer (
countryCode: PL,
languageCode: PL,
id:66,
) {
offerDetails {
name
terms{
id
basePrice
persons
totalPrice
}
}
}
}

Offer Term Response

{
"data": {
"offer": {
"offerDetails": {
"name": "Hotel Sol La Palma ",
"terms": [
{
"id": "0245c9d388ce050e9224de94bcb68b9a",
"basePrice": 1500,
"persons": 2,
"totalPrice": 3000
},
{
"id": "091e2b35d4971d3bf1668d400de7b73d",
"basePrice": 1500,
"persons": 2,
"totalPrice": 3000
},
{
"id": "1987bd15972f913a19776d0f27d9a233",
"basePrice": 1500,
"persons": 2,
"totalPrice": 3000
},
{
"id": "1c3e72d657fcb03ad02c21a94d31202f",
"basePrice": 1500,
"persons": 2,
"totalPrice": 3000
},
{
"id": "1fb1411af2bb7d834884d392128512ac",
"basePrice": 1500,
"persons": 2,
"totalPrice": 3000
},
{
"id": "2148583bd16db70d61adeeb640cdf203",
"basePrice": 1500,
"persons": 2,
"totalPrice": 3000
},
{
"id": "233b878ad4bc0aee3c66f68bd9b6cbff",
"basePrice": 1500,
"persons": 2,
"totalPrice": 3000
},
{
"id": "277fdbf13b5f1dfff3192ba5615e545e",
"basePrice": 1500,
"persons": 2,
"totalPrice": 3000
},
{
"id": "2e1d0cefe844ee5067c10b17bea83b94",
"basePrice": 1500,
"persons": 2,
"totalPrice": 3000
},
{
"id": "2f8ce104085da1d299b55319dbcf41d9",
"basePrice": 1500,
"persons": 2,
"totalPrice": 3000
}
]
}
}
}
}