Skip to main content

Logging API

API Endpoint​

All Logging API operations use a single GraphQL endpoint:

https://api.travelgate.com

Overview​

Logging is Travelgate's powerful monitoring feature that allows users to access and analyze transaction logs across the Travelgate platform. It is designed to track and analyze the booking flow, identify error codes, and troubleshoot performance issues. This API lets you access log data by connection, reference, operation type, and time range, and download the underlying XML/JSON request and response files for detailed investigations.

This document details how to search, extract traces, and download request logs (XML/JSON) using the Travelgate Logging API. The queries detailed below provide the exact same level of data access as our web platform.

Common Use Cases​

  • Inspect Transaction Traces: Retrieve request and response logs for a specific method or error case.
  • Find Logs by Reference: Search logs using a client reference or supplier reference.
  • Review Quote-to-Book Flow: Trace the Quote that generated a known Booking or One Step Book transaction.
  • Audit Search Logs: Retrieve search traffic only after Search Auditing has been triggered in the web platform.
  • Download Log Files: Access HotelX, Legacy, and Connector log files for troubleshooting and support investigations.

When to Use Logging, Logging API, Stats, or Stats API​

Use these tools together depending on whether you need UI-based log browsing, programmatic transaction-level access, dashboard monitoring, or programmatic aggregated metrics.

NeedRecommended ToolWhy
Review and troubleshoot transactions in the platform UILoggingProvides the built-in transaction-level log viewer for operational troubleshooting
Search, extract traces, and download request/response logs programmaticallyLogging APIReturns transaction-level log data for automated audit and support workflows
Review connection health, booking-flow performance, and NOK ratios in the platform UIStatsProvides the built-in monitoring dashboard for operational analysis
Build custom dashboards, automate reporting, or query aggregated metrics programmaticallyStats APIReturns aggregated metrics optimized for integrations and reporting workflows

For a practical guide to the Logging web UI workflow, see How to Use Logging and How to Audit Supplier Transactions.

Authentication​

All Logging 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 getLogs($input: LoggingLogsWhereInput!) { logging { getLogs(limit: 10, where: $input) { totalCount adviseMessage { code description level } edges { node { logData { timestamp execTime api buyer { code } seller { code } access { accessData { code } } client { clientData { name code } } errorCode errorType operationCode operationType sessionID trafficType files { hotelX legacy connector connectorUnencrypted } } } } } } }",
"variables": {
"input": {
"api": "hotel",
"timeRange": {
"absolute": {
"from": "2026-04-07 09:38:00",
"to": "2026-04-07 10:38:00"
}
},
"mode": "BUYER",
"errorCode_in": [0, 102, 204, 205, 206, 207, 301, 303, 101, 2, 3, 103, 104, 105, 106],
"operationType_in": ["BOOKING"],
"buyer_in": ["BUYER_CODE"],
"seller_in": ["SELLER_CODE"],
"access_in": ["YOUR_ACCESS"]
}
}
}'

Considerations & Business Rules​

Before querying the logs, keep in mind the following platform rules:

  • Error Codes vs. Reservation Status: The "Status/Error code" returned in the logs only indicates if the transaction was processed through our integration without technical errors. It does not reflect the actual booking status of a reservation. To know the real status of a booking with the supplier, you must perform a BookingRead operation.
  • Search Logs Auditing: Travelgate processes over 6 billion daily transactions, meaning Search logs are not stored by default. To retrieve Search logs via the API, an audit must first be triggered manually from the Web Platform (Monitoring > Logging > Audit Search Logs). Once triggered, the system stores 5% of the Search traffic for 5 minutes.
  • One Step Book: You can successfully retrieve both Quote and Book logs for a One Step Book operation by filtering by connection, reference, or Session ID.
  • Trace Types: Depending on the Buyer's integration, you will see either HotelX Logs or Legacy Logs, but never both. Connector Logs (communication directly with the Seller) are always available.

Legacy API Access Filter​

The access_in filter in where only applies to HotelX connections. Do not use it for Legacy API connections.

  • For HotelX connections, filter by access code to narrow results to a specific credential set.
  • For Legacy API connections, omit the access filter and use the time range together with Buyer and Seller filters instead.
  • If a Buyer is transitioning between Legacy and HotelX, they may have traffic on both APIs. Use the My Connections screen to confirm the integration type before applying the access filter.

