Getting Started with the Xeni Activities APIHow to Book an ActivityHow to Browse Activity Tags and CategoriesHow to Cancel an Activity BookingHow to Check Activity AvailabilityHow to Get Activity DetailsHow to Retrieve Activity Booking DetailsHow to Search for Activities with FiltersHow to Search for Activity DestinationsCar Rental API - Getting StartedCar Rental API - Understanding Response FieldsHow to Book a Car RentalHow to Get Rental Car Details and Equipment Add-OnsHow to Retrieve or Cancel a Car Rental BookingHow to Search for Available Rental CarsHow to Search for Pickup LocationsHow to Use Car Rental Search FiltersDeals API Best Practices for IntegrationDeals API Frequently Asked QuestionsGetting Started with the Xeni Deals APIDeals API Request Parameters and Headers ReferenceDeals API Supported Currencies and LocalizationHow to Display Deals in Your ApplicationHow to Fetch Hotel Deals by LocationFlights API Error Codes and TroubleshootingGetting Started with the Xeni Flights APIHow to Book a FlightHow to Check Flight Availability and PricingHow to Confirm or Cancel a Flight BookingHow to Retrieve Fare Rules for a FlightHow to Retrieve Flight Booking DetailsHow to Search for Airports Using AutocompleteHow to Search for FlightsHow to Use Flight Search Filters, Sorting, and PaginationHow to Check Room Availability and PricingHow to Filter Vacation Rental ResultsHow to Get Resort Property Details, Amenities, and AccessibilityHow to Hold and Confirm a Resort BookingHow to Release a Resort HoldHow to Retrieve Resort Booking DetailsHow to Search for Available ResortsHow to Search for Resort DestinationsHow to Search for Vacation Rental LocationsHow to Search for Vacation RentalsHow to Use Resort Search Filters and SortingGetting Started with the Xeni Resorts APIResorts API: Understanding Booking Statuses and PoliciesGetting Started with the Vacation Rentals APIVacation Rentals Frequently Asked QuestionsVacation Rentals Supported Property TypesUnderstanding Async Search for Vacation RentalsAuthentication & API SignaturesBooking Hotels — Direct API & SSO CheckoutError Handling, Rate Limits & Best PracticesGetting Started with the Xeni Hotels APIManaging Bookings: Status, Retrieval & CancellationPricing Confirmation & Token LifecycleRetrieving Hotel Details & Room AvailabilitySearching for Hotels: Locations, Filters & PaginationSearching for HotelsSession Management & Correlation IDsAPI authentication and getting your API keys

How to Book a Flight

Last updated: 2026-03-03

How to Book a Flight

The booking endpoint creates a new flight reservation. You need the cabinavailabilitytoken from the availability check and complete traveler information for all passengers.

Endpoint

POST /flights/api/v2/bookings

Headers

HeaderRequiredDescription
x-api-keyYesYour API key.
x-correlation-idYesCorrelation ID from the autocomplete response.

Request Body

FieldTypeRequiredDescription
cabinavailabilitytokenstringYesToken from the availability endpoint.
travelerinfoarrayYesArray of traveler objects. One entry per passenger.
countrycodestringYesContact phone country code (e.g., "1" for US).
areacodestringYesContact phone area code (e.g., "415").
phonenumberstringYesContact phone number.
emailstringYesContact email address for booking confirmations.
post_codestringNoBilling postal/ZIP code.
currencystringNoPreferred currency code (e.g., "USD").

Traveler Info Object

FieldTypeRequiredDescription
typestringYesPassenger type: "ADULT", "CHILD", or "INFANT".
genderstringYes"Male" or "Female".
titlestringYes"Mr", "Mrs", "Ms", or "Miss".
firstnamestringYesTraveler's first name (as on ID/passport).
lastnamestringYesTraveler's last name (as on ID/passport).
dateofbirthstringYesDate of birth in YYYY-MM-DD format.
passportobjectConditionalPassport details. Required if ispassportrequired was true in the availability response.
passengernationalitystringNoNationality (ISO country code, e.g., "US").
nationalidstringNoNational ID number (for domestic flights where applicable).
extraservicesarrayNoOptional add-on services.
frequentflyernumberstringNoFrequent flyer program number.
knowtravelernostringNoKnown Traveler Number (TSA PreCheck / Global Entry).
redressnostringNoRedress control number (DHS).

Passport Object

FieldTypeRequiredDescription
passportnumberstringYesPassport number.
expirydatestringYesPassport expiry date in YYYY-MM-DD format.
countrystringYesIssuing country (ISO country code, e.g., "US").

Extra Services Object

FieldTypeDescription
service_idstringID of the extra service (e.g., additional baggage, seat selection).
quantityintegerNumber of units for this service.

Example Request

JSON
{
  "cabinavailabilitytoken": "cat_xyz789abc123",
  "traveler_info": [
    {
      "type": "ADULT",
      "gender": "Male",
      "title": "Mr",
      "first_name": "John",
      "last_name": "Smith",
      "dateofbirth": "1985-06-15",
      "passport": {
        "passport_number": "AB1234567",
        "expiry_date": "2030-12-31",
        "country": "US"
      },
      "passenger_nationality": "US",
      "frequentflyernumber": "UA123456789",
      "knowtravelerno": "12345678",
      "extra_services": [
        {
          "serviceid": "extrabag_23kg",
          "quantity": 1
        }
      ]
    },
    {
      "type": "CHILD",
      "gender": "Female",
      "title": "Miss",
      "first_name": "Emma",
      "last_name": "Smith",
      "dateofbirth": "2018-03-22",
      "passport": {
        "passport_number": "CD7654321",
        "expiry_date": "2031-06-30",
        "country": "US"
      },
      "passenger_nationality": "US"
    }
  ],
  "country_code": "1",
  "area_code": "415",
  "phone_number": "5551234",
  "email": "john.smith@example.com",
  "post_code": "94105",
  "currency": "USD"
}

Example Response

JSON
{
  "status": "success",
  "data": {
    "booking_id": "XNFiEtVA3LL",
    "booking_status": "BOOKED",
    "tickettimelimit": "2026-04-14T23:59:00Z"
  },
  "message": "Booking created successfully"
}

Response Fields

FieldTypeDescription
bookingidstringUnique booking identifier. Use this to confirm, cancel, or retrieve the booking.
bookingstatusstring"BOOKED" (held, awaiting confirmation) or "TICKETED" (already ticketed).
tickettimelimitstringDeadline to confirm the booking before it is automatically cancelled. ISO 8601 format.

Booking Statuses

StatusDescription
BOOKEDBooking is created and held. Must be confirmed before the tickettimelimit to issue tickets.
TICKETEDTickets have been issued. The booking is fully confirmed.

Important Notes

  • Traveler names must match official ID. Names should exactly match the passport or government ID used for travel.
  • Passport details are conditionally required. Check the ispassportrequired field from the availability response. International flights typically require passport data.
  • Confirm before the time limit. If the booking status is BOOKED, you must confirm it before the tickettimelimit or the reservation will be released.
  • One traveler entry per passenger. The number of entries in traveler_info must match the total of adults + children + infants from the original search.
  • Infants do not get their own seat. Infants are seated on the lap of an accompanying adult.

Related Articles

Was this article helpful?