● Travel Never Stops. Neither Do We. 365 Days a Year.

Flight Search API Design for Passenger Age and Seating Needs

Model passenger ages, lap infants and seating requirements accurately from search through offer refresh.

A parent holding an infant and standing with a child speaks to an airport check-in agent.

A reliable flight search api cannot treat every traveller as an interchangeable seat. A family search may contain adults, children at different ages, and an infant whose caregiver expects to hold them rather than purchase a separate seat. Those details influence which requests can be searched, how an offer should be interpreted, and whether the same party remains eligible when the itinerary changes.

Start with people, not fare labels

Passenger models commonly become unreliable when their only persistent fields are an adult count, a child count, and an infant count. Those totals are convenient search controls, but they conceal the individual whose birthday changes a category or whose lap arrangement requires an accompanying adult. A count cannot answer which child turned older, which infant needs a seat, or which association must be checked again.

Use a stable, internal passenger identifier for every traveller, including a lap infant. Store the intended occupancy separately from the passenger's age facts. A useful internal record can contain a traveller reference, the age evidence available, the evaluation date and rule source, the proposed provider category, a seating intention, and any responsible-adult association. Keep these concepts separate even if a supplier request combines some of them.

Similarly, distinguish a customer's preference from an accepted condition. “Infant will sit on adult's lap” is an intention at search entry. It becomes a supported booking arrangement only when applicable carrier rules and the selected offer permit it. A seat request, a reserved seat, and permission to occupy that seat are three different states.

Keep category, age, and occupancy separate

An age is a fact about a person on a specified date. An adult, child, or infant label is a classification under a particular product's rules. Seating describes how that person is expected to travel. A child might have a seat even when a fare category name changes; a young traveller might require a paid seat despite a user first choosing the infant counter.

Choose age inputs according to the search decision

A flight search api should ask for enough passenger information to produce a meaningful request, but not automatically demand identity documents or full birth dates from every visitor. Some integrations accept an age for younger passengers during search, whereas the booking stage may require a complete date of birth and other personal details. The right amount of data changes with the decision being made.

For a concrete integration reference, Duffel's Getting Started with Flights guide demonstrates a search request using type: "adult" for adults and an age value for a younger passenger. It says passengers under 18 need an age at search, while more complete passenger information is collected for booking. That is an explanation of this documented flow, not evidence that every provider accepts identical fields.

At the interface, an adult counter may be enough for an initial anonymous search when supported. For younger travellers, ask for an age tied to a clear journey date, or a birth date if exact eligibility across multiple dates cannot otherwise be resolved. If the system only knows “one child,” it should not silently invent that child's age or pretend all possible ages price identically.

Age-only input can minimize information retained during early shopping. However, “age 11” without a reference date is ambiguous. Was the age reported today, on outbound departure, or at arrival? Include an explicit basis such as “age on the first departure date” in the interface and internal calculation. Preserve the basis alongside the value instead of relying on a developer's assumption.

Calculate completed years using a local travel date

If a traveller provides a birth date, calculate completed years at a policy-defined travel date rather than dividing elapsed milliseconds by a fixed year length. Use calendar arithmetic: compare the birthday's month and day with the relevant local date and subtract one year until that year's birthday has occurred. Leap-day birthdays need an expressly selected policy when evaluated in non-leap years.

A date-only journey field should remain a date, not become midnight UTC by default. Converting it through a server timezone can shift a departure into the preceding or following calendar day. When an actual flight segment is known, keep the local departure date and its airport timezone available so the supplier's eligibility boundary can be evaluated consistently.

In preliminary search, you may know only a slice departure date. After selecting an offer, segment dates and connections become visible. That added detail can reveal a birthday between two flights. The application must be ready to revisit earlier classifications instead of treating its original date calculation as permanent.

Treat age bands as provider-specific configuration

Many interfaces display familiar adult, child, and infant labels, but those labels should never be hardcoded into a global pricing assumption. A fare source might describe bands differently, reject a particular age, or apply a boundary using a specific flight date. A connection, a return sector, or an operating carrier may introduce further questions. These are integration questions to verify, not rules to invent.

