Overview
Flight offers are time-sensitive and can expire within minutes of being fetched. Every offer includes anexpires_at timestamp that defines the exact window during which the offer is valid for booking.
Always treat
expires_at as the source of truth. Do not assume an offer is still valid based on when it was fetched or how recently you searched.Why Expiration Matters
Flight pricing and availability are highly dynamic. An offer can become invalid at any moment due to:- Fare changes β airline pricing rules updated in real time
- Seat availability β another passenger books the last seat
- Airline inventory changes β capacity adjustments on the route
Recommended Flow
Follow this four-step pattern to safely manage offer expiration end-to-end.1. Store the Expiration Timestamp
Persistexpires_at alongside every offer you retrieve so it is available at booking time.
2. Validate Before Booking
Before calling/v1/air/orders, check whether the offer is still within its validity window.
3. Block Expired Offers at Both Layers
Enforce expiration checks at the frontend and the backend β never rely on just one.4. Refresh Offers When Needed
If an offer has expired, do not attempt to reuse the offer ID. Fetch a fresh set of results instead.- Re-run the search via
/v1/air/searchto get new offers based on the userβs original criteria - Present the refreshed options to the user
Handling Edge Cases
Race Condition β Offer Expires During Booking
Even if you validate the offer immediately before booking, it can expire in the gap between:- User clicking Book Now β your API request reaching our servers
- Network latency β order processing delay
OFFER_EXPIRED error code and prompting the user to refresh:
Near-Expiry UX
For offers approaching expiration, proactively improve the user experience:- Show a countdown timer β surface how much time remains
- Highlight urgency β use visual cues (e.g. amber/red indicators) when under 2 minutes
- Apply a safety buffer β disable booking when fewer than 30 seconds remain to avoid race conditions
Best Practices
Validate Twice
Always check expiration both client-side (before showing the button) and server-side (before creating the order). Never rely on a single layer.
Use a Safety Buffer
Treat offers as expired slightly before
expires_at β a 30-second buffer reduces the risk of race conditions during high-latency requests.Recover Gracefully
When an offer expires mid-flow, catch the error and guide users back to search results. Avoid dead ends or cryptic error messages.
Never Cache Stale Offers
Do not cache or store offers beyond their expiration window. Always surface fresh results from the search endpoint.

