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

Flight API Integration for Passenger Baggage Coverage

Keep included and purchased baggage tied to the right passenger and flight segments through offer review and booking confirmation.

Travel agent reviews baggage coverage with two travelers beside their suitcases

Flight shopping is not finished when a traveller chooses a fare. The booking journey must also explain what baggage that fare includes, which additional bags can be purchased, and exactly who receives each entitlement. A reliable flight api integration connects those details to specific passengers and flight segments from offer review through the confirmed order. Otherwise, a visually convincing checkout can still produce an incorrect baggage summary.

This guide explains a practical data and interface design for passenger baggage coverage. It distinguishes included allowances from paid services, follows documented Duffel identifiers, and shows how to reconcile both sources after booking. The objective is not to predict airline baggage policies. It is to preserve what the supplier actually returned, make unresolved cases visible, and avoid promising a bag that cannot be traced to a confirmed entitlement.

Why baggage coverage needs its own booking model

A flight itinerary can contain several people, outbound and inbound journeys, connections, and different fare conditions. Baggage is therefore not a single attribute that safely belongs on the booking header. A label such as “one checked bag included” is incomplete unless the system knows which passenger and which portion of travel that statement describes.

The distinction becomes more important when travellers buy extras. An included bag forms part of the selected fare or offer. A purchased bag is a separately selected service with its own price, permitted quantity, and association with passengers and segments. These two sources may describe the same broad category of baggage, but they are not interchangeable records.

For example, a checkout that reads only included baggage can omit bags purchased during booking. Conversely, a checkout that treats all baggage records as new purchases can charge or display the same allowance twice. A robust application stores each entitlement with its source and reconstructs a coverage view without erasing that distinction.

Coverage here means an evidence-backed description of what the offer or order reports for a traveller on particular flights. It does not mean a guarantee about baggage acceptance at the airport, through-checking across connections, or how allowances may be shared. Such rules depend on the operating airline and itinerary, and should be displayed only when supported by applicable supplier information.

Separate included allowances from optional baggage services

Included baggage belongs to the passenger on a segment

In the documented Duffel offer structure, the flight itinerary contains slices, each with segments. Within a segment, passenger entries can contain a baggages array. A baggage item can identify a type, such as checked, and a quantity. This is the appropriate source for the included allowance shown against that passenger and segment.

Read that information at its original granularity. Do not copy one traveller's allowance to everyone on the booking, assume an outbound allowance automatically applies on the return, or turn separate segment entries into a single journey-wide entitlement. If a value is unavailable or not established, show it as unconfirmed rather than silently converting absence into zero.

An included quantity of one checked bag says something useful about that segment and passenger. On its own it does not establish a weight limit, dimensions, interline treatment, or permission to redistribute the piece to somebody else. Keep these questions separate from the quantity shown in the response.

Purchased baggage is an offer-specific available service

Duffel documents extra bags through available_services, requested when retrieving a single offer with return_available_services=true. An available service has an identifier, a type such as baggage, an amount and currency, associated passenger_ids and segment_ids, metadata, and a maximum_quantity. The service is available to select; it is not yet an entitlement simply because it appears in the offer.

The metadata can describe the baggage type and, when supplied, limits such as maximum weight or dimensions. Display supported details faithfully, retaining units. Do not infer that every airline supplies the same metadata or that a service for one flight also covers another. A service's scope is defined by its own associations, not by the shape of the overall itinerary.

The supplier documentation explicitly notes that booking extra baggage is not supported for every airline. An empty list of available services can mean none are available or that the airline is not supported for this functionality. It is therefore unsafe to translate an empty list into “additional bags are prohibited.” The user interface should distinguish “no purchasable bags returned” from an independently confirmed airline restriction.

For the documented flow and current qualification, see Duffel's Adding Extra Bags guide. Its examples establish the important separation between optional services and the underlying fare, while the Offers API schema describes the offer structure and retrieval behavior.

Retrieve a current offer before presenting baggage choices

Build the checkout from a refreshed offer