Configure a provider adapter with the categories and request shapes actually supported by the integrated product. Associate each interpretation with documentation or an approved supplier response, plus a version and effective date when available. Where a supplier has not specified the boundary, return an unresolved eligibility state and request clarification rather than creating an authoritative-looking result.

Ask explicitly about birthdays during the itinerary

Document which date determines eligibility: the first flight's departure, each flight's departure, the last flight, or another supplier-defined milestone. Ask whether a traveller whose birthday occurs during a connection or before the return can remain in one category throughout the booking. Ask whether the same answer applies when different airlines operate the sectors.

Also ask whether a mixed classification can be represented in one round-trip offer request, whether separate tickets would be required, and what happens if an outbound lap infant is no longer eligible as a lap infant for the return. Those questions affect search strategy, ticketing feasibility, total price, and the accuracy of user messages. Do not solve them by splitting a booking automatically.

Duffel's introductory guide describes an infant in its booking discussion by reference to being age zero or one on the date of the last flight, and describes associating infants with responsible adults. That documented example highlights why the journey's end date matters in at least one integration. Other suppliers must be evaluated on their own current documentation and returned validation outcomes.

Model lap infants and occupied seats independently

“Infant” does not necessarily mean “no seat.” Someone searching for a very young traveller may want a separate occupied seat, while another family may request a lap arrangement. Record that intent before sending the supplier request. Then determine whether the selected product actually supports it, including any relevant restraints, booking process, or fare requirements that the supplier documents.

For a lap arrangement, identify the accompanying adult in the domain model. A count of two adults and one infant does not say which adult is responsible. Linking the infant's stable internal identifier to an adult's stable identifier makes it possible to preserve or reject the association when a traveller is removed. It also supports clear review screens without exposing unrelated identity details.

Where the integrated provider defines limits on lap-infant associations, validate those limits at the provider boundary. Duffel's flight booking walkthrough shows a responsible adult referring to an infant's passenger identifier and states that infants need distinct responsible adults in that flow. Do not generalize that specific implementation detail into a worldwide seating or safety rule.

Distinguish an infant's presence in the passenger manifest from the count of occupied seats. The family may contain four people but require only three passenger seats if its lap request is approved. Conversely, an infant with a purchased seat is still a passenger with age-sensitive eligibility. Neither total travellers nor seat quantity alone can reconstruct the original intent.

Keep seat selection separate from seat entitlement

A seating requirement may also mean “sit together,” “aisle preferred,” or “separate seat required,” each of which belongs to a different decision. A requested adjacent-seat arrangement is not a guarantee of assignment. A paid seat-selection ancillary is not proof that an otherwise ineligible traveller may occupy the seat. Keep supplier entitlement checks distinct from preference capture and from confirmed seat assignments.

Use a field contract that explains each value

The table below describes a recommended internal data contract for early search and offer validation. It is not a copy of any provider's API schema. A production adapter should translate these fields only into values that the selected supplier supports, and should apply appropriate access controls to personal data.

Illustrative passenger fields for a flight search and offer-refresh workflow
Field or concept Purpose Validation or handling
Traveller reference Preserves the same person through edits. Unique within the search; mapped to fresh supplier IDs.
Age evidence Stores age on a named date or a birth date when needed. Track precision and the reference date; do not invent birth dates.
Evaluated category Records the current supplier-specific interpretation. Recompute when travel dates, route, or rule source changes.
Seating intention Distinguishes lap request from an occupied seat. Require an explicit choice when it affects eligibility.
Responsible adult Connects a lap-requested traveller with a caregiver. Reference a present, eligible traveller; verify supplier limits.
Validation status Identifies supported, unresolved, or rejected combinations. Attach reason, source, and last checked itinerary version.
A travel adviser sorts cards with passenger silhouettes at her desk.

Worked hypothetical: a family with two birthdays

Consider a fictional family searching New York to Lisbon, leaving 8 June 2027 and returning 17 June 2027. Two adults are travelling with an older child born 12 June 2015 and a younger child born 13 June 2025. The family wants the older child in an occupied seat and initially requests that the younger child travel on an adult's lap. This is an illustration of data handling, not a claim about fares, airline permission, or an available itinerary.

