Getting Started with the Xeni Flights API
The Xeni Flights API v2 provides programmatic access to global flight inventory. You can search for airports, query available flights, check availability and fare rules, and complete bookings entirely via API.
What You Can Do
The Flights API supports the full booking lifecycle:
- Search airports — Use autocomplete to resolve airport names or IATA codes to structured airport data.
- Search flights — Query available flights by route, dates, passenger counts, cabin class, and apply filters for stops, airlines, departure times, and more.
- Check availability — Retrieve detailed flight segments, real-time pricing, and passport requirements for a selected cabin.
- View fare rules — Inspect cancellation and exchange policies, including structured penalty details per passenger type.
- Create bookings — Submit traveler information, passport details, and optional extra services to book a flight.
- Manage bookings — Confirm, cancel, or retrieve booking details by booking ID.
Base URL
All Flights API v2 endpoints use the following base path:
{{api_host}}/flights/api/v2/...
Replace {{api_host}} with your environment-specific host (UAT or production), provided during onboarding.
Authentication
Every request to the Flights API requires the following header:
| Header | Description |
|---|---|
x-api-key | Your unique API key, provided during onboarding. |
Some endpoints also require:
| Header | Description |
|---|---|
x-correlation-id | A correlation ID captured from the autocomplete response headers. Required for search and downstream endpoints. |
If you have not received your API key, contact your Xeni account representative.
The Booking Flow
The Flights API uses a token chaining pattern. Each step in the flow produces a token or ID that is required by the next step.
1. Autocomplete
└── Captures x-correlation-id from response headers
- Search
└── Returns cabinsearchsession_id (per cabin option)
- Availability
└── Returns cabinavailabilitytoken
- Fare Rules (optional)
└── Uses cabinavailabilitytoken
- Create Booking
└── Uses cabinavailabilitytoken
└── Returns booking_id
- Confirm / Cancel / Get Booking
└── Uses booking_id
Step-by-Step Summary
- Autocomplete — Resolve airport names or codes. Capture the
x-correlation-idfrom the response headers for use in subsequent requests. - Search — Submit origin, destination, dates, passengers, and cabin type. The response includes flight options, each with one or more cabin entries containing a
cabinsearchsession_id. - Availability — Pass a
cabinsearchsessionidto get detailed segment information, final pricing, and acabinavailability_token. - Fare Rules — Pass the
cabinavailabilitytokento retrieve cancellation and exchange policies before booking. - Create Booking — Submit the
cabinavailabilitytokenalong with traveler details to create a booking. The response includes abooking_id. - Confirm or Cancel — Use the
booking_idto confirm the booking (issue tickets) or cancel it.
API Endpoints at a Glance
| Method | Endpoint | Purpose |
|---|---|---|
| GET | /flights/api/v2/autocomplete | Search airports by name or IATA code |
| POST | /flights/api/v2/search | Search for available flights |
| GET | /flights/api/v2/availability/{cabinsearchsessionid} | Check availability and pricing |
| GET | /flights/api/v2/farerules/{cabinavailabilitytoken} | Retrieve fare rules and penalties |
| POST | /flights/api/v2/bookings | Create a new booking |
| GET | /flights/api/v2/bookings?bookingid={id} | Retrieve booking details |
| PATCH | /flights/api/v2/bookings/{booking_id} | Confirm or cancel a booking |
Next Steps
- How to Search for Airports Using Autocomplete — Start by resolving airport codes.
- How to Search for Flights — Learn how to query available flights.
- Flights API Error Codes and Troubleshooting — Reference for error handling across all endpoints.