Search Flights (Rates)

How to call POST /flights/rates: auth header, legs-based request shape, one-way and round-trip examples, and common errors.

This page is the partner-facing guide for flight search. The OpenAPI operation post_flights-rates is the source of truth for field names and types — quote that reference if anything here disagrees.

Auth and base URL

ItemValue
Base URLhttps://api.liteapi.travel/v3.0
AuthHeader X-API-Key: <your_api_key> (same key family as hotels)
Method / pathPOST /flights/rates

Flights must be enabled for the key and environment. A 401 on flights while hotels work usually means flights is not enabled for that key — not a wrong header name. Request enablement via the dashboard (Request Assistance); do not paste API keys into tickets or chat.

Keep production keys on a trusted server. Do not embed them in browser or mobile apps.

Request shape (required)

Required top-level fields (OpenAPI):

  • legs (array) — ordered itinerary
  • adults (integer) — passengers aged 12+
  • currency (string) — ISO 4217

Each leg requires:

  • origin — airport or city IATA
  • destination — airport or city IATA
  • date — YYYY-MM-DD (not more than 11 months from today)

Optional but commonly used: children, infants, childrenAges, infantAges, cabinClass, country (point of sale), filters, sort, margin.

Not supported at the top level: origin, destination, departureDate, returnDate. Put those on each legs[] entry.

Trip typelegs
One-wayOne entry
Round-tripOutbound then inbound (direction: OUTBOUND / INBOUND optional)
Multi-cityOne entry per segment, in travel order

Example — one-way

curl -X POST "https://api.liteapi.travel/v3.0/flights/rates" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
    "legs": [
      {
        "origin": "JFK",
        "destination": "LHR",
        "date": "2026-12-10"
      }
    ],
    "adults": 1,
    "currency": "USD",
    "country": "US"
  }'

Example — round-trip

curl -X POST "https://api.liteapi.travel/v3.0/flights/rates" \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
    "legs": [
      {
        "origin": "JFK",
        "destination": "CDG",
        "date": "2026-07-01",
        "direction": "OUTBOUND"
      },
      {
        "origin": "CDG",
        "destination": "JFK",
        "date": "2026-08-02",
        "direction": "INBOUND"
      }
    ],
    "adults": 1,
    "currency": "USD",
    "country": "US",
    "filters": {
      "maxStops": 1,
      "refundableOnly": false
    },
    "sort": {
      "sortBy": "price",
      "sortOrder": "asc"
    }
  }'

What you get back

A successful 200 returns data with journeys and offers from the live search. Use each offer’s offerId verbatim for verify → prebook → book (see Build a Flight Booking Experience).

Pricing on offers follows the Flights FlightPrice schema:

  • base, taxes, fees — supplier amounts (never include partner markup)
  • total — selling price including partner markup (and platform fees when present)

Offers can expire. Prefer SSE (Accept: text/event-stream) when you want incremental provider batches.

Common errors

HTTPMeaning (typical)
400Missing or invalid search parameters
401Missing/invalid key, or flights not enabled for this key
429Account / key rate limit — see Rate Limiting
502 / 503Provider or service unavailable — retry with backoff

Search failure code 51099 (“unable to process search request”) is a search failure you cannot self-trace from Ask Connect — collect UTC time, env, request body shape (redacted), and open Request Assistance.

Next steps

  1. Pick an offerId from search.
  2. Verify the offer.
  3. Prebook, optionally attach seats/bags, then book.

Canonical schema and examples: POST /flights/rates.


Did this page help you?