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

Flights API Error Codes and Troubleshooting

Last updated: 2026-03-03

Flights API Error Codes and Troubleshooting

This article covers error responses you may encounter across all Flights API v2 endpoints, along with common issues and how to resolve them.

HTTP Status Codes

Status CodeMeaningDescription
200OKRequest succeeded.
400Bad RequestThe request is malformed, missing required fields, or contains invalid values.
401UnauthorizedMissing or invalid x-api-key.
403ForbiddenYour API key does not have permission for this endpoint or action.
404Not FoundThe requested resource does not exist (e.g., invalid booking ID or expired token).
422Unprocessable EntityThe request is well-formed but contains semantic errors (e.g., departure date in the past).
429Too Many RequestsRate limit exceeded. Slow down your request rate.
500Internal Server ErrorAn unexpected error occurred on the server. Retry the request.
502Bad GatewayUpstream service temporarily unavailable. Retry after a short delay.
503Service UnavailableThe API is temporarily down for maintenance. Retry later.

Error Response Format

All error responses follow a consistent format:

JSON
{
  "status": "error",
  "data": null,
  "message": "A human-readable description of the error."
}

Errors by Endpoint

Autocomplete

ErrorCauseResolution
400 - Invalid key parameterThe key query parameter is missing, empty, or contains invalid characters.Provide a valid airport name or IATA code with at least 1 character.
500 - Internal server errorUnexpected server failure.Retry the request. If the issue persists, contact support.

Search

ErrorCauseResolution
400 - Missing required fieldsRequired fields like flightinfo, routetype, cabintype, or adults are missing.Check your request body against the required fields documented in How to Search for Flights.
400 - Invalid routetyperoutetype is not "Oneway" or "Return".Use exactly "Oneway" or "Return" (case-sensitive).
400 - Invalid cabintypecabintype is not one of the accepted values.Use "economy", "business", "premium", or "first" (lowercase).
400 - Invalid date formatdeparturedate is not in YYYY-MM-DD format.Use the format YYYY-MM-DD.
400 - Missing x-correlation-idThe x-correlation-id header is not present.Capture the x-correlation-id from the autocomplete response headers and include it in your search request.
422 - Departure date in the pastThe departure date has already passed.Use a future date.
422 - Invalid passenger countInfant count exceeds adult count, or passenger count is zero.Ensure at least 1 adult. Infants cannot exceed the number of adults.

Availability

ErrorCauseResolution
404 - Session not foundThe cabinsearchsessionid is invalid or has expired.Run a new search to obtain a fresh cabinsearchsessionid. Search sessions expire after a period of inactivity.
400 - Missing x-correlation-idThe correlation ID header is missing.Include the x-correlation-id header.

Fare Rules

ErrorCauseResolution
404 - Token not foundThe cabinavailabilitytoken is invalid or has expired.Run a new availability check to obtain a fresh token.

Create Booking

ErrorCauseResolution
400 - Missing traveler informationRequired traveler fields are missing or incomplete.Ensure every traveler has type, gender, title, firstname, lastname, and dateofbirth.
400 - Missing passport detailsPassport details are required but not provided.If ispassportrequired was true in the availability response, include passport with passportnumber, expirydate, and country for each traveler.
400 - Invalid tokenThe cabinavailabilitytoken is invalid or expired.Run a new availability check. Tokens have a limited validity window.
400 - Passenger count mismatchThe number of entries in traveler_info does not match the passenger count from the original search.Ensure the array length equals adults + children + infants.
422 - Token expiredThe availability token has expired since it was issued.Request a new availability check and proceed with the fresh token.

Confirm / Cancel Booking

ErrorCauseResolution
404 - Booking not foundThe bookingid does not exist.Verify the booking ID is correct.
400 - Invalid bookingstatusThe booking_status value is not "Confirm" or "Cancel".Use exactly "Confirm" or "Cancel" (case-sensitive).
422 - Booking already cancelledAttempting to confirm or modify a cancelled booking.The booking cannot be modified once cancelled. Create a new booking.
422 - Booking already ticketedAttempting to confirm an already ticketed booking.The booking is already confirmed. No further action is needed.
422 - Ticket time limit exceededThe ticket time limit has passed for a BOOKED reservation.The reservation has been released. Create a new booking.

Get Booking Details

ErrorCauseResolution
400 - Missing bookingidThe bookingid query parameter is missing.Include booking_id as a query parameter.
404 - Booking not foundNo booking exists with the given ID.Verify the booking ID.

Common Issues and Troubleshooting

"Missing x-correlation-id" on every request after autocomplete

The x-correlation-id is returned in the response headers (not the response body) of the autocomplete call. Make sure your HTTP client captures response headers and forwards the value to subsequent requests.

Search returns empty results

  • Verify the origin and destination airport codes are valid IATA codes.
  • Check that the departure date is in the future.
  • Try broadening your filters (remove stop or airline restrictions).
  • Ensure cabin_type matches available inventory for the route.

"Session not found" on availability check

Search sessions expire after a period of inactivity. If too much time has passed since the search, run a new search to get a fresh cabinsearchsession_id.

"Token expired" when creating a booking

The cabinavailabilitytoken has a limited validity window. Complete the booking promptly after the availability check. If the token expires, run the availability check again.

Booking status remains "TICKETINPROCESS"

Ticketing can take a few moments to complete. Poll the Get Booking Details endpoint at reasonable intervals (e.g., every 10-15 seconds) to check for a final status.

Cancellation penalties applied unexpectedly

Review the fare rules before cancelling. Use the Fare Rules endpoint to check whether the fare is cancellable and what penalties apply per passenger type.

Best Practices

  • Always capture the x-correlation-id from autocomplete response headers and pass it through the entire flow.
  • Handle token expiration gracefully. Build retry logic that re-runs availability checks when tokens expire.
  • Validate inputs before sending requests. Check date formats, required fields, and passenger counts on the client side to reduce 400 errors.
  • Implement exponential backoff for 429, 500, 502, and 503 errors.
  • Log correlation IDs. Include the x-correlation-id in your logs to help Xeni support trace issues across the flow.

Getting Help

If you encounter persistent errors or unexpected behavior, contact Xeni support at customersupport@xeni.com with:

  • The x-correlation-id for the affected request chain
  • The full request and response (with sensitive data redacted)
  • The endpoint and HTTP method
  • Timestamps of when the error occurred

Related Articles


Was this article helpful?