For more detail on when to use the access filter, see How to Use Logging.

Query Overview​

The Logging API offers three main methods to search and retrieve information:

Log Search (getLogs)​

Use this query to perform general searches based on time ranges and filters.

A. Where (Filters)​

The input object allows you to precisely filter logs based on API, partner perspective, time range, access, and operation type.

{
"input": {
"api": "hotel",
"timeRange": {
"absolute": {
"from": "2026-04-07 09:38:00",
"to": "2026-04-07 10:38:00"
}
},
"mode": "BUYER",
"operationType_in": ["BOOKING"],
"buyer_in": ["BUYER_CODE"],
"seller_in": ["SELLER_CODE"],
"access_in": ["YOUR_ACCESS"]
}
}

Mandatory criteria:

  • api (The API whose logs you want to inspect, for example hotel).
  • mode (Search perspective, either BUYER or SELLER).
  • timeRange (Required time window. Logging accepts both timeRange.absolute and relative ranges, but timeRange.absolute is recommended for consistent and reproducible filtering. For absolute ranges, date values accept both ISO 8601 and "2006-01-02 15:04:05" formats.)

Optional filters:

  • buyer_in: Restrict results to one or more Buyer organization codes.
  • seller_in: Restrict results to one or more Seller organization codes.
  • access_in: Restrict results to one or more access codes. Use only for HotelX connections.
  • operationType_in: Restrict results to one or more operation types such as SEARCH, QUOTE, BOOKING, CANCEL, or OTHER.
  • errorCode_in: Restrict results to one or more platform error codes when troubleshooting failed transactions.

B. Obtaining Filter Values (Equivalences)​

If you need to fetch or confirm the values used in your Logging filters, use the following equivalence table:

Logging Filter InputWhat it RepresentsHow to obtain it
buyer_inBuyer Organization CodeQuery your Buyers list in the Admin API to retrieve the orgCode
seller_inSeller Organization CodeQuery your Sellers list in the Admin API to retrieve the orgCode
access_inAccess CodeQuery your Connections/Accesses in the Admin API to retrieve the code
reference.supplierSupplier Reference / LocatorUse the supplier locator returned by the supplier or Seller system
reference.clientClient Reference / LocatorUse the client reference set in the Book request

C. Enum Reference​

Mode Values​

The mode field specifies whose perspective you want to query:

ValueDescription
BUYERQuery logs from the Buyer's perspective
SELLERQuery logs from the Seller's perspective
Operation Type Values​

The operationType_in filter in Logging API typically uses these operation type values:

ValueDescription
SEARCHSearch operations - initial availability queries
QUOTEQuote operations - rate and availability confirmation
BOOKINGBooking operations - reservation creation and confirmation
CANCELCancel operations - reservation cancellations
OTHEROther operations outside the standard booking flow, such as read or content-related requests
Log File Types​

The files object in log responses identifies which downloadable traces are available:

FieldDescription
hotelXHotelX request/response trace for Buyer traffic integrated through HotelX
legacyLegacy Pull Buyers API request/response trace
connectorConnector trace showing the communication between Travelgate and the Seller
connectorUnencryptedConnector payload without encryption when available for troubleshooting

Log Search by Reference (getLogsByReference)​

Designed to search for logs using a specific locator or reference (client or supplier ID).

Key inputs:

  • where.api: The API whose logs you want to inspect.
  • where.mode: Whether to inspect Buyer or Seller-side traffic.
  • where.timeRange: Time window used to narrow the lookup. Logging accepts both timeRange.absolute and relative ranges, but timeRange.absolute is recommended for consistent and reproducible filtering. For absolute ranges, date values accept both ISO 8601 and "2006-01-02 15:04:05" formats.
  • where.reference.supplier or where.reference.client: The reference you want to track.

Use this query when you already know a locator and want to retrieve the matching session-level log records quickly.

Quote Logs from Booking (getQuoteLogsFromBook)​

Specific query to track the original Quote that generated a specific Booking.

Key inputs:

  • input.timeRange: Time window around the booking transaction. Logging accepts both timeRange.absolute and relative ranges, but timeRange.absolute is recommended for consistent and reproducible filtering. For absolute ranges, date values accept both ISO 8601 and "2006-01-02 15:04:05" formats.
  • input.sessionId: The booking session ID you want to trace back to its Quote.
  • input.buyer and input.seller: Organization codes used to narrow the lookup.
  • input.mode and input.api: Partner perspective and API scope for the search.

