Skip to content
Blog

Travel API authentication and security: where tenants leak

Tekravel Editorial
Written with the help of AI

A developer at one of your partner agencies is testing their integration on a Tuesday afternoon. They notice that the booking-list endpoint takes an agencyId in the query string, and out of curiosity they change it from 114 to 115. The response comes back with someone else's bookings: passenger names, PNRs, and the net fare that agency paid before its markup. Nobody attacked anything. The API simply believed what the client told it. That one afternoon is most of what travel API authentication and security is really about, and it is why the subject deserves more care than the login screen usually gets.

Multi-tenant travel APIs leak in a small number of predictable ways. They are worth naming one at a time, because each has a design answer that costs far less before launch than after it.

The tenant is not a parameter

The mistake in the opening is not a missing check. It is a design that asks the caller who they are and then trusts the answer. In a single-tenant system that is merely untidy. In a platform where dozens of agencies, sub-agents and white-label sites share one database, it is the whole security model resting on the honesty of every integrator who will ever hold a key.

The rule that removes the entire class of bug: the tenant comes from the credential, never from the request. When a key or token is verified, the server resolves which tenant it belongs to, which office inside that tenant, and which roles the caller holds. From then on every query runs inside that scope. A request body may still carry an agency id for legitimate reasons — a consolidator creating a booking on behalf of one of its sub-agents, for instance — but the server checks that id against the scope the credential already established. It never widens the scope because a field asked it to.

In practice, three things live on the server side:

  • Scoping at the data layer, not in each handler. A filter applied automatically to every query on tenant-owned tables means a developer who forgets the where clause gets an empty result, not somebody else's data. Handler-by-handler checks fail the first time someone adds an endpoint in a hurry.
  • Object-level checks on every id in the path. GET /bookings/98231 must confirm that booking 98231 belongs to the caller's scope. Sequential ids make this the most common hole in travel APIs, because booking numbers and PNR references are easy to guess.
  • The same answer for "not yours" and "does not exist". Return 404 for another tenant's booking. A 403 confirms the record is real, and that alone is information a competitor would like to have.

Escape hatches deserve the same discipline. Most platforms need an operator view that reads across tenants — support staff, finance, the platform owner. Make that a separate role, granted in code and logged when used, not a query flag any authenticated caller can set. For how a client integration should behave around these boundaries, the piece on flight booking API integration covers the request side.

Supplier credentials never reach a browser

A travel platform holds two kinds of secret. The first is yours: the keys you issue to partners. The second belongs to your relationship with suppliers — GDS office credentials, NDC aggregator tokens, bedbank API keys, often bound to a contract that names your company and your IATA number. Every request made with them is, as far as the supplier is concerned, a request from you.

Those credentials have exactly one safe home: a server process that talks to the supplier on the caller's behalf. They do not belong in a single-page app's JavaScript bundle, in a mobile app binary, in a config file served to the browser "just for the search page", or in an error message returned when the supplier call fails. Every one of those has been the leak somewhere. Anyone can open the network tab, and an app binary can be unpacked by anyone who wants to.

The consequences are worse than a bill. A leaked supplier key lets a stranger search, and sometimes book, against your account — burning the look-to-book ratio the supplier measures you on and, in the bad case, issuing against your credit. The supplier will not distinguish that traffic from yours. The usual outcome is a suspended account while you prove it was not you, which for an agency that sells mostly one carrier or one bedbank means a closed shop for the duration.

Two smaller rules follow. The client never chooses which supplier account a request goes through; the server picks it from the tenant's configuration. And supplier error bodies are translated before they leave your API, because raw supplier errors sometimes echo request headers straight back.

What a leaked net fare actually costs

Developers tend to rank data leaks by how personal the data is. In travel distribution the commercially dangerous field is often the price. A net fare or net rate is the number your supplier agreed to give you on condition that it is not shown to the public, and the gap between it and the selling price is your margin and your sub-agents' margin. The table below is a rough ranking. You may weigh the rows differently for your own business, and that disagreement is worth having with your team before an incident rather than during one.

What leaksWho usually finds itWhat it costs you
Net fare inside a B2C search response (hidden in the JSON, not on screen)Competitors scraping, curious customersRate parity complaints from the supplier, and customers asking why they paid the published price
Another sub-agent's markup or net priceSub-agents comparing notesPricing reopened across the whole network; the agent who got the better deal becomes the story
Supplier credentials in a client bundleAnyone who looksTraffic and bookings on your account, possible suspension while it is investigated
Enumerable booking or PNR idsScrapers, occasionally journalistsPassenger data exposure, which carries regulatory weight well beyond the commercial loss
Credit limits and balances of other agenciesPartners, competitorsYour network's weakest accounts become a target for poaching

The first row is the one teams miss, because the screen looks correct. The page shows the selling price; the response that fed it carries the net and the markup as separate fields because the frontend "might need them". Shape responses per audience on the server. A B2C caller gets a selling price and nothing that lets anyone subtract. The article on distributing net fares to sub-agents explains why that gap is the very thing a consolidator sells.

Rotating credentials without downtime

Every credential will need replacing. A developer leaves a partner agency, a key turns up in a public repository, a supplier rotates on its own schedule. If rotation means "change it and everything breaks until the partner redeploys", nobody rotates, and keys live for years.

Design for overlap from day one. Each partner can hold two active keys at once: they create the new one, deploy it, watch their traffic move across, and only then revoke the old one. For that to work the platform needs a few unglamorous pieces:

  1. A visible key identifier — a prefix or id stored next to the secret — so logs and support tickets can say which key made a call without anyone seeing the secret itself.
  2. Secrets stored as hashes, shown once at creation and never again. If your support team can read a partner's key, so can anyone who compromises your support tooling.
  3. A last-used timestamp per key, so the partner can see that the old one has gone quiet before revoking it.
  4. Revocation that takes effect immediately, including in any cache sitting in front of authentication.

Supplier credentials need the same overlap in the other direction. Keep them in a secrets store or encrypted configuration that the running service re-reads, not baked into a build, so the switch is a configuration change rather than a deployment. Short-lived access tokens on top of long-lived keys help as well: if a token leaks, it expires before most people would notice it was gone.

Rotation is also where the logging pays for itself. Recording which key and which tenant made each call — without recording the secret or the passenger's payment data — is what lets you answer "was it us?" in an hour instead of a week.

Before you hand a partner a key

A short list, because the long version is the rest of this piece:

  • Can anything in the request change the key's tenant? It should not.
  • Does every endpoint that takes an id check ownership, and answer 404 when that check fails?
  • Is any supplier credential, or any field derived from one, reachable from a browser?
  • Does a B2C response contain a net price or markup anywhere, hidden fields included?
  • Can the partner rotate without calling you, and can you revoke without calling them?

How access to our API is handled

The platform behind this blog exposes flight and hotel APIs. Every tenant on it already runs with its own admin panel, its own bookings and role-based staff permissions, and supplier content reaches a tenant through supplier groups rather than one-to-one deals. Access to the API starts as a conversation rather than a self-serve key, partly for the reasons above: we would rather know who is integrating, and for which market, before a credential exists. The travel APIs page describes what is available and how that conversation starts.

Tekravel Editorial

Travel technology desk

The Tekravel travel-technology desk writes for the trade: agency owners, consolidators and the developers who integrate them. Every article is checked against the platform it describes before it is published.