Search results are useful for comparing itineraries, but they are not a permanent booking contract. Duffel recommends retrieving the selected offer for complete, current information before booking. That request can reveal baggage details omitted earlier, and prices or available services may change. The offer also carries an expiry field that checkout logic should respect.

In the Duffel example, the application retrieves GET /air/offers/{id}?return_available_services=true. Use the current response to build both the included-baggage summary and the optional-service catalogue. If passengers are updated or the offer must be refreshed again, invalidate any display or cart selection that relies on an older snapshot until it has been revalidated.

Persist the offer identifier and a controlled snapshot of the relevant response: passenger identifiers, slice and segment identifiers, included baggage, available-service identifiers, service scope, metadata, price, currency, quantity limit, and the time of retrieval. The snapshot supports troubleshooting, but the latest valid supplier response remains the authority for creating the order.

Translate raw data into a coverage matrix

The front end benefits from a matrix keyed by passenger and segment. For every applicable pair, show included baggage first and optional paid bags separately. Preserve the segment's flight context, including origin, destination, and departure date, so two similar services cannot be confused when a route contains repeated airports or multiple legs.

Where an available service lists more than one passenger or segment identifier, preserve the complete scope returned by the supplier. The application must not invent a selectable cross-product of those identifiers or arbitrarily divide a single service among travellers. Whether a particular service can be selected in a given configuration should follow its documented scope and the supplier's booking requirements.

Keep internal customer identifiers distinct from supplier passenger IDs. A traveller might have an account ID, a checkout row number, and an offer passenger ID simultaneously. The baggage selection must follow the offer passenger ID used by the service, with an explicit link back to the human-readable traveller name.

Preserve passenger and segment lineage during selection

Keep identifiers attached to each selected service

For every selected paid baggage line, retain its available_service.id, the source offer ID, the passenger_ids array, the segment_ids array, the baggage type, selected quantity, quoted unit amount, and currency. Treat this as the traceable selection record rather than a generic product called “extra checked bag.”

Duffel's documented booking request sends a selected service using its id and quantity. The passenger and segment associations are defined by the service returned with the offer; the client should not manufacture new associations inside that order request. Before submission, validate the selected ID against the latest offer and ensure its recorded coverage still matches what the traveller approved.

Two distinct service IDs can have identical prices and baggage descriptions while applying to different people or flights. Deduplicating them by label or amount would discard necessary information. Likewise, using array positions as enduring identities is fragile if search results, passenger ordering, or segment ordering changes.

Handle quantities and money without changing meaning

The offered maximum_quantity limits how many units of that particular service may be requested. The selected quantity expresses the number to buy, not the number of bags already included in the fare. Do not merge these values or assume a quantity can be moved from one service to another because their names look alike.

According to Duffel's extra-bags guide, order creation adds a services array alongside the selected offer and passengers. The amount paid must incorporate each selected service's amount multiplied by its selected quantity. Price calculations should use decimal-safe arithmetic and verify that currencies align; do not perform an unqualified addition across different currencies.

Keep a readable checkout breakdown: flight offer total, each paid baggage line with passenger and segment scope, applicable quantity, and the combined amount to be paid. The offer's total_amount excludes optional services, so an unchanged flight subtotal alongside an increased payable total is expected, not evidence of a duplicate charge.

When an add-on price or limit changes during refresh, require a new review before purchase. Showing an old price but transmitting a current service ID creates a discrepancy between customer consent and what is ordered. For auditability, retain both the previously displayed selection and the final approved version, with clear status rather than overwriting history.

Worked hypothetical: two passengers, two flight segments

Consider a fictional direct-booking checkout for Mira and Dev travelling on two separate segments, London to Paris and Paris to London. The following records are invented solely to demonstrate reconciliation; they do not describe any real airline fare, route entitlement, or baggage policy. Suppose the refreshed offer shows an included checked-bag quantity for each passenger and segment, and two additional checked-bag services are offered.

Mira has one included checked bag on the outbound segment and one on the return. Dev has no included checked bag on either segment. Mira chooses one paid bag on the outbound only; Dev chooses one paid bag on the return only. The two purchased services have distinct IDs and each refers to the exact passenger and segment it covers.

