Skip to main content

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 where is provided, where.requestMode is required.

Optional​

  • where.bookingAt, where.checkInAt, where.cancelAt
  • where.reference
  • where.ownerCode_in, where.groupCode_in, where.accessCode_in
  • where.supplierCode_in, where.clientCode_in
  • where.marketCode_in, where.countryCode_in
  • where.bookingStatus_in
  • orderBy, 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 FieldWhat it RepresentsHow to obtain it via Admin API
clientCodeClient CodeQuery your Clients list to retrieve the code
clientOrganizationBuyer Organization CodeQuery your Buyers list to retrieve the orgCode
supplierCodeSupplier CodeQuery your Suppliers list to retrieve the code
supplierOrganizationSeller Organization CodeQuery your Sellers list to retrieve the orgCode

Enum Reference​

ModeType​

ValueDescription
BUYERQuery from the Buyer's perspective
SELLERQuery from the Seller's perspective

BookingsReportOrderByInput​

ValueDescription
bookingAt_ASC / bookingAt_DESSort by booking date ascending or descending
checkInAt_ASC / checkInAt_DESSort by check-in date ascending or descending
cancelAt_ASC / cancelAt_DESSort by cancellation date ascending or descending
numBookings_ASC / numBookings_DESSort by number of bookings ascending or descending
amountEur_ASC / amountEur_DESSort by amount in EUR ascending or descending

BookingsReportGroupByInput​

ValueDescription
statusGroup by booking status
clientCodeGroup by client code
clientOrganizationGroup by client organization
supplierCodeGroup by supplier code
supplierOrganizationGroup by supplier organization
currencyGroup by currency
bookingAtGroup by booking date
checkInAtGroup by check-in date
cancelAtGroup by cancellation date
originMarketGroup by origin market
destinationCountryGroup by destination country
paxTypeGroup by passenger type
lengthOfStayGroup by length of stay
bookingWindowGroup by booking window
hotelGroup by hotel

BookStatusType​

ValueDescription
OKBooking confirmed successfully
KOBooking failed
ON_REQUESTBooking pending confirmation
CANCELLEDBooking cancelled
PENDING_COMMITBooking awaiting commit
UNKNOWNBooking status unknown

Baseline Response Shape​

Main response sections:

  • bookingsDetails β€” row-level booking records
  • bookingsAggregation β€” grouped aggregation data
  • adviseMessage β€” 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
}
}
}
]
}
}
}
}
}

Β