Insights API
API Endpointβ
All Insights API operations use a single GraphQL endpoint:
https://api.travelgate.com
Overviewβ
Travelgate's Insights API lets you query booking reports programmatically.
This document provides the query reference and request/response patterns for the Travelgate Insights API.
Common Use Casesβ
- Booking Analysis: Retrieve detailed and aggregated booking results.
- Performance Reporting: Analyze booking metrics by client, supplier, market, and destination.
- Trend Monitoring: Track booking volume and revenue trends over time using groupBy dimensions.
Authenticationβ
All Insights API calls require JWT (JSON Web Token) authentication. Follow the steps in the Admin API Authentication Guide to obtain your bearer token and include it in all API requests.
Quick Example:
Include your JWT token in the Authorization header:
curl 'https://api.travelgate.com' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_JWT_TOKEN' \
--data-raw '{
"query": "query BookingsReportExample { insights { bookingsReport(where: { requestMode: BUYER bookingAt: { gte: \\"2026-06-01 00:00:00\\" lte: \\"2026-06-30 23:59:59\\" } } limit: 50) { bookingsAggregation { edges { node { InsightsXBookingAggregationData { bookingAt amount amountEur numBookings } } } } } } }"
}'
Query Overviewβ
bookingsReportβ
Retrieve booking detail and aggregation data.
insights {
bookingsReport(
where: BookingsReportWhereInput
orderBy: BookingsReportOrderByInput
groupBy: [BookingsReportGroupByInput!]
limit: Int
relay: RelayInput
): InsightsXBookingReport
}
Input Highlightsβ
Requiredβ
- No top-level argument is strictly required by the schema.
- If
whereis provided,where.requestModeis required.
Optionalβ
where.bookingAt,where.checkInAt,where.cancelAtwhere.referencewhere.ownerCode_in,where.groupCode_in,where.accessCode_inwhere.supplierCode_in,where.clientCode_inwhere.marketCode_in,where.countryCode_inwhere.bookingStatus_inorderBy,groupBy,limit,relay
Obtaining Filter Values (Equivalences)β
If you need to fetch a dynamic list of valid values to populate your Insights filters, use the following equivalence table to find them via the Admin API:
| Insights Filter / GroupBy Field | What it Represents | How to obtain it via Admin API |
|---|---|---|
clientCode | Client Code | Query your Clients list to retrieve the code |
clientOrganization | Buyer Organization Code | Query your Buyers list to retrieve the orgCode |
supplierCode | Supplier Code | Query your Suppliers list to retrieve the code |
supplierOrganization | Seller Organization Code | Query your Sellers list to retrieve the orgCode |
Enum Referenceβ
ModeTypeβ
| Value | Description |
|---|---|
BUYER | Query from the Buyer's perspective |
SELLER | Query from the Seller's perspective |
BookingsReportOrderByInputβ
| Value | Description |
|---|---|
bookingAt_ASC / bookingAt_DES | Sort by booking date ascending or descending |
checkInAt_ASC / checkInAt_DES | Sort by check-in date ascending or descending |
cancelAt_ASC / cancelAt_DES | Sort by cancellation date ascending or descending |
numBookings_ASC / numBookings_DES | Sort by number of bookings ascending or descending |
amountEur_ASC / amountEur_DES | Sort by amount in EUR ascending or descending |
BookingsReportGroupByInputβ
| Value | Description |
|---|---|
status | Group by booking status |
clientCode | Group by client code |
clientOrganization | Group by client organization |
supplierCode | Group by supplier code |
supplierOrganization | Group by supplier organization |
currency | Group by currency |
bookingAt | Group by booking date |
checkInAt | Group by check-in date |
cancelAt | Group by cancellation date |
originMarket | Group by origin market |
destinationCountry | Group by destination country |
paxType | Group by passenger type |
lengthOfStay | Group by length of stay |
bookingWindow | Group by booking window |
hotel | Group by hotel |
BookStatusTypeβ
| Value | Description |
|---|---|
OK | Booking confirmed successfully |
KO | Booking failed |
ON_REQUEST | Booking pending confirmation |
CANCELLED | Booking cancelled |
PENDING_COMMIT | Booking awaiting commit |
UNKNOWN | Booking status unknown |
Baseline Response Shapeβ
Main response sections:
bookingsDetailsβ row-level booking recordsbookingsAggregationβ grouped aggregation dataadviseMessageβ operational warnings or errors
Examplesβ
In the following examples, you can see how to extract bookings data using the interactive playground.
Example 1: Bookings Report (bookingsReport)β
Query:
query BookingsReportExample {
insights {
bookingsReport(
where: {
requestMode: BUYER
bookingAt: {
gte: "2026-06-01 00:00:00"
lte: "2026-06-30 23:59:59"
}
clientCode_in: ["client_demo"]
supplierCode_in: ["SUPPLIER_CODE"]
marketCode_in: ["ES"]
countryCode_in: ["PT"]
bookingStatus_in: [OK, CANCELLED]
}
orderBy: amountEur_DES
groupBy: [clientCode, supplierCode, bookingAt]
limit: 50
) {
bookingsDetails {
edges {
node {
InsightsXBookingDetailData {
reference {
client
supplier
hotel
}
hotel {
bookingDate
start
end
hotelCode
hotelName
}
status
price {
net
gross
exchange {
currency
rate
}
}
}
}
}
}
bookingsAggregation {
edges {
node {
InsightsXBookingAggregationData {
bookingAt
amount
amountEur
numBookings
}
}
}
}
}
}
}
Sample Response:
{
"data": {
"insights": {
"bookingsReport": {
"bookingsDetails": {
"edges": [
{
"node": {
"InsightsXBookingDetailData": {
"reference": {
"client": "CLI-REF-001",
"supplier": "SUP-REF-777",
"hotel": "HOTEL-REF-99"
},
"hotel": {
"bookingDate": "2026-06-10",
"start": "2026-07-01",
"end": "2026-07-05",
"hotelCode": "HTL123",
"hotelName": "Demo Hotel"
},
"status": "OK",
"price": {
"net": 120.5,
"gross": 130.0,
"exchange": {
"currency": "EUR",
"rate": 1.0
}
}
}
}
}
]
},
"bookingsAggregation": {
"edges": [
{
"node": {
"InsightsXBookingAggregationData": {
"bookingAt": "2026-06-10",
"amount": 120.5,
"amountEur": 120.5,
"numBookings": 1
}
}
}
]
}
}
}
}
}
Β