Illustrative coverage ledger after the selections are confirmed; counts describe records for each passenger and segment, not baggage rules between flights.
Passenger Segment Included checked bags Selected paid bags Combined displayed count
Mira London–Paris (S1) 1 1 (service A) 2
Mira Paris–London (S2) 1 0 1
Dev London–Paris (S1) 0 0 0
Dev Paris–London (S2) 0 1 (service B) 1
Airport agent checks luggage tags against a printed itinerary

The ledger is a presentation view, not a substitute for source data. Its combined count adds included pieces and successfully booked additional pieces only when they refer to the same passenger, segment, and baggage category. It must never sum across the two flight segments to claim that Mira has three bags available for one flight.

Imagine the fictional flight offer totals GBP 260.00. Service A is priced at GBP 15.00 for quantity one and service B at GBP 25.00 for quantity one. The reviewed payable total is GBP 300.00. These invented amounts illustrate 260.00 + (15.00 × 1) + (25.00 × 1); they are not indicative baggage prices or a quotation.

In the selection ledger, service A preserves passenger_ids=[Mira's offer passenger ID] and segment_ids=[S1's supplier ID]. Service B preserves Dev's offer passenger ID and S2's supplier ID. The creation request references each chosen service ID and quantity. After order creation, the system checks whether both services actually appear on the confirmed order before displaying either as purchased.

If service B does not appear in the confirmed order, Dev's return segment must not be shown as having one purchased bag merely because it was selected in the cart. Flag the discrepancy for resolution, preserve the attempted selection, and show only verified order entitlements as confirmed. This prevents an optimistic checkout state from becoming a misleading travel document.

Reconstruct confirmed baggage from the order response

Combine two sources without counting either twice

Duffel's extra-bags documentation states that ancillary baggage booked as services does not appear inside slices[].segments[].passengers[].baggages[]. Instead, it is represented in the order's services field. To display the full picture, read the segment passenger baggage arrays and the booked services separately, then assemble a passenger-by-segment result.

First, establish the confirmed order's passenger and segment map. Next, collect included baggage entries against each appropriate pair. Then inspect booked baggage services, using their passenger and segment identifiers, type, metadata, and quantity to attribute each paid line. Keep the original records attached to every displayed aggregate so support teams can explain its provenance.

Deduplication must operate on record identity and source, not merely on a shared baggage label. A purchased service is not an additional included entry, and the included entry is not proof of payment for an ancillary. The two are additive only when their category and scope are genuinely comparable. If the types or coverage cannot be reconciled, present separate lines rather than guessing a unified count.

Retrieve the order by its identifier when confirming or rechecking the booking. A successful payment screen alone is insufficient evidence that every selected service was fulfilled. If the order's services differ from the intended selection, record the difference and guide the traveller to support or an available correction process without claiming an unverified entitlement.

Represent service documents as evidence, not as extra bags

Some airlines issue an Electronic Miscellaneous Document for ancillary services separately from the electronic flight ticket. Duffel explains that, when available, such a document can be exposed with type electronic_miscellaneous_document_associated. Store and display a returned document with its relevant booking context, while avoiding a blanket assumption that every extra-bag purchase will have one.

A service document confirms a document record, not an additional quantity of baggage beyond the service it relates to. Therefore, do not add a document row into the baggage count. The order's booked service remains the entitlement record; the document is supporting evidence that can help with servicing, reconciliation, and customer communications.

Where no separate service document is returned, do not fabricate a document number or conclude that the ancillary failed solely from that absence. Conversely, if the booking response does not substantiate the service itself, the presence of a payment attempt or a document-like identifier in internal systems should not trigger a confident “bag confirmed” label.

Design a checkout travellers can verify

A useful baggage interface answers three questions without requiring travellers to interpret API fields: what is already included, what they are about to pay for, and which flights each choice covers. Place those answers near the relevant traveller and flight, not in a single generic baggage banner at the bottom of checkout.

Use explicit labels such as “Included in fare,” “Optional additional bag,” “Selected, not yet booked,” and “Confirmed on order.” These labels encode the status difference between an offered service, a cart selection, and a completed booking. Avoid a green checkmark for an optional service before the returned order confirms it.