Obtaining Filter Values (Equivalences)​

The buyer and seller fields in getQuoteLogsFromBook represent the same organization codes as buyer_in and seller_in in getLogs. The difference is that buyer_in and seller_in accept an array of values, while buyer and seller each accept a single scalar string. Use the following equivalence table to obtain the correct values:

getQuoteLogsFromBook InputEquivalent in getLogsWhat it RepresentsHow to obtain it
buyer (scalar String)buyer_in (array of String)Buyer Organization CodeQuery your Buyers list in the Admin API to retrieve the orgCode
seller (scalar String)seller_in (array of String)Seller Organization CodeQuery your Sellers list in the Admin API to retrieve the orgCode

Use this query when you need quote-to-book traceability for a booking investigation or One Step Book analysis.

Response Fields​

Advisory Messages​

The adviseMessage field appears in getLogs and getQuoteLogsFromBook responses to provide operational guidance. It may be null if no warnings or issues are detected.

Advisory Message Structure (adviseMessage):

[
{
"code": "SAMPLE_CODE",
"description": "Description of the advisory message",
"correlationID": "1234567890",
"level": "WARN",
"external": {
"code": "SUPPLIER_CODE",
"message": "Additional external context"
}
}
]

Advisory Message Levels:

LevelMeaningAction Required
INFOInformational message, no action neededNone - informational only
WARNCaution recommended, may affect result completeness or traceabilityReview the message and consider investigation
ERRORIssue detectedInvestigation recommended

Advisory Message Fields:

FieldReturned ByDescription
codegetLogs, getQuoteLogsFromBookMessage code returned by the API
descriptiongetLogs, getQuoteLogsFromBookHuman-readable message description
correlationIDgetQuoteLogsFromBookIdentifier for troubleshooting and support investigations
levelgetLogs, getQuoteLogsFromBookSeverity level (WARN, ERROR, INFO)
external.codegetQuoteLogsFromBookExternal or supplier-related code when available
external.messagegetQuoteLogsFromBookExternal or supplier-related message when available

Main Log Data Fields​

The logData object contains the main trace metadata returned by Logging API queries.

FieldReturned ByDescription
timestampgetLogs, getLogsByReferenceDate and time when the logged transaction was recorded
execTimegetLogsTransaction duration at the integration level
apigetLogsAPI where the transaction was processed, for example hotel
buyer.codegetLogsBuyer organization code associated with the transaction
seller.codegetLogsSeller organization code associated with the transaction
access.accessData.codegetLogsAccess code used by the Buyer for the connection
client.clientData.name / client.clientData.codegetLogsBuyer-defined client metadata used to categorize the traffic
errorCodegetLogsPlatform error code associated with the transaction
errorTypegetLogsError classification returned for the transaction
operationCodegetLogsSpecific operation or method code processed in the transaction
operationTypegetLogs, getLogsByReferenceOperation family such as SEARCH, QUOTE, BOOKING, or CANCEL
sessionIDgetLogs, getLogsByReferenceSession identifier used to correlate related transactions
trafficTypegetLogsTraffic category associated with the transaction
filesAll three queriesAvailable downloadable trace files for the transaction

Examples​

In the following examples, you can see how to extract different types of logs using the interactive playground.

Example 1: Search Logs (getLogs)​

Use this query to perform general searches based on time ranges and filters.

Query:

query getLogs($input: LoggingLogsWhereInput!) {
logging {
getLogs(limit: 10, where: $input) {
totalCount
adviseMessage {
code
description
level
}
edges {
node {
logData {
timestamp
execTime
api
buyer {
code
}
seller {
code
}
access {
accessData {
code
}
}
client {
clientData {
name
code
}
}
errorCode
errorType
operationCode
operationType
sessionID
trafficType
files {
hotelX
legacy
connector
connectorUnencrypted
}
}
}
}
}
}
}

Variables:

{
"input": {
"api": "hotel",
"timeRange": {
"absolute": {
"from": "2026-04-07 09:38:00",
"to": "2026-04-07 10:38:00"
}
},
"mode": "BUYER",
"errorCode_in": [0, 102, 204, 205, 206, 207, 301, 303, 101, 2, 3, 103, 104, 105, 106],
"operationType_in": ["BOOKING"],
"buyer_in": ["BUYER_CODE"],
"seller_in": ["SELLER_CODE"],
"access_in": ["YOUR_ACCESS"]
}
}