At the first departure, the older child is 11 and the younger child is one. By the return departure, the older child is 12 and the younger child is two. Their ages do not change because the user edits a passenger counter; they change because the itinerary crosses birthdays. The system therefore records two traveller identities, the two date-based evaluations, and the younger child's unconfirmed lap preference.

An illustrative internal request could be represented as follows. The field names are deliberately application-owned, not a proposed Duffel or airline payload:

{
  "journey": {
    "outbound_date": "2027-06-08",
    "return_date": "2027-06-17",
    "from": "NYC",
    "to": "LIS"
  },
  "travellers": [
    {
      "ref": "A1",
      "role": "adult",
      "seat": "required"
    },
    {
      "ref": "A2",
      "role": "adult",
      "seat": "required"
    },
    {
      "ref": "C1",
      "born_on": "2015-06-12",
      "seat": "required"
    },
    {
      "ref": "C2",
      "born_on": "2025-06-13",
      "seat": "lap_requested",
      "responsible_adult": "A1"
    }
  ]
}

At validation, the platform calculates the two younger travellers' ages on the outbound and return dates. It marks both birthdays as category-boundary review points, then asks the active supplier adapter which ages and seating arrangements are representable. In particular, it must not assume that C2 can be booked on a lap for the whole itinerary simply because C2 is one at outbound departure.

The adapter may determine that the proposed combination cannot be searched as entered, or that the customer must request a separate seat for part or all of the journey. Those outcomes require verified supplier behavior. Until that is known, the interface should explain the uncertainty rather than displaying a supposedly confirmed family fare or silently converting the lap request into a paid seat.

Suppose the family changes the return date to 11 June 2027. The earlier evaluation is now obsolete: neither child's birthday has occurred by that return departure. The platform recalculates age states, validates the responsible-adult association, and creates a fresh supplier search if the changed dates materially affect the request. It does not keep an old offer simply because the passenger count remains four.

If the search later returns a connection departing after midnight on a birthday, the platform may need a further policy check using segment-local dates. This does not necessarily mean the classification changes for that particular provider. It means the original slice-date assessment cannot answer every supplier question without information about the chosen itinerary.

Validate in layers, not just at form submission

Good validation begins in the user interface but continues through the supplier adapter and offer review. Frontend checks can reject missing traveller counts, impossible calendar dates, negative ages, contradictory occupancy choices, or a lap request without an associated adult. These checks improve usability, but they cannot independently establish airline eligibility.

A second layer verifies whether the provider supports each requested passenger representation. It maps app-level travellers to supported request categories, checks the documented requirements for the selected journey, and returns explicit errors if the mapping is impossible. Validation should produce structured reason codes rather than a generic “invalid passengers” message, enabling the interface to explain what needs attention.

Use clear error states instead of silent corrections

An error such as “age cannot be determined for the return flight” suggests a different action from “this provider cannot represent the requested lap arrangement.” The former may require a birth date or a better age reference; the latter may require changing the occupancy choice or selecting another search path. Keep messages precise without implying that one provider's rejection defines industry-wide policy.

When an adult is removed, do not automatically reassign a linked lap infant to a different adult without notice. Flag the broken relationship, ask the customer to choose a responsible traveller, and validate it again. When a child becomes an adult under a provider's category rules, preserve the person's reference but recalculate the category and any price-sensitive requirements.

Server validation must repeat critical checks even if the browser already passed them. A stale tab, direct API call, or altered client request can bypass interface controls. Return failures in a stable format with a passenger reference and field context, while avoiding disclosure of birth dates or other unnecessary personal details in logs.

Revalidate every meaningful search edit

Search editing is an important source of subtle errors. Users can alter the dates, route, passenger ages, number of travellers, lap or seat preference, and responsible adult. Each change can invalidate a previous search request even if the results page looks almost identical. Treat the combination of itinerary and passenger intent as a versioned search snapshot.

When a date or route changes, recompute age evaluations and reapply the supplier policy. When a traveller's age evidence changes, invalidate the derived category and any previous mapping to supplier IDs. When an infant's seating intention changes, update the occupied-seat expectation and discard incompatible pricing assumptions. When a linked adult disappears, invalidate the association before allowing another search.

