The pipeline
Discovery vs live pricing
Two tools play here:- Discovery (
find_destination,flight_calendar,find_dates,lowest_fare) is cached. Returns broad, fast, exploratory results. Prices may be 5-30 minutes stale. - Live pricing (
flight_search,hotel_search) hits the upstream provider directly. Returns atrip_item_tokenyou can add to a trip.
offer_token is not bookable on its own, pass it to flight_search (price-check mode) to get a fresh trip_item_token.
Tokens and IDs
Tokens are scoped, an
offer_token from yesterday won’t work today. Always go through the pipeline fresh.
Trip vs cart vs quote
- Trip is the canonical user-facing name across SDK / CLI / MCP / API docs. All public examples and tool names use it (
trip,getTrip,trip_id). - Cart is a legacy internal name that surfaces in one place: some server responses still return
cart_id(numeric, the storage primary key) alongsidetrip_id. They identify the same object. Prefertrip_idin your code. - A quote is the price-locked snapshot of a trip at a point in time.
checkout()schedules a quote internally before creating the Stripe session, you don’t manipulate quotes directly.
Multi-domain trips
A single trip can hold flight items AND hotel items. They go through one Stripe checkout. To build a multi-domain trip:Providers
The API aggregates multiple upstream providers behind a unified API. As of this writing:- Flights: TravelFusion (NDC + LCC), Sabre (GDS).
- Hotels: Nuitée (LiteAPI).
provider field is exposed on responses (and accepted as an override on refund/exchange) for cases where you need to target one explicitly.
Hosted checkout
Jinko owns the payment surface. You never touch credit-card data. Flow:checkout()returns acheckout_urlpointing atapp.gojinko.com/checkout?sid=<session>.- Send the user there (open in browser, deep-link from a widget, etc.).
- They pay on Stripe-hosted UI.
- Stripe webhooks finalize the booking, no client confirm step needed.
- Poll
getTripto watch fulfillment status (pending → fulfilling → completed | failed).
Async fulfillment
Booking confirmation isn’t always instant, TravelFusion bookings can take up to 72 hours to confirm with the airline. The API handles this with a job queue (River + Postgres). You pollgetTrip to watch state; the user gets confirmation emails directly from Jinko when their booking lands.
For end-to-end mechanics, see the Flight booking guide or the Flight + Hotel guide for a multi-item trip.