Sample Response:

{
"data": {
"logging": {
"getLogs": {
"totalCount": 2,
"adviseMessage": null,
"edges": [
{
"node": {
"logData": {
"timestamp": "2026-04-07 09:42:11",
"execTime": 428,
"api": "hotel",
"buyer": {
"code": "BUYER_CODE"
},
"seller": {
"code": "SELLER_CODE"
},
"access": {
"accessData": {
"code": "YOUR_ACCESS"
}
},
"client": {
"clientData": {
"name": "B2B Web",
"code": "WEB-B2B"
}
},
"errorCode": 0,
"errorType": "NO_ERROR",
"operationCode": "book",
"operationType": "BOOKING",
"sessionID": "f7f11b67-6b50-4bb0-bb56-xxxxxxxxxxxx",
"trafficType": "BASIC",
"files": {
"hotelX": true,
"legacy": false,
"connector": true,
"connectorUnencrypted": false
}
}
}
},
{
"node": {
"logData": {
"timestamp": "2026-04-07 09:44:03",
"execTime": 615,
"api": "hotel",
"buyer": {
"code": "BUYER_CODE"
},
"seller": {
"code": "SELLER_CODE"
},
"access": {
"accessData": {
"code": "YOUR_ACCESS"
}
},
"client": {
"clientData": {
"name": "B2B Web",
"code": "WEB-B2B"
}
},
"errorCode": 204,
"errorType": "APPLICATION",
"operationCode": "book",
"operationType": "BOOKING",
"sessionID": "40dd74b3-0e56-4d7d-8cab-xxxxxxxxxx",
"trafficType": "BASIC",
"files": {
"hotelX": true,
"legacy": false,
"connector": true,
"connectorUnencrypted": false
}
}
}
}
]
}
}
}
}

Response Notes:

  • totalCount shows how many matching log records were found for the requested filter set.
  • edges[].node.logData contains one log record per matching transaction.
  • errorCode, errorType, and operationType are the fastest fields to inspect when diagnosing failed transactions.
  • files tells you which downloadable traces are available for each result.

curl Example:

curl 'https://api.travelgate.com' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_JWT_TOKEN' \
--data-raw '{
"query": "query getLogs($input: LoggingLogsWhereInput!) { logging { getLogs(limit: 10, where: $input) { totalCount adviseMessage { code description level } edges { node { logData { timestamp execTime api buyer { code } seller { code } access { accessData { code } } client { clientData { name code } } errorCode errorType operationCode operationType sessionID trafficType files { hotelX legacy connector connectorUnencrypted } } } } } } }",
"variables": {
"input": {
"api": "hotel",
"timeRange": {
"absolute": {
"from": "2026-04-07 09:38:00",
"to": "2026-04-07 10:38:00"
}
},
"mode": "BUYER",
"errorCode_in": [0, 102, 204, 205, 206, 207, 301, 303, 101, 2, 3, 103, 104, 105, 106],
"operationType_in": ["BOOKING"],
"buyer_in": ["BUYER_CODE"],
"seller_in": ["SELLER_CODE"],
"access_in": ["YOUR_ACCESS"]
}
}
}'

Β 

Example 2: Logs by Reference (getLogsByReference)​

Ideal for finding all logs associated with a specific locator or reference ID.

Query:

query getLogsByRef($where: LoggingLogsByReferenceWhereInput!) {
logging {
getLogsByReference(where: $where) {
edges {
node {
logData {
sessionID
timestamp
operationType
files {
hotelX
legacy
connector
}
}
}
}
}
}
}

Variables:

{
"where": {
"api": "hotel",
"mode": "BUYER",
"timeRange": {
"absolute": {
"from": "2026-04-14 00:00:00",
"to": "2026-04-15 00:00:00"
}
},
"reference": {
"supplier": "SUPPLIER_LOCATOR_HERE"
}
}
}

Sample Response:

{
"data": {
"logging": {
"getLogsByReference": {
"edges": [
{
"node": {
"logData": {
"sessionID": "9ffb5416-249f-4916-b9f0-xxxxxxxxxxxx",
"timestamp": "2026-04-14 08:17:22",
"operationType": "BOOKING",
"files": {
"hotelX": true,
"legacy": false,
"connector": true
}
}
}
},
{
"node": {
"logData": {
"sessionID": "9ffb5416-249f-4916-b9f0-xxxxxxxxxxx",
"timestamp": "2026-04-14 08:16:58",
"operationType": "QUOTE",
"files": {
"hotelX": true,
"legacy": false,
"connector": true
}
}
}
}
]
}
}
}
}