Assign a fingerprint or version identifier to the normalized itinerary and passenger snapshot. Responses should carry the version that produced them. If an earlier asynchronous search finishes after the user has edited the form, the interface should ignore those outdated results rather than presenting them as matches for the latest request.

Refresh offers without losing passenger intent

A search response is not the final booking contract. Supplier offers can become stale, prices can change, and a selected itinerary may expose more precise segment information than the original search. The platform needs an offer-refresh checkpoint that confirms the actual selected offer still matches the passenger and occupancy assumptions before advancing to traveller details or payment.

Duffel's getting-started workflow advises retrieving a selected offer again because offers become stale. Separately, its offer-request retrieval reference describes retrieving an offer request by ID and returning its journey and passengers, with different response views available. These are distinct resources: retrieving the original offer request is not a substitute for refreshing the selected offer.

At refresh, compare the chosen offer's passengers and itinerary against the active search snapshot. Confirm that the traveller mapping remains valid, check whether price or availability changed, and revisit any policy question triggered by the returned flights. A meaningful difference should invalidate the old confirmation state and require another explicit customer review before an order is attempted.

Keep the original requested seating arrangement visible through this step. If a family asked for a lap infant, a refreshed price with an extra occupied seat is not an equivalent result without an explanation and approval. Conversely, if a reserved seat is required, never accept an apparent lower total based on removing that seat from the passenger model.

When collecting final dates of birth and booking details, compare the new information with the ages used for search. If the actual birth date conflicts with the earlier supplied age, rerun category eligibility and obtain a new compatible offer where necessary. Do not overwrite the discrepancy silently or assume that adding identity details can never affect the shopping result.

Keep an auditable decision trail

For troubleshooting, record the search version, supplier identifier, rule reference, age-evaluation basis, validation result, and offer-refresh outcome. Use pseudonymous traveller references in operational logs wherever possible. An auditor or support agent should understand why a request was rejected without needing a full copy of every family member's personal profile.

Minimize sensitive data while preserving accuracy

Data minimization is a design constraint, not a reason to guess ages. For anonymous search, use a supported age value and its travel-date basis where that is enough. Ask for a date of birth only when the supplier workflow or the specific eligibility question requires greater precision. If the customer supplies a birth date early, restrict where it is stored and who can access it.

Use separate data lifecycles for search sessions, saved traveller profiles, and confirmed bookings. A temporary search does not automatically justify retaining birth dates for future marketing or analytics. Avoid placing them in URLs, client-visible tracking events, broad application logs, or cache keys that can be inspected outside the booking service. Prefer derived age evaluations and internal references where suitable.

Security, privacy, and retention requirements vary by jurisdiction, contract, and product architecture. Review them separately with the relevant specialists. This guide proposes technical decisions for accurate search and revalidation; it does not supply legal advice or assert that any data collection pattern automatically satisfies regulatory obligations.

Test the transitions that ordinary happy paths miss

Unit tests should cover birthdays immediately before, on, and after departure; journeys crossing a birthday between outward and return slices; and connections whose local dates straddle midnight. Include date-only arithmetic, leap-day interpretation, and changes to timezone context. Assertions should verify the chosen rule reference as well as the computed age and resulting category state.

Integration tests should cover unsupported provider categories, lap-versus-seat switches, a responsible adult being removed, changed traveller ordering, and new supplier passenger IDs after a revised search. Test the failure mode when an adapter cannot decide whether a mixed-age return is bookable. The safe outcome is a visible unresolved state, not a fabricated booking entitlement.

Offer tests should cover stale prices, passenger mismatches, incompatible seating results, and a birth date collected at checkout that contradicts the search age. Verify that old asynchronous results cannot overwrite newer selections, and that an offer refresh triggers another validation of the active party. These are product correctness checks as much as API integration checks.

For TravelTech365-style booking platforms, the desired outcome is a family search that remains intelligible at every stage: each traveller is counted, age is grounded in a date, lap intentions remain explicit, supplier uncertainty remains visible, and offer refresh never silently changes what the customer asked to buy. A trustworthy flight search api carries that context from the first passenger control to the final validated offer.