Tech blog
Designing a middleware layer for heterogeneous airline APIs
When integrating with multiple low-cost carriers (LCCs) and global distribution systems (GDS), you quickly realize no two airline APIs look alike. Some expose legacy SOAP/XML services with complex session tokens, while others provide modern NDC-compliant JSON endpoints.
Here is the architectural pattern that worked best for our B2B travel platform:
1. Canonical Domain Model: Never allow vendor-specific data structures into your business logic. We define a single FlightSearchRequest, Itinerary, FareRule, and BookingSession model.
2. Provider Adapter Pattern: Each airline has an adapter implementing an interface: search(), quote(), createOrder(), pay(), and issueTicket().
3. Smart Caching & Circuit Breaking: External airline endpoints can be sluggish during peak hours. In-memory caching for route network and fare rules reduced redundant external round-trips by over 40%.
4. Asynchronous Queue for Ancillaries: Baggage, meals, and seat selection are handled as decoupled ancillary tasks to prevent checkout stalls.
2 approved replies
Great breakdown! How do you handle session expiration when booking via SOAP airline systems like Air Arabia or Amadeus?
We use a redis-backed session lease with heartbeat pings for the booking window. If the session expires during passenger entry, the adapter re-quotes in the background before committing the PNR.