Response Fields:

  • logData.sessionID (ID): Session identifier shared by related transactions in the same flow.
  • logData.timestamp (DateTime): Date and time when the matching record was logged.
  • logData.operationType (OperationType): Flow stage represented by the returned record, such as QUOTE or BOOKING.
  • logData.files (LoggingFiles): Downloadable traces available for that reference match.
note

getLogsByReference is especially useful when you want to reconstruct the transaction sequence for a known locator. If the same sessionID appears in multiple rows, review the timestamp and operationType fields together to understand the order of events.

curl Example:

curl 'https://api.travelgate.com' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_JWT_TOKEN' \
--data-raw '{
"query": "query getLogsByRef($where: LoggingLogsByReferenceWhereInput!) { logging { getLogsByReference(where: $where) { edges { node { logData { sessionID timestamp operationType files { hotelX legacy connector } } } } } } }",
"variables": {
"where": {
"api": "hotel",
"mode": "BUYER",
"timeRange": {
"absolute": {
"from": "2026-04-14 00:00:00",
"to": "2026-04-15 00:00:00"
}
},
"reference": {
"supplier": "SUPPLIER_LOCATOR_HERE"
}
}
}
}'

Β 

Example 3: Quote Logs from Booking (getQuoteLogsFromBook)​

Use this to find the specific Quote log that originated a known Booking session.

Query:

query getQuoteLogsFromBook($input: LoggingQuoteLogFromBookInput!) {
logging {
getQuoteLogsFromBook(where: $input) {
adviseMessage {
code
description
correlationID
level
external {
code
message
}
}
logData {
files {
legacy
hotelX
connector
}
}
}
}
}

Variables:

{
"input": {
"timeRange": {
"absolute": {
"from": "2026-04-09 03:49:00",
"to": "2026-04-10 09:49:00"
}
},
"sessionId": "9ffb5416-249f-4916-b9f0-xxxxxxxx",
"buyer": "BUYER_CODE",
"seller": "SELLER_CODE",
"mode": "BUYER",
"api": "hotel"
}
}

Sample Response:

{
"data": {
"logging": {
"getQuoteLogsFromBook": {
"adviseMessage": [
{
"code": "TRACE_INFO",
"description": "Quote trace found for the requested booking session.",
"correlationID": "1234567890",
"level": "INFO",
"external": null
}
],
"logData": {
"files": {
"legacy": false,
"hotelX": true,
"connector": true
}
}
}
}
}
}

Response Fields:

  • adviseMessage.code (ID): Internal message code associated with the trace lookup result.
  • adviseMessage.description (String): Human-readable explanation of the lookup outcome.
  • adviseMessage.correlationID (ID): Correlation identifier that can be used in support investigations.
  • adviseMessage.level (AdviseMessageLevel): Severity of the returned message.
  • logData.files (LoggingFiles): Trace files available for the Quote associated with the requested Booking session.
note

getQuoteLogsFromBook does not return the full quote payload inline. Instead, it tells you which trace files are available so you can download and inspect the Quote-side HotelX, Legacy, or Connector logs for the booking flow.

curl Example:

curl 'https://api.travelgate.com' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer YOUR_JWT_TOKEN' \
--data-raw '{
"query": "query getQuoteLogsFromBook($input: LoggingQuoteLogFromBookInput!) { logging { getQuoteLogsFromBook(where: $input) { adviseMessage { code description correlationID level external { code message } } logData { files { legacy hotelX connector } } } } }",
"variables": {
"input": {
"timeRange": {
"absolute": {
"from": "2026-04-09 03:49:00",
"to": "2026-04-10 09:49:00"
}
},
"sessionId": "9ffb5416-249f-4916-b9f0-xxxxxxxx",
"buyer": "BUYER_CODE",
"seller": "SELLER_CODE",
"mode": "BUYER",
"api": "hotel"
}
}
}'

Β 

Frequently Asked Questions​

Why can't I find my error logs by reference?
Failed bookings or cancellations cannot be retrieved using locators. You must use the Time Range filter combined with the specific error code.