trip is a single booking unit: you can put a flight and a hotel into the same trip, set the travelers once, and check out once. The user pays a single Stripe charge and receives a single confirmation with a single Jinko booking reference covering both bookings.
This guide builds a Paris weekend (a flight from JFK to CDG and a hotel in Paris) end to end with side-by-side examples for SDK, CLI, and MCP.
The one-line version of the flow:
Prerequisites
- A Jinko account and an API key (
jnk_...). Get one. - For the SDK path: Node.js 20 or later, then
npm install @gojinko/api-client. - For the CLI path:
npm install -g @gojinko/cli && jinko auth login --key jnk_.... - For the MCP path: any MCP client connected to
https://mcp.builders.gojinko.com/mcp.
1) Find the flight
Discover flights for the route and dates, then confirm pricing on the candidate the user picks. This is the same first two steps as the Flight booking guide, so we keep it short.- SDK
- CLI
- MCP
2) Find the hotel
Search hotels at the destination for the same dates. Hotel rates are already live offers, no separate price-check step is needed.- SDK
- CLI
- MCP
3) Build the trip with both items
Now the key step. Add the flight to a new trip and set travelers in the same call. Then add the hotel to the same trip with a secondtrip(add_item) call. Both items now live on the same trip and will check out together.
- SDK
- CLI
- MCP
items[]: the flight and the hotel. The total price is the sum of both, in the same currency.
4) Checkout
Callbook once. You get one Stripe checkout_url covering both items.
- SDK
- CLI
- MCP
5) User pays
The user openscheckout_url, sees the flight and the hotel side by side with one total, enters payment once, and Stripe holds the authorization.
6) Fulfillment
Stripe webhooks trigger fulfillment for both items. They book in parallel and the trip iscompleted once both providers confirm.
| State | Meaning |
|---|---|
pending | Payment cleared, neither item booked yet |
fulfilling | At least one item is still being booked |
completed | Both items confirmed, booking_ref populated for each |
failed | A provider rejected. Refund covers the full amount. |
7) Watch the booking land
Pollget_trip until fulfillment.status is terminal. The bookings[] array will contain entries for both the flight and the hotel.
- SDK
- CLI
- MCP
What’s next?
- Just a flight: see the Flight booking guide for the full eight-step flow.
- Just a hotel: see the Hotel booking guide.
- Add ancillaries to the flight: see step 4 of the flight guide.
- Refund or exchange the flight after booking: flight_refund and flight_exchange.
- Troubleshooting: Errors has the full status-code reference.