For itineraries with connections or a return leg, offer an expandable per-flight view. Where supplier identifiers map to multiple segments, present the exact scope without replacing it with a broad “whole trip” claim. Show any supplied weight and dimensional details beside the specific service, and provide room for an airline-policy link if reliable policy data is available separately.

Accessibility improves accuracy here. Use descriptive text rather than colour alone to distinguish included from paid baggage, keep quantities beside their labels, and announce validation errors in context. Present flight dates and directions clearly so travellers using assistive technology can determine whether a purchased bag covers the outbound or return segment.

Plan for missing data, changes, and unsupported airlines

Supplier responses are not uniform. Some offers have detailed included baggage records but no optional services; others may return services with different scope or metadata. Treat these as data states, not opportunities to infer a standard allowance. If a service is unsupported, expose that limitation clearly instead of showing a disabled purchase option with an invented explanation.

Unknown included allowance should remain unknown until verified. A zero quantity explicitly returned for a passenger and segment is different from a missing array, omitted field, or unexamined portion of the response. Keeping these states distinct avoids incorrectly telling customers they must buy baggage when the application simply lacks enough information.

Offer expiry, passenger updates, itinerary changes, and ancillary repricing all require a freshness strategy. A traveller who edits the itinerary should not carry old baggage service IDs into a new offer. Clear invalid selections, reacquire available services, compare the new scope and amount, and obtain renewed confirmation before booking.

Do not generalize policies across carriers in a codeshare or connecting itinerary. Segment labels should remain tied to the actual supplier itinerary and applicable airline information. Whether baggage is accepted through to a final destination, transferred between flights, or governed by another carrier is a separate operational question, not something deducible from the count of baggage items alone.

Post-booking servicing introduces additional complexity. A changed itinerary or order may need a new entitlement review, especially if booked services reference segments that have changed. Preserve the previous confirmed state, inspect the current order and related documents, and flag differences for an appropriate support workflow. Never silently assume services migrate between segments.

Validate the integration before launch

Use tests that challenge passenger and segment boundaries

Build acceptance tests around identity rather than around a single happy-path booking. Test two passengers on one flight, one passenger across two segments, mixed included quantities, multiple paid service IDs, and a selected service covering only one segment. Each case should verify that neither the passenger identity nor the scope changes between offer review, cart, order request, and confirmation.

Add tests for an empty available-services list, missing included allowance, updated baggage price, expired offer, changed passenger mapping, and a service quantity above its maximum. A valid system either produces the documented result or blocks the action with a specific explanation. It must not invent baggage coverage to keep the checkout moving.

Verify that a selected quantity generates the correct service line and payment calculation, and that an order lacking a selected service produces a mismatch alert. Assert that an associated service document is linked for servicing but never counted as another bag. Include regression fixtures that preserve raw supplier responses alongside the application's normalized coverage output.

Monitor entitlement discrepancies after deployment

Operational logging should capture offer ID, order ID, scoped supplier identifiers, service IDs, quantities, currency, calculation outcomes, and reconciliation status. Limit personal information to what is necessary, protect access, and apply an appropriate retention policy. A traceable discrepancy report should not require exposing full passenger identity documents or unrelated payment details.

Useful measures include the share of paid baggage selections confirmed on orders, mismatches by integration path, stale-offer rejections, unsupported ancillary cases, and customer support contacts arising from baggage confusion. Monitor patterns without assuming every anomaly is an airline failure; mapping errors, outdated prices, and unclear interface wording can also be responsible.

Make verified coverage the final booking promise

Successful flight api integration for baggage is less about displaying a bag icon and more about preserving identity and evidence. Included baggage originates in passenger-level segment data. Extra baggage begins as an optional, scoped available service, becomes a selected quantity, and should be treated as purchased only when the resulting order supports that conclusion.

When the application retains passenger_ids and segment_ids, respects service quantities, refreshes offers, and combines included and booked records without duplication, travellers receive a useful account of their coverage. Airline support and carriage policies still vary, so the defensible promise is precise: show what the supplier confirms for each person and flight, and label everything else honestly.