# Conversations Source: https://docs.gojinko.com/ai/flight-search/conversations Answer the questions a flight AI search asks, refine a search with follow-ups, change it while it runs, and know when a conversation expires. A flight AI search is a conversation. The traveler can answer a question, add a condition, change a date or an airport, or ask for more options, and each message builds on what was said before. ## Conversations and tasks | Id | Prefix | What it is | | - | - | - | | `context_id` | `ctx_` | The conversation with one traveler. It keeps the conditions of the search so far: places, dates, travelers, filters, the question asked and the last search. | | `task_id` | `atk_` | One search in that conversation, with its own `status`. You read, stream and cancel a search by its `task_id`. | The first message, sent without `context_id`, starts a conversation. Its answer carries both ids. Send `context_id` with every later message of the same traveler; keep one per traveler and conversation. Where a later message goes depends on the conversation's open task: | When the message arrives | What happens | | - | - | | A task is waiting for an answer (`input_required`). | The message answers it. The same task continues, with the same `task_id`. | | A task is still searching (`working`). | That task is canceled, with `superseded_by` set to a new task that handles the message. | | No task is open. | A new task starts and keeps the conditions of the conversation. | You do not need to send `task_id`. When you do, it must belong to the conversation, and it needs `context_id`: `task_id` alone answers `422`, and a task of another conversation answers `404`. ## Answer a question When a search cannot start, the answer is `input_required`. `message` is the question to show, and `question` says what is missing. Some questions carry `question_options`, the choices to show: ```json theme={null} { "context_id": "ctx_mvq3c1d70b9e4f2a6c813d57", "task_id": "atk_mvq3c1df5d20a8e7c49b16f2", "status": "input_required", "message": "Which San Jose do you mean?", "question": "which_place", "question_options": [ { "value": "SJC", "label": "San Jose, United States", "detail": "US" }, { "value": "SJO", "label": "San José, Costa Rica", "detail": "CR" } ], "criteria": { "trip_type": "oneway", "origins": [{ "code": "FRA", "type": "city", "name": "Frankfurt", "country_code": "DE" }], "destinations": ["..."], "passengers": { "adults": 1, "children": 0, "infants": 0 }, "currency": "USD" }, "notes": [], "charge": { "turn": 1, "llm_usd": 0.0053, "api_usd": 0, "total_usd": 0.0053, "currency": "USD" } } ``` | `question` | Asked when | Example `message` | | - | - | - | | `origin` | There is no origin. | `Where are you flying from?` | | `which_place` | A place name fits several places, no place matches it, or no city of a country can be chosen. `question_options` lists the places it could be, when there are some. | `Which San Jose do you mean?`, `Which city in Thailand do you want to search? Please name the city or airport.` | | `dates` | A date does not exist, a date has passed, the return is before the departure, or a flight of a multi-city trip has no date. | `That date has passed. Which day do you want to fly?`, `The return is before the departure. Which dates do you mean?`, `Which day is each flight of the trip?` | | `passengers` | A family or a group travels and its adults, children and infants are not stated, or the count is not possible. | `Who is travelling: how many adults, children (2–11) and infants (under 2)?` | | `group_too_large` | More travelers than one search takes: more than 9 with a seat (adults and children), more than 8 children, more than 4 infants, or more infants than adults. | `One search takes at most 9 travellers with a seat, 8 children and no more infants than adults. How would you like to split the group?` | | `contradiction` | The origin and the destination are the same place, or the request asks for a direct flight with a stopover. | `You asked for a direct flight and a stopover. Which one do you want?` | A request that names no destination is not asked for one: the answer covers several destinations from the origin instead. Always show `message`, whatever the value of `question`. When several things are missing, the search asks for one at a time. A question runs no search, so its `api_usd` is `0`. Send the traveler's answer as `text`, with the same `context_id`. With `question_options`, send the chosen `value`: ```bash theme={null} curl https://api.gojinko.com/v1/flight_ai_search \ --header "X-API-Key: $JINKO_API_KEY" \ --header "Content-Type: application/json" \ --data '{"text": "SJO", "timezone": "Europe/Berlin", "context_id": "ctx_mvq3c1d70b9e4f2a6c813d57"}' ``` The same task continues, with the same `task_id`, and searches. While the search runs, the answer is `202` with the early reply: ```json theme={null} { "context_id": "ctx_mvq3c1d70b9e4f2a6c813d57", "task_id": "atk_mvq3c1df5d20a8e7c49b16f2", "status": "working", "message": "Searching flights: Frankfurt → San José, 10 Nov 2026, one way, 1 adult.", "criteria": { "trip_type": "oneway", "origins": ["..."], "destinations": ["..."], "departure": { "date": "2026-11-10" }, "passengers": { "adults": 1, "children": 0, "infants": 0 }, "currency": "USD" }, "notes": [{ "kind": "default_passengers", "text": "No travellers were given; priced for one adult." }] } ``` You do not send `question` back: the conversation knows what it asked. The traveler can also answer with a whole new request; it is read the same way. ## Refine the search Each follow-up answers with a new search that keeps the conversation's conditions and applies the change. "Show me more" is the exception: it returns more options of the last search. | The traveler says | What changes | | - | - | | "nonstop only", "business class", "with a checked bag", "under 400 EUR" | The condition is added, or replaces the earlier value of the same kind. Places, dates and travelers are kept. | | "make it Porto instead", "from Orly" | That side of the route changes. The other side, the dates, the travelers and the filters are kept. | | "a week later", "back on the 20th" | The dates change. A new return alone keeps the departure. | | "we are 2 adults and a child of 4" | The travelers change. | | "any airline is fine", "forget the budget" | The condition is removed. Airlines, stops, budget, cabin, checked bag, refundable, changeable, times, connection airports and avoided airports can be removed. | | "the fastest one", "fewest connections" | The order of the options changes (`priority`). | | "price March 2" | Options for that day, as a new date. | | "show me more" | The next options of the last search, up to 5, while their fares are valid: `5 more options.` When none are left: `There are no more options for this search.` | `has_more: true` means more options of the last search are available; ask for more in the same conversation. There is no page parameter. When the fares of the remaining options have expired, "show me more" answers with fresh options of the same search. The reply adds `The earlier prices had expired; these are searched again now.`, `notes` carries `repriced`, and the new fares have new tokens and a new `expires_at`. ### Notes `notes` lists the assumptions made, what could not be done, and what limits the answer. Most notes carry a `text` to show; `message` often says the same. | `kind` | Fields | Meaning | | - | - | - | | `default_passengers` | `text` | `No travellers were given; priced for one adult.` | | `passengers_assumed_adults` | `text` | `4 travellers were taken as 4 adults; say if any are children (2–11) or infants.` | | `default_window` | `text` | `No dates were given; the next 90 days were searched.` | | `default_stay` | `stay_days`, `text` | `No return date or trip length was given; a 7-day stay was searched.` The trip is a holiday, or was asked as a round trip, without a return or a length. | | `no_fares` | `text` | `Only the first day of the window was searched.` | | `shops_capped` | `cap`, `candidates` | Not every candidate day or destination was searched: `cap` is the number searched, `candidates` the number of candidates. Name a day or a destination in the same conversation to get options for it. | | `not_searched` | `origin`, `destination`, `departure`, `reason` | No options could be returned for that route and date (`reason`: `timeout`, `failed` or `refused`). The rest of the answer stands. | | `not_supported` | `capability`, `text` | With `capability: "award"`: `Miles and points are not searched; these are cash fares.` | | `monitoring_not_set_up` | `text` | `Price tracking is not set up by this search; these are the prices at the time of the search.` The request is answered like any other. | | `beyond_booking_horizon` | `horizon` | A date is more than one year ahead (after `horizon`); nothing was searched. | | `out_of_scope` | `capability` | The message asks for something this search does not do. See [When nothing matches](#when-nothing-matches). | | `repriced` | `text` | `The earlier prices had expired; these are searched again now.` | ## Change the search while it runs A message sent while a task is `working` replaces it. Reading the first task then shows: ```json theme={null} { "context_id": "ctx_mvq3d4e81c6b0a9f2e7d5341", "task_id": "atk_mvq3d4ef6e1b92c0a4d8f735", "status": "canceled", "superseded_by": "atk_mvq3d5a2b7c4e1f09d3a6e28" } ``` Follow the task in `superseded_by`. To stop a search without sending a new message, [cancel it](/ai/flight-search/waiting-for-results#cancel-a-search). ## When nothing matches A search that finds no fare within the conditions ends `completed`, with no option and a reply that says so, for example `No flight was found for Paris → Porto, 10 May 2027, back 17 May 2027, 1 adult, within the conditions asked. Changing a date, an airport or a filter may find some.` No filter is relaxed without the traveler. When the answer covers several destinations, each destination without an option has a `per_destination` row with `option_id: null` and an `empty_reason`, while the other rows keep their options: ```json theme={null} { "destination": { "code": "OPO", "type": "city", "name": "Porto", "country_code": "PT" }, "dates": { "departure": "2027-05-10", "return": "2027-05-17" }, "option_id": null, "live_cheapest_total": null, "empty_reason": "no_fare_within_filters", "summary": "Nothing was found within the filters." } ``` | `empty_reason` | Meaning | | - | - | | `no_fare_within_filters` | No fare for the destination met every filter. | | `not_searched` | The destination was not searched in this turn: other candidates were searched instead (see `shops_capped`), its search did not finish (a `not_searched` note gives the reason), or no day was found to search. Name a day to search it. | When a search could not be completed, for example after a timeout, the answer ends `completed` with a `not_searched` note and `The search for Paris → Porto, 10 May 2027, back 17 May 2027 could not be completed. Please send the message again.` A date more than one year ahead is not searched: the answer ends `completed` with a `beyond_booking_horizon` note, for example `Flights can be booked up to one year ahead (2027-10-26); nothing was searched for 3 Nov 2027, one way.` A request for something other than a flight search also ends `completed`, with no search, a note `out_of_scope` and a reply that says what to do instead: | The traveler asks for | `capability` | `message` | | - | - | - | | A change or a cancellation of a booking | `post_booking` | `This search finds and prices flights. A booking is changed or cancelled from the booking itself, with its JNK reference.` | | The status of a flight | `flight_status` | `This search finds and prices flights; it has no flight status.` | | A booking or a payment | `booking_or_payment` | `This search finds and prices flights. Add a fare to a trip to book and pay for it.` | | Another transport, such as a train or a ferry | `other_transport` | `This search finds and prices flights only.` | | Something unrelated to travel | `not_travel` | `This search finds and prices flights. Tell me where from, where to and when.` | A message that is not a request, such as a greeting or a thank-you, ends `completed` with `This search finds and prices flights. Tell me where from, where to and when.` ## Expiry A conversation expires 24 hours after its last message. * A message sent with an expired `context_id` answers `410` `GONE`. Start a new conversation without `context_id`. * A task that was waiting for an answer ends `failed` with `error.code` `context_expired`. * Tasks stay readable by `task_id` after the conversation expires. Fares expire sooner: a `trip_item_token` can be added to a trip until its `expires_at`, at most 75 minutes after the search. See [Book a result](/ai/flight-search/overview#book-a-result). ## Related * [Flight AI search](/ai/flight-search/overview) * [Waiting for results](/ai/flight-search/waiting-for-results) * [Statuses and errors](/ai/flight-search/statuses-and-errors) # Flight AI search Source: https://docs.gojinko.com/ai/flight-search/overview Search flights from the traveler's own words over REST: send one sentence, answer the questions it asks, refine with follow-ups, and book a fare. Flight AI search takes the traveler's request as written, for example "I want to go skiing over the Christmas holidays, any good destinations and flights from San Francisco?", and answers with bookable options, priced for the travelers of the request, and a reply to show. When the destination is a kind of place, such as skiing or a beach, the options cover several destinations that fit. When the dates are a window, the options cover one or more days of it. When something is missing, the answer asks for it. The traveler can then refine the search in the same conversation. > [!WARNING] > > Flight AI search is in preview. The API may change. ## How it differs from flight search | | [`POST /v1/flight_search`](/api/flight-search) | `POST /v1/flight_ai_search` | | - | - | - | | Input | Structured fields: route, dates, passengers, filters. | The traveler's sentence, as `text`. | | Dates | Exact dates. | Exact dates, or a window ("in March", "around March 20"); the options then cover one or more days of the window. | | Destination | Required. | Optional: without one, the options cover several destinations from the origin. | | Missing information | `422` for a missing required field. | A question to show the traveler (`status: "input_required"`). | | Follow-ups | Each call stands alone. | A conversation (`context_id`) keeps what was said, so "nonstop only" refines the last search. | | Results | Offers with their fares. | Options with their fares, `groups` to present them, plus `message`, `criteria` and `notes`. | | Booking | `trip_item_token` → trip → checkout. | The same, from an option's fare. | ## The flow ```mermaid theme={null} sequenceDiagram participant App as Your app participant Jinko App->>Jinko: POST /v1/flight_ai_search {text, timezone} alt something is missing Jinko-->>App: 200 input_required + question App->>Jinko: POST /v1/flight_ai_search {text: answer, context_id} end alt the turn ends within 20 s Jinko-->>App: 200 completed + options else the search takes longer (most turns) Jinko-->>App: 202 working + Location App->>Jinko: GET /v1/flight_ai_search/tasks/{task_id} Jinko-->>App: 200 completed + options end App->>Jinko: POST /v1/trip {add_item: {trip_item_token}} App->>Jinko: POST /v1/checkout {trip_id} ``` 1. **Send the sentence.** One call with `text` and the traveler's `timezone`. 2. **Answer questions.** An `input_required` answer carries a question; send the traveler's answer with the same `context_id`. See [Conversations](/ai/flight-search/conversations). 3. **Get the options.** A turn that searches usually takes 10 to 60 seconds, longer than the 20 seconds the call waits, so expect `202` first. Read the task until it ends, or stream it. See [Waiting for results](/ai/flight-search/waiting-for-results). 4. **Refine.** "nonstop only", "make it Porto instead", "show me more": each follow-up goes in the same conversation. 5. **Book.** Add a fare's `trip_item_token` to a trip and check out before its `expires_at`. ## Quickstart Flight AI search is served on production only, at `https://api.gojinko.com`, with a production API key; the sandbox does not serve it. The request is the traveler's own words, in any language. This one asks, in Chinese, for ski destinations and flights from San Francisco over the Christmas holidays: ```bash theme={null} curl https://api.gojinko.com/v1/flight_ai_search \ --header "X-API-Key: $JINKO_API_KEY" \ --header "Content-Type: application/json" \ --data '{ "text": "我圣诞节假期想去滑雪,有没有好的目的地和航班推荐,从旧金山出发。", "timezone": "America/Los_Angeles" }' ``` The search is still running after 20 seconds, so the call answers `202` with the task to read (`Location`, `Retry-After: 2`) and the early reply (other fields left out): ```json theme={null} { "context_id": "ctx_mvtx944haeb8159748fdb024", "task_id": "atk_mvtx944t0483d649d5f90257", "status": "working", "message": "Looking for destinations from San Francisco, leaving between 20 Dec 2026 and 27 Dec 2026, staying 7 days." } ``` Read the task until `status` is no longer `working`: ```bash theme={null} curl https://api.gojinko.com/v1/flight_ai_search/tasks/atk_mvtx944t0483d649d5f90257 \ --header "X-API-Key: $JINKO_API_KEY" ``` The answer, with one option, one fare and two destinations of the group kept. Skiing became a `theme` destination searched at ski destinations, the Christmas holidays a departure window, and the trip a round trip with a 7-day stay, because no return was given: ```json theme={null} { "context_id": "ctx_mvtx944haeb8159748fdb024", "task_id": "atk_mvtx944t0483d649d5f90257", "status": "completed", "message": "70 bookable options for San Francisco → ski destinations, leaving between 20 Dec 2026 and 27 Dec 2026, staying 7 days, 1 adult. Best match: 86.57 USD in total, nonstop.", "criteria": { "intent": { "user_intent": "I want to go skiing for the Christmas holidays, are there any good destination and flight recommendations, departing from San Francisco." }, "origins": [ { "code": "SFO", "name": "San Francisco", "type": "city", "country_code": "US" } ], "currency": "USD", "departure": { "window": { "end": "2026-12-27", "start": "2026-12-20" } }, "stay_days": 7, "trip_type": "roundtrip", "passengers": { "adults": 1, "infants": 0, "children": 0 }, "destinations": [ { "code": "BOI", "name": "ski destinations", "type": "theme", "country_code": null } ] }, "notes": [ { "kind": "default_passengers", "text": "No travellers were given; priced for one adult." }, { "kind": "default_stay", "text": "No return date or trip length was given; a 7-day stay was searched.", "stay_days": 7 } ], "options": [ { "why": "Best match; nonstop", "legs": [ { "index": 1, "stops": 0, "origin": { "code": "SFO", "airport": "SFO" }, "arrival": "2026-12-25T01:03:00", "segments": [ { "origin": "SFO", "arrival": "2026-12-25T01:03:00", "departure": "2026-12-24T21:23:00", "destination": "DEN", "flight_number": "F94310", "duration_minutes": 160, "marketing_carrier": "F9" } ], "departure": "2026-12-24T21:23:00", "destination": { "code": "DEN", "airport": "DEN" }, "duration_minutes": 160 }, { "index": 2, "stops": 0, "origin": { "code": "DEN", "airport": "DEN" }, "arrival": "2026-12-31T20:28:00", "segments": [ { "origin": "DEN", "arrival": "2026-12-31T20:28:00", "departure": "2026-12-31T18:32:00", "destination": "SFO", "flight_number": "F91093", "duration_minutes": 176, "marketing_carrier": "F9" } ], "departure": "2026-12-31T18:32:00", "destination": { "code": "SFO", "airport": "SFO" }, "duration_minutes": 176 } ], "fares": [ { "total": { "amount": 86.57, "currency": "USD" }, "brand_name": "BASIC FARE", "changeable": false, "expires_at": "2026-10-29T20:29:06.884909139Z", "priced_for": { "adults": 1, "infants": 0, "children": 0 }, "refundable": false, "cabin_class": "economy", "trip_item_token": "offer__17080dfd:0-1-0", "price_per_person": { "amount": 86.57, "currency": "USD" }, "checked_bag_included": false } ], "score": 100, "option_id": "s1_1", "trip_type": "roundtrip" } ], "groups": [ { "kind": "per_destination", "rows": [ { "dates": { "return": "2026-12-31", "departure": "2026-12-24" }, "summary": "86.57 USD for the party, nonstop", "option_id": "s1_1", "destination": { "code": "DEN", "name": "DEN", "type": "city", "country_code": null }, "live_cheapest_total": { "amount": 86.57, "currency": "USD" } }, { "dates": { "return": "2026-12-30", "departure": "2026-12-23" }, "summary": "237.36 USD for the party, 1 stop each way", "option_id": "s2_1", "destination": { "code": "SLC", "name": "SLC", "type": "city", "country_code": null }, "live_cheapest_total": { "amount": 237.36, "currency": "USD" } } ], "title": "San Francisco to DEN or SLC or BOI or GEG or RNO or BZN or YVR or HDN or ASE or YYC or GVA or ZRH or MUC or INN", "origin": { "code": "SFO", "name": "San Francisco", "type": "city", "country_code": "US" }, "group_id": "g_1" } ], "has_more": true, "charge": { "turn": 1, "llm_usd": 0.006647, "api_usd": 0.141, "total_usd": 0.147647, "currency": "USD" } } ``` ## The request | Field | Required | Meaning | | - | - | - | | `text` | Yes | The traveler's message, 1 to 2000 characters: a request, an answer to a question, or a follow-up. | | `timezone` | Yes | The traveler's IANA time zone, such as `Europe/Paris`. Relative dates ("next Friday", "in March") are computed in it. | | `context_id` | No | The conversation to continue, from an earlier answer. Omit it to start a new one. | | `task_id` | No | The task of that conversation the message answers. Usually omitted; see [Conversations](/ai/flight-search/conversations#conversations-and-tasks). | | `currency` | No | The currency of the prices, ISO 4217 (`EUR`). Without it, prices are in `USD`. A budget the traveler states in a currency ("under 300 EUR") sets the currency of the search. | Optional headers: `Prefer: wait=N` to change the 20-second wait, `Accept: text/event-stream` to stream, and `Idempotency-Key` to retry safely. See [Waiting for results](/ai/flight-search/waiting-for-results). ## The answer | Field | Meaning | | - | - | | `context_id` | The conversation. Send it with the traveler's next message. | | `task_id` | This search. Use it to read, stream or cancel it. | | `status` | `working`, `input_required`, `completed`, `failed` or `canceled`. See [Statuses and errors](/ai/flight-search/statuses-and-errors). | | `message` | The reply to show the traveler, in English. It says what was searched, for whom, and the price of the best match. | | `question` | With `input_required`: what is missing, one of `origin`, `which_place`, `dates`, `passengers`, `group_too_large`, `contradiction`. See [Answer a question](/ai/flight-search/conversations#answer-a-question). | | `question_options` | With some questions: the choices to show, each `value`, `label` and an optional `detail`. Send the chosen `value` back as `text`. | | `criteria` | What was searched: `trip_type`, `origins`, `destinations`, `legs`, `departure`, `return`, `stay_days`, `passengers`, `priority`, `currency`, and the filters in the [`flight_search`](/api/flight-search) field names. | | `notes` | Assumptions and caveats, each with a `kind`. See [Notes](/ai/flight-search/conversations#notes). | | `options` | Every itinerary of the answer, each priced for the travelers of the request, with bookable fares. See [Options](#options). | | `groups` | How to present the options. See [Groups](#groups). | | `has_more` | More options of the same search are available; the traveler can ask for more in the same conversation. | | `charge` | What the turn costs, on the JSON answer of a turn that has ended. See [Charges](#charges). | | `error` | With `failed`: `code` and `message`. | | `superseded_by` | With `canceled`: the task that replaced this one. | Money is `{"amount": 3412, "currency": "EUR"}`, with `amount` in major units of the currency. ### Options Each option is one itinerary, priced for the travelers of the request with every filter applied, and bookable before each fare's `expires_at`. | Field | Meaning | | - | - | | `option_id` | The option's id in this answer. `groups` reference options by it. | | `trip_type` | `oneway`, `roundtrip` or `multi_city`. | | `legs` | 1 for one way, 2 for a round trip, 2 to 4 for a multi-city trip. Each leg has `origin`, `destination`, the local `departure` and `arrival`, `duration_minutes`, `stops` and `segments`. | | `legs[].segments` | Each flight: `marketing_carrier`, `flight_number`, `origin`, `destination`, local `departure` and `arrival`, `duration_minutes`, `layover_minutes` before the next flight, and `operating_carrier` when it differs. | | `fares` | The bookable fares, cheapest first. | | `score` | 0 to 100, how well the option fits the request, relative to the other options of the answer. | | `why` | A short reason, such as `Best match; nonstop` or `7 EUR more than the best match; 1 stop each way; checked bag included`. Stops read per direction: `1 stop each way`, `1 stop out, nonstop back`. | Each fare of an option: | Field | Meaning | | - | - | | `trip_item_token` | Add it to a trip to book this fare. See [Book a result](#book-a-result). | | `brand_name`, `cabin_class` | The fare's brand (`Economy Light`) and cabin (`economy`, `premium_economy`, `business`, `first`). | | `total` | The price for every traveler in `priced_for`. | | `price_per_person` | The price for one traveler. | | `priced_for` | The travelers `total` is for: `adults`, `children`, `infants`. | | `expires_at` | The last moment the token can be added to a trip. | | `refundable`, `changeable`, `checked_bag_included` | The fare's conditions. | | `carry_on_baggage`, `included_baggage` | The baggage allowance in words, such as `1 × 23 kg`, when it is known. | ### Groups `groups` say how to present the options. Each group lists options by `option_id`, so an option shows once in `options` and can appear in several groups. | `kind` | When | Fields | | - | - | - | | `shortlist` | Always, as the last group: the bookable options, best first. | `title`, `route` (`null` when the options cover several routes or a multi-city trip), `dates` (`null` when the options differ in dates), `option_ids`. | | `per_destination` | The request named several destinations, or none. | `title`, `origin`, `rows[]` with one row per destination: `destination`, `dates`, `option_id` (the best option, or `null`), `live_cheapest_total`, `empty_reason` when `option_id` is `null`, and `summary`. | A month search, "the cheapest day from Amsterdam to Lisbon in March 2027", answers options for several days of the month: ```json theme={null} { "groups": [ { "group_id": "g_1", "kind": "shortlist", "title": "Bookable options", "route": null, "dates": null, "option_ids": ["s1_1", "s3_1", "s2_1"] } ] } ``` Options `s1_1`, `s2_1` and `s3_1` are for March 9, 16 and 23; each carries its dates and its fares for the travelers of the request. ## What the search understands | The traveler says | In `criteria` | What comes back | | - | - | - | | A city: "from Paris" | `origins[]` with `type: "city"` and the city code (`PAR`) | Options from any airport of the city. | | An airport: "from Orly", "CDG" | `type: "airport"` | Options from that airport; several airports ("JFK or Newark") can be named. | | A country: "to Thailand" | `type: "country"` | Options for cities in the country. When no city can be chosen, the answer asks which city (`which_place`). | | A region with named airports: "Puglia" (Bari, Brindisi) | `type: "region"` | Options to any of the named airports. | | A kind of trip instead of a place: "skiing at Christmas", "somewhere warm in February" | `destinations[]` with `type: "theme"` and `name` ("ski destinations") | Options at destinations that fit it, with a `per_destination` group. When none can be chosen, the answer asks where to go (`which_place`). | | No destination: "where can I fly from Paris in March?" | No `destinations` | Options for several destinations from the origin, with a `per_destination` group. | | Several destinations: "Lisbon or Porto" | `destinations[]` | A `per_destination` group with one row for each destination: its best option, or an `empty_reason` when none came back. | | Exact dates: "on October 3, back October 17" | `departure.date`, `return.date` | Options for those dates. | | A month or a range: "in March", "between May 1 and 15" | `departure.window` | Options for one or more days of the window, each with its dates. When only the first day could be searched, `notes` says so (`no_fares`). | | Around a date: "around March 20" | `departure.window` of 3 days on each side, or of the days the traveler gives ("give or take 2 days"), and `flexibility_days` | Options for one or more days of the window. | | No dates | `departure.window` of the next 90 days | Options for one or more days of the next 90 days; `notes` says so (`default_window`). | | A trip length: "a week in May", "5 to 7 days" | `stay_days` | Round-trip options; each return follows its departure by the stay. | | Days of the week: "a long weekend in early December", "a weekend in June", "leaving on a Friday in March" | `departure.window` and `departure.weekdays`; `stay_days: 3` for a long weekend, `stay_days: 2` for a weekend | Options leaving only on those days: Thursday or Friday for a long weekend, back on Sunday or Monday; Friday for a weekend, back on Sunday. | | No return and no trip length, for a holiday or a trip asked as a round trip: "over the Christmas holidays", "a ski trip", "round trip in May" | `trip_type: "roundtrip"`, `stay_days: 7` | Round-trip options with a 7-day stay; `notes` says so (`default_stay`). | | No return and no trip length otherwise | `trip_type: "oneway"` | One-way options, without a question. | | Several flights: "Paris to Rome on December 10, then Milan to Paris on December 17" | `legs[]`, `trip_type: "multi_city"` | Options for the whole itinerary. Each leg needs a date. | | Travelers: "2 adults and a child of 5", "4 passengers" | `passengers` | Fares priced for all travelers. A count without a split is taken as adults; no count is 1 adult. `notes` says so. | | Cabin: "business class" | `cabin_class` | Only options in that cabin. | | Stops: "nonstop", "at most one stop" | `max_stops` | Only options with that many stops or fewer. | | Airlines: "on Air France", "not on Ryanair" | `include_carriers`, `exclude_carriers` | Only options on, or not on, those airlines. | | Baggage: "with a checked bag" | `checked_bag_included` | Only fares with a checked bag. | | Fare conditions: "refundable", "changeable" | `refundable_only`, `changeable_only` | Only fares with those conditions. | | Times: "leaving after 6 PM", "back before noon" | `departure_time_range`, `arrival_time_range`, `return_departure_time_range`, `return_arrival_time_range` | Only options in those time ranges. | | Connections: "via Dubai", "not through London", "layovers under 2 hours", "under 15 hours in total" | `via_airports`, `exclude_via_airports`, `connection_time_max_minutes`, `max_total_duration_minutes` | Only options that meet those connection conditions. | | Budget: "under 300 EUR in total", "200 EUR per person" | `budget` with `scope` `total` or `per_person` | Only options within the budget for the whole party; a per-person budget counts the travelers with a seat. | | Wishes without a fixed rule: "ideally nonstop", "preferably on KLM" | Not a filter | The order of the options. | | What matters most: "the cheapest", "the fastest", "fewest connections" | `priority`: `price`, `duration`, `connections`, `schedule` or `balanced` | The order of the options. With none stated, `priority` is left out of `criteria` and the options are ordered by price with each stop counted as 15% more of it: a nonstop comes first while it costs at most 15% more per stop it saves. | | Miles or points: "with my miles" | Not searched | Cash fares; `notes` says so (`not_supported`). | | Price tracking: "watch this route", "should I wait?" | Not set up | Options as for any request; `notes` says so (`monitoring_not_set_up`). | Every filter applies as the traveler stated it. No filter is relaxed: when nothing meets them, the answer says so. See [When nothing matches](/ai/flight-search/conversations#when-nothing-matches). `message` is always in English; translate it in your app if your traveler reads another language. ## Book a result A fare is booked like any flight fare: add its `trip_item_token` to a trip, add the travelers and contact, then check out, before the fare's `expires_at`. ```bash theme={null} curl https://api.gojinko.com/v1/trip \ --header "X-API-Key: $JINKO_API_KEY" \ --header "Content-Type: application/json" \ --data '{"add_item": {"trip_item_token": "offer_7f3a9c21_1b2c3d4e:trip_item_0"}}' ``` * `total` is the price for every traveler in `priced_for`, in `currency`. * `expires_at` is at most 75 minutes after the search. After it, the token is refused with `410` `OFFER_EXPIRED` (see [Errors](/concepts/errors)). Send a message in the same conversation to search again, and book from the newest answer. See [Flights](/guides/flight-booking#book) for travelers, fares, baggage and seats, and [Trips and checkout](/guides/trips-and-checkout) for the rest of the booking. ## Charges Each turn is charged. `llm_usd` is the language-model part of the charge, `api_usd` the flight search part, and `total_usd` their sum, in USD. A question runs no search, so its `api_usd` is `0`. The JSON answer of a turn that has ended carries its charge: ```json theme={null} { "charge": { "turn": 1, "llm_usd": 0.0058, "api_usd": 0.032, "total_usd": 0.0378, "currency": "USD" } } ``` `turn` is the message of the conversation the charge is for, from 1: the first message is 1 and each next message adds 1, whether it answers a question or asks for something new. A `working` answer and the events of a stream carry no `charge`: read the task once the turn has ended. A message is refused with `402` when your organization's balance is below what a turn needs; see [HTTP statuses](/ai/flight-search/statuses-and-errors#http-statuses). ## Next * [Conversations](/ai/flight-search/conversations): questions, follow-ups, corrections and expiry. * [Waiting for results](/ai/flight-search/waiting-for-results): `202`, reading the task, streaming, cancel and retries. * [Statuses and errors](/ai/flight-search/statuses-and-errors): every status, failure code and HTTP status. # Statuses and errors Source: https://docs.gojinko.com/ai/flight-search/statuses-and-errors What each status of a flight AI search task means, why a search fails, and how to handle each HTTP status of the four routes. A flight AI search answer has two layers. The HTTP status says whether the request was accepted. When it was, the `status` field says where the search is. Check the HTTP status first, then `status`. ## Task status Every successful answer (`200` or `202`) carries `status`, on `POST /v1/flight_ai_search`, on the task read and on `:cancel`. | `status` | Meaning | What to do | | - | - | - | | `working` | The search is running. A `202` always carries this status. | Read the task again after `Retry-After` seconds, or [stream its events](/ai/flight-search/waiting-for-results#stream-the-events). | | `input_required` | The reply asks the traveler a question; `question` says what is missing. The task waits for the answer. | Show `message` and any `question_options`, then send the traveler's answer with the same `context_id`. See [Answer a question](/ai/flight-search/conversations#answer-a-question). | | `completed` | The turn ended. `options` and `groups` hold the results. `options` is empty when nothing matched or the request was out of scope; a `per_destination` group still lists each destination with its `empty_reason`. | Show `message` and the options. | | `failed` | The turn could not finish; `error` says why. | See [Why a search fails](#why-a-search-fails). | | `canceled` | The task was canceled, or a later message replaced it; then `superseded_by` names the new task. | Read the task in `superseded_by`, if any. | On `POST /v1/flight_ai_search` without streaming, a `200` always carries one of the last four statuses: the turn is over, and nothing more arrives for it. The task read answers `200` with any status, `working` included, so keep reading it while `status` is `working`. A `completed` reply can still ask the traveler something, with no `question` field, for example `Changing a date, an airport or a filter may find some.` when no fare meets every filter, or `Tell me where from, where to and when.` for a message that is not a flight request. Always show `message`. The traveler's reply goes in the same conversation. When part of the answer could not be searched, the turn still ends `completed`, with the options found and a `not_searched` note for the rest. See [When nothing matches](/ai/flight-search/conversations#when-nothing-matches). In the event stream, `task.status` events also carry `submitted`, the moment a turn is accepted. A task read shows that moment as `working`. ## Why a search fails A failed task answers `200` with `status: "failed"` and an `error`: ```json theme={null} { "context_id": "ctx_mvq3e2f1d8b04a6c2e9f7135", "task_id": "atk_mvq3e2f97a1c4d0b8e6f2359", "status": "failed", "error": { "code": "deadline_exceeded", "message": "The search took too long. Please send the message again." } } ``` | `error.code` | Cause | `error.message` | What to do | | - | - | - | - | | `understanding_failed` | The message could not be read as a flight search. | `The message could not be understood. Please rephrase it.` | Ask the traveler to rephrase. | | `deadline_exceeded` | The turn did not end within 5 minutes. | `The search took too long. Please send the message again.` | Send the message again. | | `search_refused` | The search refused the request. | `The search could not be completed. Please try again.` | Send the message again; contact support if it repeats. | | `agent_error` | An error stopped the turn. | `The search could not be completed. Please try again.` | Send the message again. | | `max_attempts_exceeded` | The turn was stopped after repeated errors. | `The search could not be completed. Please try again.` | Send the message again. | | `context_expired` | The task was waiting for an answer when its conversation expired (24 hours without a message). | `The search could not be completed. Please try again.` | Start a new conversation without `context_id`. | `message` is safe to show to the traveler. Branch on `code`. The JSON answer of a failed turn can carry `charge`, for what the turn used before it stopped. ## HTTP statuses Errors use the Jinko error format: `{"error": {"code": "...", "message": "..."}}`. See [Errors](/concepts/errors). ### All four routes | HTTP | `error.code` | When | What to do | | - | - | - | - | | `400` | `BAD_REQUEST` | Malformed JSON (`Malformed JSON in request body`), or an invalid header such as a reserved `X-End-User-Id`. | Fix the request. | | `401` | `AUTH_REQUIRED` | No key (`Missing X-API-Key or Authorization header.`), a key that is not a `jnk_` key, or an invalid or expired key (`Invalid or expired API key.`). | Send a valid key; see [API keys](/authentication/api-keys). | | `403` | `FORBIDDEN` | The key is valid but is not a tenant API key (`jnk_t_…`), or may not run live searches, for example `This API key is not granted the "search_live" scope required by this endpoint`; or AI search is not enabled for the tenant: `Travel AI search is not enabled for this tenant.` | Use a tenant key and check its scopes in the dashboard. The key is valid, so do not rotate it. | | `422` | `BAD_REQUEST` | A field or header is out of range; `message` names it. | Fix the field. | | `429` | `RATE_LIMITED` | The key has used up its request allowance (`The API key has used up its request allowance`). | Retry later; see [Rate limits](/concepts/rate-limits). | | `502` | `UPSTREAM_ERROR` | The request could not be completed (`The request could not be completed.`). | Retry. On `POST`, retry with the same `Idempotency-Key`. | | `503` | `TEMPORARILY_UNAVAILABLE` | The search is briefly unavailable. | Retry after a few seconds, with the same `Idempotency-Key` on `POST`. | | `504` | `UPSTREAM_TIMEOUT` | No answer in time (`The request timed out before a result was available. Retry the request.`). | Retry with the same `Idempotency-Key`; the first message may already be running. | ### `POST /v1/flight_ai_search` | HTTP | When | | - | - | | `200` | The turn ended within the wait: `completed`, `input_required`, `failed` or `canceled`. With `Accept: text/event-stream`, the turn as a stream. A retry with an `Idempotency-Key` whose turn is over also answers `200` with its stored answer. | | `202` | The search is still running at the end of the wait: `status: "working"`, with `Location`, `Retry-After` and, when you sent `Prefer`, `Preference-Applied`. | | `402` | `PAYMENT_REQUIRED`: your organization's balance is below what a turn needs. `message` says how much and carries the top-up link. | | `404` | `NOT_FOUND`, `No such conversation or task.`: the `context_id` is unknown or belongs to another key's tenant, or the `task_id` is not in that conversation. | | `410` | `GONE`, `This conversation has expired. Start a new one without context_id.`: no message for 24 hours. | | `422` | The body is out of range. `text` must be 1 to 2000 characters; `timezone` is required and must be an IANA time zone; `currency` must be 3 letters (`currency: an ISO 4217 code`); `task_id` needs `context_id` (`task_id needs the context_id of its conversation`). Also `Idempotency-Key` outside 1 to 200 characters, and a body sent without a JSON `Content-Type`. | ### `GET /v1/flight_ai_search/tasks/{task_id}` | HTTP | When | | - | - | | `200` | The task, with its current `status`. | | `404` | `NOT_FOUND`, `No such task.`: the task is unknown or belongs to another tenant. | | `422` | `task_id` is not 1 to 100 characters. | A task stays readable after its conversation expires. ### `GET /v1/flight_ai_search/tasks/{task_id}/events` | HTTP | When | | - | - | | `200` | The event stream. | | `404` | `NOT_FOUND`, `No such task.` | | `422` | `task_id` is not 1 to 100 characters, or `Last-Event-ID` is longer than 20 characters. | ### `POST /v1/flight_ai_search/tasks/{task_id}:cancel` | HTTP | When | | - | - | | `200` | The task was `working` or `input_required` and is now `canceled`. | | `404` | `NOT_FOUND`, `No such task.` | | `409` | `CONFLICT`: the task has already ended, for example `The task has already ended (completed).` | | `422` | `task_id` is not 1 to 100 characters. | ## Related * [Flight AI search](/ai/flight-search/overview) * [Conversations](/ai/flight-search/conversations) * [Waiting for results](/ai/flight-search/waiting-for-results) # Waiting for results Source: https://docs.gojinko.com/ai/flight-search/waiting-for-results Get the answer of a flight AI search by reading the task or as a stream of events; cancel a search and retry a message safely. A turn that searches flights usually takes 10 to 60 seconds, and can take longer. `POST /v1/flight_ai_search` waits 20 seconds, so most searches answer `202` first and go on as a task that you read or stream until it ends. A question, or a message that needs no search, usually answers within the wait. Pick one of three ways to get the result. | Way | Request | Use it when | | - | - | - | | Wait in the call (default) | `POST` with no extra header, then read the task after a `202` | You want one call for questions and quick answers, and handle `202` for the searches. | | Answer at once, then read the task | `POST` with `Prefer: wait=0`, then `GET /v1/flight_ai_search/tasks/{task_id}` | You do not want to hold a connection open, or you run many searches at once. | | Stream the events | `POST` with `Accept: text/event-stream` | You show progress: the early reply first, then the options. | ## Wait in the call Without a `Prefer` header the call waits up to 20 seconds. * **`200`** when the turn ended in that time. `status` is `completed`, `input_required`, `failed` or `canceled`. Nothing more to read. * **`202`** when the search is still running. `status` is `working`, and the response carries: | Header | Value | | - | - | | `Location` | `/v1/flight_ai_search/tasks/{task_id}`, the task to read. | | `Retry-After` | `2`, the seconds to wait before reading it. | | `Preference-Applied` | The wait applied, when you sent `Prefer`. | `Prefer: wait=N` sets the wait to `N` seconds, from `0` to `20`. A larger value is applied as `20`, and `Preference-Applied` says so (`wait=30` is answered with `Preference-Applied: wait=20`). An unreadable `Prefer` value is ignored and the default wait applies. ## Read the task ```bash theme={null} curl https://api.gojinko.com/v1/flight_ai_search/tasks/atk_mvq3e2f97a1c4d0b8e6f2359 \ --header "X-API-Key: $JINKO_API_KEY" ``` The task read answers `200` with the same body as `POST`. Read it every `Retry-After` seconds while `status` is `working`, and stop at any other status. While the search runs, the task carries the early reply: `message` says what is being searched, and `criteria` holds it. ```json theme={null} { "context_id": "ctx_mvq3e2f1d8b04a6c2e9f7135", "task_id": "atk_mvq3e2f97a1c4d0b8e6f2359", "status": "working", "message": "Looking for the best days for Amsterdam → Lisbon, 1 Mar 2027 – 31 Mar 2027, one way (1 adult).", "criteria": { "trip_type": "oneway", "origins": ["..."], "destinations": ["..."], "departure": { "window": { "start": "2027-03-01", "end": "2027-03-31" } }, "passengers": { "adults": 1, "children": 0, "infants": 0 }, "currency": "EUR" }, "notes": [{ "kind": "default_passengers", "text": "No travellers were given; priced for one adult." }] } ``` The early reply depends on the search: | Search | Early reply | | - | - | | Exact dates | `Searching flights: Paris → Tokyo, 3 Oct 2027, back 17 Oct 2027, 4 adults.` | | A date window, or several destinations | `Looking for the best days for Amsterdam → Lisbon, … (1 adult).` | | No destination | `Looking for destinations from Paris, ….` | ```js theme={null} async function readUntilEnd(location, apiKey) { for (;;) { const res = await fetch(`https://api.gojinko.com${location}`, { headers: { "X-API-Key": apiKey } }); if (!res.ok) throw new Error(`task read failed: ${res.status}`); const task = await res.json(); if (task.status !== "working") return task; await new Promise((r) => setTimeout(r, 2000)); } } ``` A turn that has not ended 5 minutes after it was sent ends as `failed` with `error.code` `deadline_exceeded`. Send the message again. ## Stream the events Send `Accept: text/event-stream` on `POST` to receive the turn as Server-Sent Events on the same connection. ```bash theme={null} curl -N https://api.gojinko.com/v1/flight_ai_search \ --header "X-API-Key: $JINKO_API_KEY" \ --header "Content-Type: application/json" \ --header "Accept: text/event-stream" \ --data '{"text": "The cheapest day from Amsterdam to Lisbon in March 2027", "timezone": "Europe/Amsterdam", "currency": "EUR"}' ``` A search that ends with options sends five events: ```text theme={null} id: 1 event: task.status data: {"task_id":"atk_mvq3e2f97a1c4d0b8e6f2359","context_id":"ctx_mvq3e2f1d8b04a6c2e9f7135","status":"submitted","turn":1} id: 2 event: task.status data: {"task_id":"atk_mvq3e2f97a1c4d0b8e6f2359","context_id":"ctx_mvq3e2f1d8b04a6c2e9f7135","status":"working"} id: 3 event: agent.message data: {"task_id":"atk_mvq3e2f97a1c4d0b8e6f2359","context_id":"ctx_mvq3e2f1d8b04a6c2e9f7135","turn":1,"message":"Looking for the best days for Amsterdam → Lisbon, 1 Mar 2027 – 31 Mar 2027, one way (1 adult).","criteria":{...},"notes":[...]} id: 4 event: agent.message data: {"task_id":"atk_mvq3e2f97a1c4d0b8e6f2359","context_id":"ctx_mvq3e2f1d8b04a6c2e9f7135","turn":1,"message":"3 bookable options for Amsterdam → Lisbon, 1 Mar 2027 – 31 Mar 2027, one way, 1 adult. Best match: 54 EUR in total, nonstop.","status":"completed","criteria":{...},"notes":[...],"options":[...],"groups":[...],"has_more":false} id: 5 event: task.completed data: {"task_id":"atk_mvq3e2f97a1c4d0b8e6f2359","context_id":"ctx_mvq3e2f1d8b04a6c2e9f7135","status":"completed"} ``` | Event | Sent when | `data` carries | | - | - | - | | `task.status` | The turn is accepted (`submitted`), then starts (`working`). | `status`, and `turn` on `submitted`. | | `agent.message` | A reply is written: the early reply first, then the final reply. | `message`, `criteria`, `notes`; the final reply also carries `status`, `options`, `groups`, `has_more`, and `question` and `question_options` when it asks one. | | `task.completed` | The turn ended with an answer. | `status: "completed"`. | | `task.input_required` | The turn ended with a question. | `status: "input_required"`. | | `task.failed` | The turn failed. | `status: "failed"` and `error` (`code`, `message`). | | `task.expired` | The turn ran past its deadline, or its conversation expired while it waited for an answer. | `status: "failed"` and `error`. | | `task.canceled` | The task was canceled or replaced. | `status: "canceled"`, and `superseded_by` when a later message replaced it. | Every event carries `task_id` and `context_id`. `id` is the event's sequence number in the task. The stream ends after the event that ends the turn. Comment lines (`: keep-alive`) arrive every 15 seconds and carry no event; most SSE clients skip them. Events carry no `charge`. Read the task once the turn has ended to get it; see [Charges](/ai/flight-search/overview#charges). ### Resume a stream A stream also closes after 45 seconds without an event that ends the turn, or when the connection drops. Many flight searches run longer than 45 seconds, so plan to reconnect. Reconnect to the task's events with the `id` of the last event you received: ```bash theme={null} curl -N https://api.gojinko.com/v1/flight_ai_search/tasks/atk_mvq3e2f97a1c4d0b8e6f2359/events \ --header "X-API-Key: $JINKO_API_KEY" \ --header "Last-Event-ID: 3" ``` The stream resumes with the next event (`id: 4` here), with no gap and no repeat. Without `Last-Event-ID`, or with a value that is not a number, the stream starts from the first event of the task. For a task that has already ended, the stream sends the remaining events and closes. `GET .../events` always answers with a stream, whatever the `Accept` header. When `POST` with `Accept: text/event-stream` is refused (`400`, `402`, `404`, `410`, `422`, or an authentication error), the answer is the JSON error, with no stream. ## Cancel a search ```bash theme={null} curl --request POST https://api.gojinko.com/v1/flight_ai_search/tasks/atk_mvq3e2f97a1c4d0b8e6f2359:cancel \ --header "X-API-Key: $JINKO_API_KEY" ``` * A task that is `working` or `input_required` is canceled: `200` with `status: "canceled"`. It writes no further result. * A task that has already ended answers `409` `CONFLICT`, for example `The task has already ended (canceled).` You do not need to cancel before sending a correction. A new message in the conversation replaces a search that is still running; see [Conversations](/ai/flight-search/conversations#change-the-search-while-it-runs). ## Retry a message safely Send an `Idempotency-Key` header (1 to 200 characters) with each message when your client may send it twice, for example after a timeout or a `502`, `503` or `504`. * A retry with the same key does not send a second message. It answers the first message again: its stored answer once that turn is over, or the same wait as a new message while it runs. * Keys belong to your account, not to a conversation: every API key of the account shares them. The body of a retry is not compared with the first one, so a retry with a different `text` still gets the first answer. Use a new key for each new message. ## Related * [Flight AI search](/ai/flight-search/overview) * [Conversations](/ai/flight-search/conversations) * [Statuses and errors](/ai/flight-search/statuses-and-errors) # Conversations Source: https://docs.gojinko.com/ai/hotel-search/conversations Answer the questions a hotel AI search asks, refine a search with follow-ups, change it while it runs, and know when a conversation expires. A hotel AI search is a conversation. The traveler can answer a question, add a condition, change the destination or ask for more hotels, and each message builds on what was said before. ## Conversations and tasks | Id | Prefix | What it is | | - | - | - | | `context_id` | `ctx_` | The conversation with one traveler. It keeps the conditions of the search so far: destination, dates, guests, filters, the question asked and the last search. | | `task_id` | `atk_` | One search in that conversation, with its own `status`. You read, stream and cancel a search by its `task_id`. | The first message, sent without `context_id`, starts a conversation. Its answer carries both ids. Send `context_id` with every later message of the same traveler; keep one per traveler and conversation. Where a later message goes depends on the conversation's open task: | When the message arrives | What happens | | - | - | | A task is waiting for an answer (`input_required`). | The message answers it. The same task continues, with the same `task_id`. | | A task is still searching (`working`). | That task is canceled, with `superseded_by` set to a new task that handles the message. | | No task is open. | A new task starts and keeps the conditions of the conversation. | You do not need to send `task_id`. When you do, it must belong to the conversation, and it needs `context_id`: `task_id` alone answers `422`, and a task of another conversation answers `404`. ## Answer a question When a search cannot start, the answer is `input_required`. `message` is the question to show, and `question` says what is missing: ```json theme={null} { "context_id": "ctx_mvinvza31f78f689152a6387", "task_id": "atk_mvinvza8b1fe73f848458baa", "status": "input_required", "question": "checkin_checkout", "message": "What are your check-in and check-out dates in Lisbon?", "criteria": { "city_name": "Lisbon", "country_code": "PT", "occupancies": [{ "adults": 2, "children_ages": [] }] }, "notes": [] } ``` | `question` | Asked when | Example `message` | | - | - | - | | `destination` | There is no destination, the place cannot be found, the name fits several places and none is clearly meant, or a landmark cannot be located. | `Which city would you like to stay in?` | | `checkin_checkout` | There is no check-in date, or the dates are in the past. | `What are your check-in and check-out dates in Lisbon?` | | `children_ages` | Children are mentioned without the age of each child. | `How old are the 2 children?` | | `guests` | There are fewer adults than rooms; each room needs one adult. | `Each room needs at least one adult, and you asked for 3 rooms with 2 adults. How many adults and rooms?` | | `checkout` | There is a check-in date but no check-out. The answer also carries hotels for one night, with `reference: true`, as a price reference. | `Here are 20 hotels in Lisbon for Nov 6–7 (1 night, 2 adults, 1 room), as a price reference. What is your check-out date (you arrive Nov 6)?` | When several things are missing, the search asks for one at a time, in the order of the table. Send the traveler's answer as `text`, with the same `context_id`: ```bash theme={null} curl https://api.gojinko.com/v1/hotel_ai_search \ --header "X-API-Key: $JINKO_API_KEY" \ --header "Content-Type: application/json" \ --data '{"text": "from November 6 to November 8", "timezone": "Europe/Paris", "context_id": "ctx_mvinvza31f78f689152a6387"}' ``` The same task continues and searches: ```json theme={null} { "context_id": "ctx_mvinvza31f78f689152a6387", "task_id": "atk_mvinvza8b1fe73f848458baa", "status": "completed", "message": "Found 20 hotels in Lisbon for Nov 6–8 (2 nights, 2 adults, 1 room). More are available. Kept from before: Lisbon, 2 adults.", "criteria": { "city_name": "Lisbon", "country_code": "PT", "checkin": "2026-11-06", "checkout": "2026-11-08", "occupancies": [{ "adults": 2, "children_ages": [] }] }, "notes": [{ "kind": "kept", "conditions": ["Lisbon", "2 adults"] }], "hotels": ["..."], "has_more": true } ``` You do not send `question` back: the conversation knows what it asked. The traveler can also answer with a whole new request; it is read the same way. > [!NOTE] > > Hotels marked `reference: true` are priced for one night from the check-in, to show prices while the check-out is asked. Ask the check-out before booking the stay. ## Refine the search Each follow-up answers with a new search that keeps the conversation's conditions and applies the change. | The traveler says | What changes | | - | - | | "with a pool", "4 stars", "with breakfast", "refundable only" | The condition is added, or replaces the earlier value of the same kind. Dates, guests and destination are kept. | | "Make it Rome instead" | The destination changes. Dates, guests, rooms and filters are kept; a landmark of the old destination is cleared. | | "without the pool" | The condition is removed. Landmark, star rating, guest rating, budget, board, refundable, brand, facilities and property types can be removed; dates, guests and rooms are changed, not removed. | | "show more" | The next hotels of the same search, without those already shown: `Here are 20 more hotels.` When there are none left: `There are no more hotels for this search.` | | "somewhere quieter", "cheaper" | The order of the hotels changes; none is filtered out. The reply then says `sorted by how well they fit: …`. | `has_more: true` means more hotels match the search; ask for more in the same conversation. There is no page parameter. ### Notes `notes` lists the assumptions and changes the answer made. `message` already says the same in words. | `kind` | Fields | Example sentence in `message` | | - | - | - | | `kept` | `conditions` | `Kept from before: Paris, from Oct 24, 2 adults, 4 stars or more.` | | `dropped` | `conditions` | `Dropped: near Louvre.` | | `default_occupancy` | `adults`, `rooms` | `Guests were set to the default (1 adult, 1 room); tell me if you need to change them.` | | `ambiguous_destination` | `searched`, `candidates` | `I searched Paris, France; tell me if you meant Paris, Texas, United States instead.` | | `areas_not_searched` | `places` | `Belém could not be searched; its hotels are not included.` | | `budget_per_night` | `amount`, `currency` | `Your total budget was applied as at most EUR 300 per night and room.` | | `budget_by_cheapest_rate` | `amount`, `currency` | `A hotel is within EUR 200 per night and room by its cheapest rate; it can also show rates above that.` | | `first_stay_of_period` | `start`, `end` | `These are the first dates that fit between Dec 1 and Dec 10; tell me if you prefer others.` | | `budget_currency` | `currency` | `Prices are in EUR, the currency of your budget.` | | `star_rating_whole` | `bound` (`min` or `max`), `asked`, `searched` | `Hotel star ratings are whole numbers, so 3.5 stars or more was searched as 4 stars or more.` | | `requested_hotel` | `name`, `hotel_id` (null when no hotel of that name was found), `available` (null when not found), `within_filters` | `The Hoxton, Shoreditch has no rooms for these dates.` It is the first sentence of `message`. | ## Change the search while it runs A message sent while a task is `working` replaces it. Reading the first task then shows: ```json theme={null} { "context_id": "ctx_mvinwb3gc054723987d01351", "task_id": "atk_mvinwb3j1cf34dee951fc702", "status": "canceled", "superseded_by": "atk_mvinwbgbd34d5e7c92c823ff" } ``` Follow the task in `superseded_by`. To stop a search without sending a new message, [cancel it](/ai/hotel-search/waiting-for-results#cancel-a-search). ## When nothing matches A search that finds no hotel ends `completed`, with `hotels: []` and a reply that names the filters, for example `No hotel in Paris for Oct 24–25 (1 night, 2 adults, 1 room) matched all of: 4 stars or more, swimming pool. Tell me which condition to relax.` Filters are never widened without the traveler. A message that is not a hotel request, such as a greeting or a thank-you, also ends `completed`: `Tell me where and when you'd like to stay, and I'll search hotels.` A request for something other than hotels, such as a flight or a booking, answers `I can only search for hotels. To book one, use its offer id with the booking tools.` ## Expiry A conversation expires 24 hours after its last message. * A message sent with an expired `context_id` answers `410` `GONE`. Start a new conversation without `context_id`. * A task that was waiting for an answer ends `failed` with `error.code` `context_expired`. * Tasks stay readable by `task_id` after the conversation expires. ## Related * [Hotel AI search](/ai/hotel-search/overview) * [Waiting for results](/ai/hotel-search/waiting-for-results) * [Statuses and errors](/ai/hotel-search/statuses-and-errors) # Hotel AI search Source: https://docs.gojinko.com/ai/hotel-search/overview Search hotels from the traveler's own words over REST: send one sentence, answer the questions it asks, refine with follow-ups, and book a result. Hotel AI search takes the traveler's request as written, for example "find me an hotel for my wife birthday near the beach 1h away from San francisco driving next weekend", and answers with the hotels that match and a reply to show. A place described by its distance from a city, like the beaches within an hour's drive of San Francisco, is searched as the areas that fit. When something is missing, the answer asks for it. The traveler can then refine the search in the same conversation. > [!WARNING] > > Hotel AI search is in preview. The API may change. ## How it differs from hotel search | | [`POST /v1/hotel_search`](/api/hotel-search) | `POST /v1/hotel_ai_search` | | - | - | - | | Input | Structured fields: destination, dates, occupancy, filters. | The traveler's sentence, as `text`. | | Missing information | `422` for a missing required field. | A question to show the traveler (`status: "input_required"`). | | Follow-ups | Each call stands alone. | A conversation (`context_id`) keeps what was said, so "with a pool" refines the last search. | | Results | Hotels with offers. | The same hotel and offer objects, plus `message`, `criteria` and `notes`. | | Booking | `trip_item_token` → trip → checkout. | The same. | `hotel_search` can also rank by the traveler's wording; see [Search by intent](/guides/hotel-booking#search-by-intent). ## The flow ```mermaid theme={null} sequenceDiagram participant App as Your app participant Jinko App->>Jinko: POST /v1/hotel_ai_search {text, timezone} alt something is missing Jinko-->>App: 200 input_required + question App->>Jinko: POST /v1/hotel_ai_search {text: answer, context_id} end alt the search ends within 20 s Jinko-->>App: 200 completed + hotels else the search takes longer Jinko-->>App: 202 working + Location App->>Jinko: GET /v1/hotel_ai_search/tasks/{task_id} Jinko-->>App: 200 completed + hotels end App->>Jinko: POST /v1/trip {add_item: {trip_item_token}} App->>Jinko: POST /v1/checkout {trip_id} ``` 1. **Send the sentence.** One call with `text` and the traveler's `timezone`. 2. **Answer questions.** An `input_required` answer carries a question; send the traveler's answer with the same `context_id`. See [Conversations](/ai/hotel-search/conversations). 3. **Get the hotels.** Most searches answer `200` within 20 seconds. A longer one answers `202`; read the task until it ends, or stream it. See [Waiting for results](/ai/hotel-search/waiting-for-results). 4. **Refine.** "with a pool", "make it Porto instead", "show more": each follow-up goes in the same conversation. 5. **Book.** Add an offer's `trip_item_token` to a trip and check out, as for any hotel. ## Quickstart Hotel AI search is served on production only, at `https://api.gojinko.com`, with a production API key; the sandbox does not serve it. The request is the traveler's own words, as they typed them: ```bash theme={null} curl https://api.gojinko.com/v1/hotel_ai_search \ --header "X-API-Key: $JINKO_API_KEY" \ --header "Content-Type: application/json" \ --data '{ "text": "find me an hotel for my wife birthday near the beach 1h away from San francisco driving next weekend", "timezone": "America/Los_Angeles" }' ``` The search is still running after 20 seconds, so the call answers `202` with the task to read (`Location`, `Retry-After: 2`) and the early reply in `message`: `Searching hotels in San Francisco for Oct 31 – Nov 1 (1 night, 2 adults, 1 room). Results are on the way.` Read the task until `status` is no longer `working`: ```bash theme={null} curl https://api.gojinko.com/v1/hotel_ai_search/tasks/atk_mvtxc0ev86b6eba18717ed1e \ --header "X-API-Key: $JINKO_API_KEY" ``` The answer, with one hotel and one offer kept. "Next weekend" became October 31 to November 1, "my wife" two adults, and the beaches within an hour's drive of San Francisco the areas searched: ```json theme={null} { "context_id": "ctx_mvtxc0er7e2a605ae8496ce4", "task_id": "atk_mvtxc0ev86b6eba18717ed1e", "status": "completed", "message": "Found 20 hotels in 6 areas (Half Moon Bay, Pacifica, Stinson Beach, Bolinas, Muir Beach, Pescadero and 1 more) for Oct 31 – Nov 1 (1 night, 2 adults, 1 room), sorted by how well they fit: suitable for a birthday celebration, near the beach. More are available.", "criteria": { "intent": { "user_intent": "near the beach, 1 hour away from San Francisco driving, for wife's birthday" }, "checkin": "2026-10-31", "checkout": "2026-11-01", "city_name": "San Francisco", "occupancies": [ { "adults": 2, "children_ages": [] } ], "country_code": "US" }, "notes": [], "hotels": [ { "hotel_id": "lp63728", "name": "Casablanca Inn on The Beach", "address": "101 Main Street", "city": "Santa Cruz", "country": "us", "star_rating": 4, "rating": 8, "review_count": 2646, "latitude": 36.963462829589844, "longitude": -122.02234649658203, "distance_km": 1.3175047503989186, "match_score": 67, "offers": [ { "trip_item_token": "htl_7bbcee8530cc1d33", "board_type": "RO", "board_name": "Room Only", "total_amount": 185.96, "currency": "USD", "is_refundable": false, "payment_types": [ "pay_now" ], "room_rates": [ { "room_id": "1459983307", "room_name": "Newly Renovated 2 Queens, Street View", "occupancy": { "adults": 2 }, "board_type": "RO", "is_refundable": false } ] } ] } ], "has_more": true, "charge": { "turn": 1, "llm_usd": 0.026658, "api_usd": 0.168, "total_usd": 0.194658, "currency": "USD" } } ``` ## The request | Field | Required | Meaning | | - | - | - | | `text` | Yes | The traveler's message, 1 to 2000 characters: a request, an answer to a question, or a follow-up. | | `timezone` | Yes | The traveler's IANA time zone, such as `Europe/Paris`. Relative dates ("next weekend", "tonight") are computed in it. | | `context_id` | No | The conversation to continue, from an earlier answer. Omit it to start a new one. | | `task_id` | No | The task of that conversation the message answers. Usually omitted; see [Conversations](/ai/hotel-search/conversations#conversations-and-tasks). | | `currency` | No | The currency of the prices, ISO 4217 (`EUR`). | | `guest_nationality` | No | The guests' nationality, ISO 3166-1 alpha-2 (`FR`). It can change the rates offered. | Optional headers: `Prefer: wait=N` to change the 20-second wait, `Accept: text/event-stream` to stream, and `Idempotency-Key` to retry safely. See [Waiting for results](/ai/hotel-search/waiting-for-results). ## The answer | Field | Meaning | | - | - | | `context_id` | The conversation. Send it with the traveler's next message. | | `task_id` | This search. Use it to read, stream or cancel it. | | `status` | `working`, `input_required`, `completed`, `failed` or `canceled`. See [Statuses and errors](/ai/hotel-search/statuses-and-errors). | | `message` | The reply to show the traveler, in English. It says what was searched and which filters applied. | | `question` | With `input_required`: what is missing, one of `destination`, `checkin_checkout`, `children_ages`, `guests`, `checkout`. | | `criteria` | What was searched, in the [`hotel_search`](/api/hotel-search) request fields, plus `board_types` and `refundable_only`, the rate filters applied. | | `notes` | Assumptions and changes, such as conditions kept from before. See [Notes](/ai/hotel-search/conversations#notes). | | `hotels` | The hotels, in the same format as `hotel_search`. Each offer only has rates that meet `board_types` and `refundable_only`. A budget holds a hotel by its cheapest rate, so a hotel can also show rates above it. | | `has_more` | More hotels match; the traveler can ask for more in the same conversation. | | `reference` | `true` when the hotels are a one-night price reference shown while the check-out date is asked. | | `error` | With `failed`: `code` and `message`. | | `superseded_by` | With `canceled`: the task that replaced this one. | ## What the search understands | The traveler says | In `criteria` | What comes back | | - | - | - | | A city: "in Lisbon" | `city_name`, `country_code` | Hotels in the city. | | A landmark, district or station: "near the Louvre" | `query`, such as `"Louvre, Paris, FR"`, in place of `city_name` | Hotels around that point; the reply says `within N km of`. | | One hotel by its name: "Is the Hoxton Shoreditch available 14–16 Nov for two?" | `query` with the hotel's name | The reply says first whether that hotel has rooms for the stay; with rooms that meet the other conditions it comes first in `hotels`, followed by the hotels around it. `notes` says the same (`requested_hotel`). | | Dates: "from Nov 20 to 22", "next weekend", "3 nights from Friday" | `checkin`, `checkout` | Offers for the stay. | | Days of the week in a period: "a long weekend in early December", "a weekend in March", "arriving on a Friday in May" | `checkin`, `checkout` | Offers for the first stay that fits: a long weekend starts on a Thursday or Friday for 3 nights, a weekend on a Saturday for 1 night. `notes` says so (`first_stay_of_period`). A period alone ("3 nights in December") asks for the dates. | | Guests and rooms: "2 adults and a child of 5", "2 rooms" | `occupancies`, one entry per room, with `children_ages` | Offers for these guests and rooms. Each room needs one adult. | | Star rating: "4-star", "3 to 4 stars" | `min_star_rating`, `max_star_rating` | Only hotels in that range. Star ratings are whole numbers: "3.5 stars or better" is searched as 4 stars or more, and `notes` says so (`star_rating_whole`). | | Guest rating: "rated 8 or more" | `min_rating` (0 to 10) | Only hotels rated at least that. | | Budget: "under €200 a night", "€600 in total" | `max_budget_per_night` | Only hotels whose cheapest rate is within the budget, per night and room. Such a hotel keeps its other rates, and `notes` says so when some are above the budget (`budget_by_cheapest_rate`). A total budget is applied per night and room, and `notes` says so. | | Meals: "with breakfast", "half board", "room only" | `board_types` | Only rates with one of these boards. | | Cancellation: "refundable" | `refundable_only: true` | Only refundable rates. | | Facilities: "with a pool and parking" | `facility_ids` | Only hotels with every facility named. | | Property type: "an apartment", "a resort" | `hotel_type_ids` | Only hotels of that type. | | Brand: "a Hilton" | `chain_ids` | Only hotels of that brand. | | Preferences without a fixed value: "quiet", "romantic", "near the beach" | Not a filter | The order of the hotels; the reply then says `sorted by how well they fit: …`. | Requests in English, French and Chinese are understood. `message` is always in English; translate it in your app if your traveler reads another language. ## Book a result A result is booked like any hotel offer: add its `trip_item_token` to a trip, add the travelers and contact, then check out. ```bash theme={null} curl https://api.gojinko.com/v1/trip \ --header "X-API-Key: $JINKO_API_KEY" \ --header "Content-Type: application/json" \ --data '{"add_item": {"trip_item_token": "htl_d7018711c5d84b0a"}}' ``` `total_amount` is the price of the offer for the whole stay, in `currency`. Offers of a `reference: true` answer cover one night only. See [Hotels](/guides/hotel-booking) for rooms, rates and cancellation terms, and [Trips and checkout](/guides/trips-and-checkout) for the rest of the booking. ## Next * [Conversations](/ai/hotel-search/conversations): questions, follow-ups, corrections and expiry. * [Waiting for results](/ai/hotel-search/waiting-for-results): `202`, reading the task, streaming, cancel and retries. * [Statuses and errors](/ai/hotel-search/statuses-and-errors): every status, failure code and HTTP status. * API reference: [`POST /v1/hotel_ai_search`](/api/hotel-ai-search). # Statuses and errors Source: https://docs.gojinko.com/ai/hotel-search/statuses-and-errors What each status of a hotel AI search task means, why a search fails, and how to handle each HTTP status of the four routes. A hotel AI search answer has two layers. The HTTP status says whether the request was accepted. When it was, the `status` field says where the search is. Check the HTTP status first, then `status`. ## Task status Every successful answer (`200` or `202`) carries `status`, on `POST /v1/hotel_ai_search`, on the task read and on `:cancel`. | `status` | Meaning | What to do | | - | - | - | | `working` | The search is running. A `202` always carries this status. | Read the task again after `Retry-After` seconds, or [stream its events](/ai/hotel-search/waiting-for-results#stream-the-events). | | `input_required` | The reply asks the traveler a question; `question` says what is missing. The task waits for the answer. | Show `message`, then send the traveler's answer with the same `context_id`. See [Answer a question](/ai/hotel-search/conversations#answer-a-question). | | `completed` | The turn ended. `hotels` holds the results, or is empty when nothing matched. | Show `message` and the hotels. | | `failed` | The turn could not finish; `error` says why. | See [Why a search fails](#why-a-search-fails). | | `canceled` | The task was canceled, or a later message replaced it; then `superseded_by` names the new task. | Read the task in `superseded_by`, if any. | On `POST /v1/hotel_ai_search` without streaming, a `200` always carries one of the last four statuses: the turn is over, and nothing more arrives for it. The task read answers `200` with any status, `working` included, so keep reading it while `status` is `working`. A `completed` reply can still ask the traveler something, with no `question` field, for example `Tell me which condition to drop.` when no hotel matches every filter, or `Tell me where and when you'd like to stay, and I'll search hotels.` for a message that is not a hotel request. Always show `message`. The traveler's reply goes in the same conversation. In the event stream, `task.status` events also carry `submitted`, the moment a turn is accepted. A task read shows that moment as `working`. ## Why a search fails A failed task answers `200` with `status: "failed"` and an `error`: ```json theme={null} { "context_id": "ctx_mvinvg98ecb918c84c4e6770", "task_id": "atk_mvinvg9d9c9e4c6732210eeb", "status": "failed", "error": { "code": "deadline_exceeded", "message": "The search took too long. Please send the message again." } } ``` | `error.code` | Cause | `error.message` | What to do | | - | - | - | - | | `understanding_failed` | The message could not be read as a hotel search. | `The message could not be understood. Please rephrase it.` | Ask the traveler to rephrase. | | `unsupported_currency` | The search cannot price in the `currency` you sent. | `The search does not support this currency.` | Send another currency, such as `USD` or `EUR`. | | `invalid_timezone` | The time zone is not a known IANA time zone. Normally rejected first with `422`. | `The time zone is not a known IANA time zone.` | Send an IANA name such as `Europe/Paris`. | | `deadline_exceeded` | The turn did not end within 90 seconds. | `The search took too long. Please send the message again.` | Send the message again. | | `search_refused` | The hotel search refused the request. | `The search could not be completed. Please try again.` | Send the message again; contact support if it repeats. | | `agent_error` | An error stopped the turn. | `The search could not be completed. Please try again.` | Send the message again. | | `max_attempts_exceeded` | The turn was stopped after repeated errors. | `The search could not be completed. Please try again.` | Send the message again. | | `context_expired` | The task was waiting for an answer when its conversation expired (24 hours without a message). | `The search could not be completed. Please try again.` | Start a new conversation without `context_id`. | `message` is safe to show to the traveler. Branch on `code`. ## HTTP statuses Errors use the Jinko error format: `{"error": {"code": "...", "message": "..."}}`. See [Errors](/concepts/errors). ### All four routes | HTTP | `error.code` | When | What to do | | - | - | - | - | | `400` | `BAD_REQUEST` | Malformed JSON (`Malformed JSON in request body`), or an invalid header such as a reserved `X-End-User-Id`. | Fix the request. | | `401` | `AUTH_REQUIRED` | No key (`Missing X-API-Key or Authorization header.`), a key that is not a `jnk_` key, or an invalid or expired key (`Invalid or expired API key.`). | Send a valid key; see [API keys](/authentication/api-keys). | | `403` | `FORBIDDEN` | The key is valid but may not run live searches, for example `This API key is not granted the "search_live" scope required by this endpoint`; or AI search is not enabled for the tenant: `Travel AI search is not enabled for this tenant.` | Check the key's scopes in the dashboard. The key is valid, so do not rotate it. | | `422` | `BAD_REQUEST` | A field or header is out of range; `message` names it, for example `timezone: Required`. | Fix the field. | | `429` | `RATE_LIMITED` | The key has used up its request allowance (`The API key has used up its request allowance`). | Retry later; see [Rate limits](/concepts/rate-limits). | | `502` | `UPSTREAM_ERROR` | The request could not be completed (`The request could not be completed.`). | Retry. On `POST`, retry with the same `Idempotency-Key`. | | `503` | `TEMPORARILY_UNAVAILABLE` | The search is briefly unavailable. | Retry after a few seconds, with the same `Idempotency-Key` on `POST`. | | `504` | `UPSTREAM_TIMEOUT` | No answer in time (`The request timed out before a result was available. Retry the request.`). | Retry with the same `Idempotency-Key`; the first message may already be running. | ### `POST /v1/hotel_ai_search` | HTTP | When | | - | - | | `200` | The turn ended within the wait: `completed`, `input_required`, `failed` or `canceled`. With `Accept: text/event-stream`, the turn as a stream. A retry with an `Idempotency-Key` whose turn is over also answers `200` with its stored answer. | | `202` | The search is still running at the end of the wait: `status: "working"`, with `Location`, `Retry-After` and, when you sent `Prefer`, `Preference-Applied`. | | `404` | `NOT_FOUND`, `No such conversation or task.`: the `context_id` is unknown or belongs to another key's tenant, or the `task_id` is not in that conversation. | | `410` | `GONE`, `This conversation has expired. Start a new one without context_id.`: no message for 24 hours. | | `422` | The body is out of range. `text` must be 1 to 2000 characters; `timezone` is required and must be an IANA time zone; `currency` must be 3 letters (`currency: an ISO 4217 code`); `guest_nationality` must be 2 letters; `task_id` needs `context_id` (`task_id needs the context_id of its conversation`). Also `Idempotency-Key` outside 1 to 200 characters, and a body sent without a JSON `Content-Type`. | ### `GET /v1/hotel_ai_search/tasks/{task_id}` | HTTP | When | | - | - | | `200` | The task, with its current `status`. | | `404` | `NOT_FOUND`, `No such task.`: the task is unknown or belongs to another tenant. | | `422` | `task_id` is not 1 to 100 characters. | A task stays readable after its conversation expires. ### `GET /v1/hotel_ai_search/tasks/{task_id}/events` | HTTP | When | | - | - | | `200` | The event stream. | | `404` | `NOT_FOUND`, `No such task.` | | `422` | `task_id` is not 1 to 100 characters, or `Last-Event-ID` is longer than 20 characters. | ### `POST /v1/hotel_ai_search/tasks/{task_id}:cancel` | HTTP | When | | - | - | | `200` | The task was `working` or `input_required` and is now `canceled`. | | `404` | `NOT_FOUND`, `No such task.` | | `409` | `CONFLICT`: the task has already ended, for example `The task has already ended (completed).` | | `422` | `task_id` is not 1 to 100 characters. | ## Related * [Hotel AI search](/ai/hotel-search/overview) * [Conversations](/ai/hotel-search/conversations) * [Waiting for results](/ai/hotel-search/waiting-for-results) # Waiting for results Source: https://docs.gojinko.com/ai/hotel-search/waiting-for-results Get the answer of a hotel AI search in one call, by reading the task, or as a stream of events; cancel a search and retry a message safely. A search usually ends within the 20 seconds that `POST /v1/hotel_ai_search` waits. When it does not, the call answers `202` and the search goes on as a task that you read or stream until it ends. Pick one of three ways to get the result. | Way | Request | Use it when | | - | - | - | | Wait in the call (default) | `POST` with no extra header | You want one call that answers most searches. Handle `202` for the rest. | | Answer at once, then read the task | `POST` with `Prefer: wait=0`, then `GET /v1/hotel_ai_search/tasks/{task_id}` | You do not want to hold a connection open, or you run many searches at once. | | Stream the events | `POST` with `Accept: text/event-stream` | You show progress: the early reply first, then the hotels. | ## Wait in the call Without a `Prefer` header the call waits up to 20 seconds. * **`200`** when the turn ended in that time. `status` is `completed`, `input_required`, `failed` or `canceled`. Nothing more to read. * **`202`** when the search is still running. `status` is `working`, and the response carries: | Header | Value | | - | - | | `Location` | `/v1/hotel_ai_search/tasks/{task_id}`, the task to read. | | `Retry-After` | `2`, the seconds to wait before reading it. | | `Preference-Applied` | The wait applied, when you sent `Prefer`. | `Prefer: wait=N` sets the wait to `N` seconds, from `0` to `20`. A larger value is applied as `20`, and `Preference-Applied` says so (`wait=30` is answered with `Preference-Applied: wait=20`). An unreadable `Prefer` value is ignored and the default wait applies. ## Read the task ```bash theme={null} curl https://api.gojinko.com/v1/hotel_ai_search/tasks/atk_mvinwb3j1cf34dee951fc702 \ --header "X-API-Key: $JINKO_API_KEY" ``` The task read answers `200` with the same body as `POST`. Read it every `Retry-After` seconds while `status` is `working`, and stop at any other status. While the search runs, the task carries the early reply: `message` says what is being searched, and `criteria` holds it. ```json theme={null} { "context_id": "ctx_mvinvg98ecb918c84c4e6770", "task_id": "atk_mvinvg9d9c9e4c6732210eeb", "status": "working", "message": "Searching hotels in Paris for Oct 24–25 (1 night, 2 adults, 1 room). Results are on the way.", "criteria": { "city_name": "Paris", "country_code": "FR", "checkin": "2026-10-24", "checkout": "2026-10-25", "occupancies": [{ "adults": 2, "children_ages": [] }] } } ``` ```js theme={null} async function readUntilEnd(location, apiKey) { for (;;) { const res = await fetch(`https://api.gojinko.com${location}`, { headers: { "X-API-Key": apiKey } }); if (!res.ok) throw new Error(`task read failed: ${res.status}`); const task = await res.json(); if (task.status !== "working") return task; await new Promise((r) => setTimeout(r, 2000)); } } ``` A turn that has not ended 90 seconds after it started ends as `failed` with `error.code` `deadline_exceeded`. Send the message again. ## Stream the events Send `Accept: text/event-stream` on `POST` to receive the turn as Server-Sent Events on the same connection. ```bash theme={null} curl -N https://api.gojinko.com/v1/hotel_ai_search \ --header "X-API-Key: $JINKO_API_KEY" \ --header "Content-Type: application/json" \ --header "Accept: text/event-stream" \ --data '{"text": "A hotel in Paris next weekend for 2 adults with breakfast included", "timezone": "Europe/Paris"}' ``` A search that ends with hotels sends six events: ```text theme={null} id: 1 event: task.status data: {"task_id":"atk_mvinvg9d9c9e4c6732210eeb","context_id":"ctx_mvinvg98ecb918c84c4e6770","status":"submitted","turn":1} id: 2 event: task.status data: {"task_id":"atk_mvinvg9d9c9e4c6732210eeb","context_id":"ctx_mvinvg98ecb918c84c4e6770","status":"working"} id: 3 event: agent.message data: {"task_id":"atk_mvinvg9d9c9e4c6732210eeb","context_id":"ctx_mvinvg98ecb918c84c4e6770","turn":1,"message":"Searching hotels in Paris for Oct 24–25 (1 night, 2 adults, 1 room). Results are on the way.","criteria":{...},"notes":[]} id: 4 event: hotels.page data: {"task_id":"atk_mvinvg9d9c9e4c6732210eeb","context_id":"ctx_mvinvg98ecb918c84c4e6770","hotels":[...],"has_more":true,"reference":false} id: 5 event: agent.message data: {"task_id":"atk_mvinvg9d9c9e4c6732210eeb","context_id":"ctx_mvinvg98ecb918c84c4e6770","turn":1,"status":"completed","message":"Found 33 hotels in Paris for Oct 24–25 (1 night, 2 adults, 1 room) matching: breakfast included. More are available.","hotels":[...],"criteria":{...},"has_more":true,"notes":[]} id: 6 event: task.completed data: {"task_id":"atk_mvinvg9d9c9e4c6732210eeb","context_id":"ctx_mvinvg98ecb918c84c4e6770","status":"completed"} ``` | Event | Sent when | `data` carries | | - | - | - | | `task.status` | The turn is accepted (`submitted`), then starts (`working`). | `status`, and `turn` on `submitted`. | | `agent.message` | A reply is written: the early reply first, then the final reply. | `message`, `criteria`, `notes`; the final reply also carries `status`, `hotels`, `has_more`, and `question` when it asks one. | | `hotels.page` | Hotels are ready. | `hotels`, `has_more`, `reference`. | | `task.completed` | The turn ended with hotels. | `status: "completed"`. | | `task.input_required` | The turn ended with a question. | `status: "input_required"`. | | `task.failed` | The turn failed. | `status: "failed"` and `error` (`code`, `message`). | | `task.expired` | The turn ran past its deadline, or its conversation expired while it waited for an answer. | `status: "failed"` and `error`. | | `task.canceled` | The task was canceled or replaced. | `status: "canceled"`, and `superseded_by` when a later message replaced it. | Every event carries `task_id` and `context_id`. `id` is the event's sequence number in the task. The stream ends after the event that ends the turn. Comment lines (`: keep-alive`) arrive every 15 seconds and carry no event; most SSE clients skip them. ### Resume a stream A stream also closes after 45 seconds without an event that ends the turn, or when the connection drops. Reconnect to the task's events with the `id` of the last event you received: ```bash theme={null} curl -N https://api.gojinko.com/v1/hotel_ai_search/tasks/atk_mvinvg9d9c9e4c6732210eeb/events \ --header "X-API-Key: $JINKO_API_KEY" \ --header "Last-Event-ID: 2" ``` The stream resumes with the next event (`id: 3` here), with no gap and no repeat. Without `Last-Event-ID`, or with a value that is not a number, the stream starts from the first event of the task. For a task that has already ended, the stream sends the remaining events and closes. `GET .../events` always answers with a stream, whatever the `Accept` header. When `POST` with `Accept: text/event-stream` is refused (`400`, `404`, `410`, `422`, or an authentication error), the answer is the JSON error, with no stream. ## Cancel a search ```bash theme={null} curl --request POST https://api.gojinko.com/v1/hotel_ai_search/tasks/atk_mvinwbgbd34d5e7c92c823ff:cancel \ --header "X-API-Key: $JINKO_API_KEY" ``` * A task that is `working` or `input_required` is canceled: `200` with `status: "canceled"`. It writes no further result. * A task that has already ended answers `409` `CONFLICT`, for example `The task has already ended (canceled).` You do not need to cancel before sending a correction. A new message in the conversation replaces a search that is still running; see [Conversations](/ai/hotel-search/conversations#change-the-search-while-it-runs). ## Retry a message safely Send an `Idempotency-Key` header (1 to 200 characters) with each message when your client may send it twice, for example after a timeout or a `502`, `503` or `504`. * A retry with the same key does not send a second message. It answers the first message again: its stored answer once that turn is over, or the same wait as a new message while it runs. * Keys belong to your account, not to a conversation: every API key of the account shares them. The body of a retry is not compared with the first one, so a retry with a different `text` still gets the first answer. Use a new key for each new message. ## Related * [Hotel AI search](/ai/hotel-search/overview) * [Conversations](/ai/hotel-search/conversations) * [Statuses and errors](/ai/hotel-search/statuses-and-errors) * API reference: [`POST /v1/hotel_ai_search`](/api/hotel-ai-search), [`GET /v1/hotel_ai_search/tasks/{task_id}`](/api/hotel-ai-search-task), [`GET .../events`](/api/hotel-ai-search-events), [`POST ...:cancel`](/api/hotel-ai-search-cancel) # API reference Source: https://docs.gojinko.com/api-reference/introduction What the Jinko API offers and how to call it: explore travel demand, search flights, hotels, and rental cars, build a trip, pay, and manage bookings over HTTP. The Jinko API is the HTTP layer behind everything. Send a request with your API key and you can explore travel demand, search flights, hotels, and rental cars, build a trip, pay, and manage bookings from any language or backend. Every endpoint page includes its request and response schemas plus a try-it playground, so you can fill in values and run a live request. The endpoints are grouped by what they do (below). Prefer a typed client? The [TypeScript SDK](/connect/sdk) wraps these same endpoints with types and observability headers baked in. ## Base URL | Environment | Base URL | | - | - | | Production | `https://api.gojinko.com` | | Sandbox | `https://api.sandbox.gojinko.com` | Production is the default. Use **sandbox** to test the full flow without touching prod data. It uses **separate API keys** (see [Sandbox keys](/authentication/api-keys#sandbox-keys)). All examples below use production. **Sandbox flight tests: use Jinko Airline (`ZZ`).** It is a fake airline that exists only in sandbox: search with `include_carriers: ["ZZ"]` on a route such as JFK–LHR from tomorrow onwards, and book flight ZZ101 for the normal flow. Every other flight number triggers one documented behaviour, such as a price change, a sold-out booking or a failed ticket, so you can test failure paths on demand. See [Testing in sandbox](/guides/testing-in-sandbox). ## Authentication Authenticate every `/v1` request with your API key: ```http theme={null} X-API-Key: jnk_t_your_key ``` Or as a bearer token: `Authorization: Bearer jnk_t_your_key` Get a key from the [dashboard](https://dashboard.gojinko.com/developers/keys). See [API keys](/authentication/api-keys) for detail. Browser JavaScript can call the API directly: every response allows any origin. A key used from a web page is visible to anyone who loads that page; see [Calling from a browser](/authentication/api-keys#calling-from-a-browser) for when that is acceptable and what to use instead. ## Observability We strongly recommend setting these on every request, they make debugging possible when something goes wrong: ```http theme={null} X-Session-ID: X-Request-ID: ``` Keep these IDs in your client logs; they are not guaranteed to be echoed in response headers. If you open a support ticket, include the request ID you sent, the UTC time, endpoint, HTTP status, and error code. ## Response envelope Success: endpoint-specific JSON payload. Error: consistent envelope, same across all endpoints. ```json theme={null} { "error": { "code": "BAD_REQUEST", "message": "departure_date must be in the future", "doc_url": "https://docs.gojinko.com/concepts/errors" } } ``` `error.code` is a closed enum, and some failures carry an extra key beside `error` rather than inside it. See [Errors & troubleshooting](/concepts/errors) for the complete list of codes with a remedy for each. ## Typical request ```bash theme={null} curl https://api.gojinko.com/v1/flight_search \ -H "X-API-Key: jnk_t_..." \ -H "X-Request-ID: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{ "origin": "JFK", "destination": "CDG", "trip_type": "roundtrip", "departure_date": "2027-06-15", "return_date": "2027-06-22" }' ``` ## Endpoint groups > [card] [Travel Demand](/api/destination) > > See where people are searching to fly and how it trends over time: `destination`, `market`, `audience`, their `/trend` series, and `trend`. > [card] [Flights](/api/flight-search) > > Discover routes and dates, run a live search, then handle refunds and exchanges: `find-destination`, `flight-calendar`, `find-dates`, `lowest-fare`, `price-monitoring`, `flight-search`, `refund`, `exchange`. > [card] [Hotels](/api/hotel-search) > > Search hotels and pull details; `htl_*` tokens plug into the same trip as flights: `hotel-search`, `hotel-details`, `hotel-reviews`, `hotel-cancel`, `best-price-guarantee`, `best-price-guarantee-status`. > [card] [Cars](/api/car-search) > > Search live rental offers and cancel a rental with the fee shown first; `car_*` tokens plug into the same trip: `car-search`, `car-cancel-preview`, `car-cancel-commit`, `car-cancel-status`. > [card] [Trip & Payment](/api/trip) > > Build a trip, select ancillaries, check out, pay, and look up the booking: `trip`, `trip/ancillaries`, `select-ancillaries`, `checkout`, `agent-payment submit`, `trip-status`, `get-booking`. > [card] [Webhooks](/guides/webhooks) > > Register endpoints and get notified on booking events: `register`, `list`, `get`, `delete`, `test`. # agent-payment submit Source: https://docs.gojinko.com/api/agent-payment/submit api-reference/public-api.yaml POST /v1/agent_payment/submit Submit SPT payments; card submissions must use the payment hostname and are refused here Typed submissions require a jnk\_ API key via X-API-Key (ApiKeyAuth) or Authorization: Bearer (BearerAuth), a tenant-bound booking scope, quote_id and Idempotency-Key, and return a PaymentAttemptOutcome (200 known outcome / 202 pending). OAuth/JWT bearer tokens are supported only for the legacy flat token body, which keeps its existing authorization response. Request bodies are limited to 16 KiB. Card submissions must be sent to the payment hostname (`POST https://pay./v1/agent_payment/submit`); see the partner card payments guide. This route refuses card submissions with 400 CREDENTIAL_FORMAT_INVALID. # audience Source: https://docs.gojinko.com/api/audience api-reference/public-api.yaml GET /v1/audience Rank traveler audiences for a destination Ranks traveler audiences by current demand share (a point-in-time snapshot). Requires `destination`. # audience trend Source: https://docs.gojinko.com/api/audience/trend api-reference/public-api.yaml GET /v1/audience/trend Demand time series per traveler-type segment Returns a series for each traveler-type segment (excluding Unknown) for the given destination. Requires `destination`. # best-price-guarantee Source: https://docs.gojinko.com/api/best-price-guarantee api-reference/public-api.yaml POST /v1/best_price_guarantee Best Price Guarantee: ask for a hotel offer at a lower price found elsewhere Submit a hotel offer from `POST /v1/hotel_search` with the lower price the traveller found for the same stay on another site: the link, a screenshot address and the total payable at booking, in the currency of the offer. The submission is reviewed in the background and this call answers `pending` with an `id`, or the result when `wait_seconds` let it finish in time. The answer carries the state of the request in `status`: `pending` while the review runs, then `offered` with the new offer, or `declined` with the reason. A decline is a 200: it is an answer, not a failure of the call. An offered result is a NEW offer id to add to a trip; the submitted offer is left as it was. Jinko enables Best Price Guarantee per account: a key it is not enabled for is answered HTTP 200 `status: declined` with `decline.reason: feature_disabled`. # best-price-guarantee-status Source: https://docs.gojinko.com/api/best-price-guarantee-status api-reference/public-api.yaml GET /v1/best_price_guarantee/{id} Best Price Guarantee: read the result of a request Read a request submitted with `POST /v1/best_price_guarantee`. The answer carries the state of the request in `status`: `pending` while the review runs, then `offered` with the new offer, or `declined` with the reason. A decline is a 200: it is an answer, not a failure of the call. A request of another key's tenant is answered 404, the same as one that does not exist. # car-cancel-commit Source: https://docs.gojinko.com/api/car-cancel-commit api-reference/public-api.yaml POST /v1/car_cancel_commit Cancel a car rental booking Cancel the booking at the rental provider and refund the customer's payment minus the cancellation fee. Requires the `cancellation_id` from a preceding preview, binding the commit to the fee the customer saw. Safe to call twice, a committed cancellation is reported as it stands rather than repeated. `state: confirmed` is done; `state: pending` is recorded but not finished, the platform is still completing it, or a Jinko agent has it, so read car_cancel_status rather than committing again. `refund_pending_review: true` means the refund needs a person before it is issued. A preview that answered `manual_required: true` is committed with `manual_ok: true`, once the customer agrees: the cancellation is then recorded for a Jinko agent (`state: pending`, `refund_pending_review: true`) and nothing is sent to the rental company by this call. Without the flag that commit is refused 409 `manual_required`. The other 409 refusals are `QUOTE_EXPIRED` (preview again), `quote_drift` (the refund moved; commit against the `retry_quote_id` it names after showing the customer `current.refund`), `active_operation_exists`, `not_cancellable` and `funds_unavailable`, see `CarServicingConflictCode`. In every one of them nothing was cancelled. # car-cancel-preview Source: https://docs.gojinko.com/api/car-cancel-preview api-reference/public-api.yaml POST /v1/car_cancel_preview Preview the cost of cancelling a car rental booking Quote what cancelling would cost right now: the fee in force and the refund it would leave. Nothing is cancelled. `fee_known: false` means the fee could not be established, render it as "we will confirm the fee", never as free cancellation. The returned `quote_id` is required by car_cancel_commit, and binds until `expires_at` where one is given. `cancellable: false` with `manual_required: true` means the cancellation cannot be completed online (fee unknown, rental changed after payment, fee in another currency or above the rental) and `refund_review_reason` says why: it is not a dead end, once the customer agrees, commit it with `manual_ok: true` and a Jinko agent completes it. `cancellable: false` without that flag is a rental that cannot be cancelled at all (already cancelled, or over), carrying the cancellation that stands where there is one. Guest-authenticated: booking_ref + last_name; a wrong pair returns 404 rather than confirming the booking's existence. # car-cancel-status Source: https://docs.gojinko.com/api/car-cancel-status api-reference/public-api.yaml POST /v1/car_cancel_status Check the status of a car rental cancellation Report the latest cancellation attempt for the booking, whatever state it reached, including `refund_pending_review`, where the booking is cancelled but the refund awaits a human. Read-only. A 404 means either an unknown booking_ref + last_name pair or that no cancellation attempt exists yet for this booking, run car_cancel_preview first. # car-search Source: https://docs.gojinko.com/api/car-search api-reference/public-api.yaml POST /v1/car_search Search live car rental offers Search live car rental availability. `pick_up` names exactly one of an `airport_code` (IATA), a free-text `place` in any language (resolved server-side and echoed as `resolved_place`; a region or unclear text returns `candidates` to retry with), or `geo` coordinates; `drop_off` takes the same choice. Date-times are branch-local `YYYY-MM-DDTHH:MM:SS` with no timezone. Omit `drop_off` to return the car to the pick-up branch, setting `drop_off_date_time`. Pass each offer's `trip_item_token` verbatim to `POST /v1/trip` as `add_item.trip_item_token` to add the rental to a trip, then check out as normal. `price.pay_now` is the only amount Jinko charges, `due_at_desk` is collected by the rental desk locally. Offers come cheapest first; `max_results` (default 50) caps them and `total_found` counts every offer found. # checkout Source: https://docs.gojinko.com/api/checkout api-reference/public-api.yaml POST /v1/checkout Checkout a trip, returns a checkout URL the user opens to pay, plus the Shared Payment Token params an agent can use to pay programmatically Starts pricing when no valid quote exists and waits server-side for up to about 55 seconds. If the quote is still being priced, answers 503 QUOTE_PENDING with Retry-After; calling checkout again picks up the same quote. A successful response contains the quoted prices and checkout details; no GET trip polling is required first. An offer that ran out may be found again and priced, and `price_changed` on the item reports a moved price. 410 OFFER_EXPIRED means the product can no longer be found, even when no quote has ever succeeded. Search again and replace the item. QUOTE_EXPIRED instead describes an established quote that can no longer be used: its deadline passed, or the trip's travelers changed after it was priced (`reason: travelers_changed`). Call checkout again to re-quote. `status: partial` means some items could not be priced: each carries `quote_status: failed`, and the trip cannot be paid until they are replaced or removed. For card payments, `collector` identifies who charges the card (Jinko or the supplier), and `submit_url` is the payment hostname endpoint to POST the card to; cards are refused on this API. # destination Source: https://docs.gojinko.com/api/destination api-reference/public-api.yaml GET /v1/destination Rank the top destinations by travel demand Ranks destinations by current demand share (a point-in-time snapshot). Optional `destination_country` (a `Country:` selector, allowed only with `level=city`) narrows the ranking to that country’s destination cities. # destination trend Source: https://docs.gojinko.com/api/destination/trend api-reference/public-api.yaml GET /v1/destination/trend Demand time series for the top-N destinations Ranks destinations reachable from origin by within-window growth, then returns each top-N destination’s series. Optional `destination_country` (a `Country:` selector, allowed only with `level=city`) narrows the ranking to that country’s destination cities. # exchange commit Source: https://docs.gojinko.com/api/exchange/commit api-reference/public-api.yaml POST /v1/exchange_commit Commit a flight exchange Execute a previously priced exchange. A commit answers `status: "pending"`; poll [`exchange status`](/api/exchange/status) until it reads `confirmed`, `partial_failure` or `failed`. ## When the customer pays the difference With `payment_outcome: "ADD_COLLECT"` the commit carries `checkout_url`, the page where the customer pays the difference. Nothing is exchanged until that payment authorizes. Send the customer to the page, then poll `exchange_status`, which returns the same `checkout_url` while the payment is outstanding. The page takes the payment for up to one hour, or until the new fare's own deadline when that comes sooner. Until then a second commit answers 409 with `code: "exchange_in_progress"` and starts nothing. If the customer has not paid by then, the exchange is cancelled within a minute: `exchange_status` answers `failed` with the reason in `warnings` and no `checkout_url`, the page no longer works, nothing is charged and the booking is unchanged. The booking can then be exchanged, refunded or cancelled again; a new commit starts a new exchange with a new `checkout_url`. ## When an exchange can't be completed automatically A `409` with `manual_handling.status: "pending"` means the confirmed request is with Jinko support, who will complete it and contact the traveler about any payment. Show `error.message` and do not automatically retry commit. Read `get_booking` and the item's `servicing.exchange` to follow the request through manual handling to completion or closure. Pricing alone does not open the request. See [Flight exchanges](/guides/flight-exchanges) for the customer-visible states and support workflow. # exchange price Source: https://docs.gojinko.com/api/exchange/price api-reference/public-api.yaml POST /v1/exchange_price Price a specific exchange offer Price a specific exchange option from [`exchange shop`](/api/exchange/shop) before committing. `customer_amounts` states it in the customer's own figures: what they paid for the ticket (`original_fare`), the new ticket's value (`new_fare`), the airline's change fee (`penalty_amount`, absent when there is none), exactly what is charged (`total_due`), the price difference the exchange does not pay back when the new ticket costs less (`non_refundable_difference`, present only when there is one), and the part of the original fare the airline keeps as a credit (EMD) in the traveller's name after an exchange to a cheaper fare (`residual_value`, present only when the airline reports one; it is not refunded to the card and not part of `total_due`). An exchange does not pay a price difference back: `payment_outcome` is `ADD_COLLECT` or `EVEN`, never `REFUND`, and `total_refund` is never above 0. They add up: `original_fare + total_due = new_fare + penalty_amount + residual_value + non_refundable_difference`, an absent figure counting as 0. The top-level `fare_difference`, `original_fare`, `new_fare` and `penalty_amount` are the supplier's figures and are deprecated: use `customer_amounts.*` instead. # exchange shop Source: https://docs.gojinko.com/api/exchange/shop api-reference/public-api.yaml POST /v1/exchange_shop Shop for flight exchange alternatives List the alternative itineraries available to swap a booked flight onto. Pick one and price it with [`exchange price`](/api/exchange/price). Name each leg to change in `segments_to_exchange` by its first departure and final arrival airport, as `get_booking` lists it under `items[].confirmation.details.flight.legs`; legs you do not name stay as booked. `preferred_departure_date` moves the first leg to that date and reshops every leg, so use it only for a booking with a single leg. A selection the booking refuses answers 400 before any supplier is asked: `LEG_ALREADY_DEPARTED`, `DEPARTURE_DATE_IN_PAST`, `LEG_DATES_OUT_OF_ORDER` or `INVALID_SEGMENTS_TO_EXCHANGE`. `error.message` lists the booked legs, except for an `INVALID_SEGMENTS_TO_EXCHANGE` entry that is malformed (a field of the wrong type, or a date not written YYYY-MM-DD). A booking that cannot be exchanged as it stands answers 409 `NOT_EXCHANGEABLE`. See [Errors](/concepts/errors#error-code-reference). # exchange status Source: https://docs.gojinko.com/api/exchange/status api-reference/public-api.yaml POST /v1/exchange_status Check the status of an exchange Poll for terminal state of a previously committed exchange: `confirmed`, `partial_failure` or `failed`. While an `ADD_COLLECT` exchange waits for the customer's payment, the answer reads `pending` and carries `checkout_url`, the page to send the customer to. # find-dates Source: https://docs.gojinko.com/api/find-dates api-reference/public-api.yaml POST /v1/find_dates Best date options for a route, the cheapest itinerary per date pair, spread across the window Answers "when should I fly?" for a known route. Takes the same inputs as Flight Calendar but returns the cheapest itinerary for each of up to `limit` (default 20) (departure, return) date pairs, spread across the requested departure window, so the user gets a diverse shortlist rather than near-adjacent cheapest days. Cache-backed; no live pricing. Each result includes an `offer_token` to pass to `flight_search` for live pricing. Add the selected live fare’s `trip_item_token` to a trip. > [!NOTE] > > **Prices are in minor units.** `value` is an integer — divide by > `10 ** decimal_places` to display it. `{ "value": 15977, "decimal_places": 2 }` > is **\$159.77**, not \$15,977. See [Money & prices](/concepts/money). # find-destination Source: https://docs.gojinko.com/api/find-destination api-reference/public-api.yaml POST /v1/find_destination Discover travel destinations accessible from your departure airports Surface inspiration when a user knows where they want to leave from but not where they want to go. Typical prompts include "cheap beach getaways from New York" or "weekend trips out of London under €200". Results come back ranked by lowest available fare so the user can compare options before committing to a route. > [!NOTE] > > **Prices are in minor units.** `value` is an integer — divide by > `10 ** decimal_places` to display it. `{ "value": 15977, "decimal_places": 2 }` > is **\$159.77**, not \$15,977. See [Money & prices](/concepts/money). # flight-ai-search Source: https://docs.gojinko.com/api/flight-ai-search api-reference/public-api.yaml POST /v1/flight_ai_search Search flights from one sentence, with follow-ups Send the traveller's request in one sentence. The answer comes within about 20 seconds with `200`: the options, or a question to answer in the same conversation. When the search takes longer, the answer is `202` with the early reply and a `Location` to read until the task ends. Continue the conversation with its `context_id`. Every option is priced live and carries `fares`: book one by adding its `trip_item_token` with `POST /v1/trip` `add_item` before its `expires_at`. The JSON answer of an ended turn carries its `charge`; the event stream does not. # flight-ai-search-cancel Source: https://docs.gojinko.com/api/flight-ai-search-cancel api-reference/public-api.yaml POST /v1/flight_ai_search/tasks/{task_id}:cancel Cancel a flight AI search task Cancels a task that has not ended. A task that already ended answers `409` `CONFLICT`. # flight-ai-search-events Source: https://docs.gojinko.com/api/flight-ai-search-events api-reference/public-api.yaml GET /v1/flight_ai_search/tasks/{task_id}/events Stream a flight AI search task's events The task's events as Server-Sent Events, from the start or after `Last-Event-ID`. The stream ends when the task ends its turn, or after 45 seconds: reconnect with the `Last-Event-ID` of the last event received. # flight-ai-search-task Source: https://docs.gojinko.com/api/flight-ai-search-task api-reference/public-api.yaml GET /v1/flight_ai_search/tasks/{task_id} Read a flight AI search task The task's answer now: `working` with the early reply, or the final answer. # flight-calendar Source: https://docs.gojinko.com/api/flight-calendar api-reference/public-api.yaml POST /v1/flight_calendar Search flights between a known origin and destination for flexible dates Find priced itineraries between a known origin and destination using cached results, ideal when the user is flexible on dates. It answers questions like "cheapest week to fly Paris to Barcelona in June" or "best Friday to Sunday options from JFK to LAX next month". Each itinerary carries its `offer_token` (also returned as `id`, a deprecated alias with the same value): pass it unchanged as `offer_token` to `flight_search` for live pricing. Add the selected live fare’s `trip_item_token` to a trip. **Filters.** Besides `cabin_class` and `max_total` (one adult's fare), the request takes the filters a traveler usually states: * `max_stops`: `0` non-stop, `1` or `2` connections, per leg. * `departure_time_range` and `arrival_time_range` for the outbound leg, and `return_departure_time_range` and `return_arrival_time_range` for the return leg of a round trip. Each is a local `HH:MM` window at that airport and applies to every date searched. * `include_carriers` and `exclude_carriers`: on cached itineraries they match the ticketing airline. * `origin_radius_km` and `destination_radius_km` (at most 500): also search every airport within that distance of each code. * `connection_time_min_minutes` and `connection_time_max_minutes`: the shortest and longest layover, in minutes, at every connection of every leg; a non-stop leg passes. With either bound set, a page can hold fewer than `limit` itineraries even when more match, so keep reading with `next_page_token`; a non-zero `offset` is refused with `422`. `max_stops` 1 or 2, the time windows and `destination_radius_km` need at least one code in `destinations`. A search across every destination that sends one of them is refused with `422`; `max_stops: 0` is accepted there. A round trip from JFK or an airport within 100 km to Miami, at most one stop, leaving between 07:00 and 14:00, back home by 22:00, not on Spirit, at most 600 per adult: ```json theme={null} { "origins": ["JFK"], "destinations": ["MIA"], "origin_type": "airport", "destination_type": "airport", "trip_type": "roundtrip", "departure_date_ranges": [{ "start": "2026-12-18", "end": "2026-12-22" }], "stay_days_range": { "min": 5, "max": 9 }, "cabin_class": "economy", "max_stops": 1, "origin_radius_km": 100, "departure_time_range": { "earliest": "07:00", "latest": "14:00" }, "return_arrival_time_range": { "latest": "22:00" }, "exclude_carriers": ["NK"], "max_total": 600, "limit": 100 } ``` **Paging.** A response holds up to `limit` itineraries (at most 100). When more match, it carries `next_page_token`: send the same request again with that value as `page_token` to read the next page, and stop when a response has no `next_page_token`. Each page starts right after the last itinerary of the previous one, so an itinerary that expires between two pages does not make you miss another. An itinerary whose price changes between two pages can appear on both or on neither, so deduplicate by `offer_token`. `offset` is deprecated on this route: when cached fares expire between two requests, a read paged with `offset` can skip itineraries. > [!NOTE] > > **Prices are in minor units.** `value` is an integer — divide by > `10 ** decimal_places` to display it. `{ "value": 15977, "decimal_places": 2 }` > is **\$159.77**, not \$15,977. See [Money & prices](/concepts/money). # flight-price-advice Source: https://docs.gojinko.com/api/flight-price-advice api-reference/public-api.yaml POST /v1/flight_price_advice Accept a flight with its current price for price advice Accepts a flight with its current price and returns price advice. Available results compare the fare with typical fares for comparable flights and provide fixed 1-day and 3-day price forecasts, each with a forecasted price and estimated probabilities of an increase, decrease, or no change. Initial numeric coverage is one-adult, nonstop, USD; one-way, and round-trip with return_date; other structurally valid inputs return a reasoned unavailable result. The deterministic summary can be displayed without an LLM. The endpoint requires a verified jnk\_ API key and does not search, monitor, quote, or book flights. When the platform refuses the inputs, the answer is 400 or 422 `BAD_REQUEST` with the platform’s sentence; a 502 is a technical failure (`UPSTREAM_ERROR`). # flight-refund-commit Source: https://docs.gojinko.com/api/flight-refund-commit api-reference/public-api.yaml POST /v1/flight_refund_commit Refund or void a booked flight (every ticket on the item) against a quote the customer accepted Start the operation the preview described, a refund or a void, whichever the preview reported as `operation_kind`. The body is the `quote` handle and the `acknowledged` figure PLUS the same auth mode the preview took: ownership is re-checked here rather than carried by the handle, so the mode has to be sent again. `acknowledged` is the refund the customer was shown, copied from the preview as it arrived (`value` and `decimal_places` included): if your figure differs from the still-live quote’s refund, the call is refused with 409 `quote_drift`. `retry_quote_id` is that same quote’s handle and `current.refund` its figure. Show it to the customer, then commit again with that handle and figure. Nothing is sent to the airline. A MANUAL_REQUIRED quote needs `manual_ok: true`: the operation is then raised for a Jinko agent and answers `attention_required` with `reason: manual_required`, again without the airline being called. Committing one without the flag is refused 409 `manual_required`. That submission is also the one case where `acknowledged` may be left out: a MANUAL_REQUIRED quote whose penalty is unknown carries no `refund` to acknowledge, and there is nothing to compare against. Whenever the preview DID name a refund, send it. The other refusals are 409 `QUOTE_EXPIRED` (preview again), `active_operation_exists` (poll the `active_operation` when present instead of starting a second one), `not_cancellable`, `funds_unavailable`, `superseded`, and, when the preview already said `commitable: false` and you committed anyway, that quote’s own reason answered back as the code: `penalty_exceeds_sell` or `multi_currency_basis`. Success does NOT mean the money has moved: giving the tickets back at the airline and returning the money to the customer are separate steps, so the answer is an `operation` handle to poll with POST /v1/flight_refund_status. # flight-refund-preview Source: https://docs.gojinko.com/api/flight-refund-preview api-reference/public-api.yaml POST /v1/flight_refund_preview Preview what cancelling a booked flight (every ticket on the item) would return to the customer Quote what the customer would get back for this flight item, every ticket on it, right now: the refund, the penalty in force, and every document the operation would cover. NOTHING is sent to the airline. `refund` is what the customer paid less the penalty; for a ticket that was exchanged it is what the airline refunds for the ticket now held, on a void as on a refund (`settlement_basis: supplier_refund`). All amounts are customer-facing only. The platform decides WHICH operation this is and reports it as `operation_kind`: a ticket still inside its void window is `void`, the ticket is voided, penalty-free, and anything else is `cancel`, a refund under the fare rules. You cannot ask for one; read what you are given, because the void window closes with time. `commitable: false` with `support_level: MANUAL_REQUIRED` is not a dead end: the commit takes `manual_ok: true` and hands the operation to a Jinko agent. The handle this returns is named `quote`: it is what POST /v1/flight_refund_commit consumes, and it stops binding at `expires_at`. Every call here needs API authentication; this is about which mode identifies the booking. Call get_booking first, then send booking_ref and the selected booked_item_id. Guests must send last_name; owning credentials may omit it. The deprecated `provider`, `order_id`, `provider_reference` and `provider_booking_id` are accepted until 2027-04-30 where the request declares them; a request that sends one is answered with `Deprecation` and `Sunset` headers. # flight-refund-status Source: https://docs.gojinko.com/api/flight-refund-status api-reference/public-api.yaml POST /v1/flight_refund_status Check how a flight refund or void ended Report where one refund or void has got to, named by the `operation` handle a commit (or POST /v1/refund_commit) returned. Read-only. `state` is the platform view, keep polling while it is `in_progress` or `attention_required`, both of which mean the operation is still alive; `attention_required` means a Jinko agent has it, and `park_deadline` says how long that lasts. `operation_kind` says which operation actually ran. `provider` is what the airline says, including what became of each ticket and EMD, an operation has done its work when every document it covers has reached a terminal state. `money` is where the refund itself has got to; the two move independently, so the tickets can read refunded while the money is still in flight. Do not tell a customer they have been refunded until `money.vehicle_state` says `paid`. Same auth modes as flight_refund_preview. # flight-schedule Source: https://docs.gojinko.com/api/flight-schedule api-reference/public-api.yaml POST /v1/flight_schedule Flights observed between two places on exact dates (no price) Returns the trips the flight catalog has observed for one origin, one destination and an exact date pair. `trip_type` says which kind: `oneway` (no `return_date`) or `roundtrip` (`return_date` required); a round trip is an outbound + inbound pairing that was actually observed together, never a combination built from two one-ways. The answer carries no price, and `last_seen` is when a fare search last observed the trip, not a statement that it can be booked. Results are paged: send `pagination.next_page_token` back as `page_token` until it is empty. # flight-search Source: https://docs.gojinko.com/api/flight-search api-reference/public-api.yaml POST /v1/flight_search Get live flight pricing, search by route, or re-price a known offer Fetch live, bookable pricing for a specific route and date pair. Use it once the user has settled on exact travel dates, for example "Paris to New York departing June 1 returning June 8 in economy". It also reprices an offer surfaced earlier by the calendar or destination tools so you can confirm availability before adding it to a trip. ## Two modes, one endpoint `POST /v1/flight_search` serves both modes: * **Search mode**: filter-based live search by `origin`, `destination`, `departure_date`, and passengers. Returns priced offers, each fare carrying a `trip_item_token` you can add to a [trip](/api/trip). * **Reprice mode**: pass an `offer_token` from discovery (`find_destination`, `flight_calendar`) to re-price that specific offer before adding it to a trip. Route and filter fields are not allowed beside `offer_token`. The CLI mirrors this: pass `--offer-token` for reprice mode, omit it for search mode. ## Cabin class in live search Omit `cabin_class` or send `null` when the user has not requested a cabin. Providers search economy by default, and the response can include other recognized cabins they return. Send `economy`, `premium_economy`, `business`, or `first` only when the user explicitly chooses that cabin. Jinko filters returned fares to match the cabin on the itinerary's longest segment. Shorter connections may use another cabin; check segment details when presenting a mixed-cabin itinerary. One exception: a `business` search also returns `first` fares whose every flight is within the United States, Puerto Rico or the US Virgin Islands, because US airlines sell the domestic premium cabin as first; those fares keep `cabin_class` `first`. ## A successful search with no matches When a live search finds no offers that match the current filters, the endpoint returns **HTTP 200** with `offers: []`, `result: "no_matches"`, and an `instruction` that asks the caller to explain that the search succeeded. When the request sent a filter that narrows the results, the instruction asks the user which filter to relax: every such filter is applied exactly as sent, so the empty result means the filter combination was too restrictive for this route and dates. Otherwise it asks whether to try other dates or airports; see [Filters are always applied](/guides/flight-booking#filters-are-always-applied). The deprecated `X-Jinko-Result` and `X-Jinko-Instruction` headers carry the same outcome; read the body instead. The search answers `no_matches` whenever at least one airline source answered, even if another could not be searched. When some sources fail and others return offers, the response carries those offers and does not say which sources failed. With `max_wait_seconds`, a search whose wait ends before any offer arrives answers `timed_out` instead; see [A search with a wait limit](#a-search-with-a-wait-limit). A search where every source failed is an error: temporary unavailability or incomplete polling returns **503** (honor `Retry-After` when present and preserve the user's filters), and a timeout returns **504**. The error message is fixed per code; see [Messages on supplier failures](/concepts/errors#messages-on-supplier-failures). These search rules apply to live search mode; reprice and cache-based discovery retain their existing behavior. ## A search with a wait limit Send `max_wait_seconds` (an integer from 5 to 55) in search mode to bound how long the search waits for results. The search stops waiting that many seconds after the request reaches Jinko and answers with the offers found by then, which can be fewer than the same search returns without it. Without `max_wait_seconds`, the search answers once every source has answered. When no offer had been found by the end of the wait, the endpoint returns **HTTP 200** with `offers: []`, `result: "timed_out"` and an `instruction`. The search had not finished, so unlike `no_matches` the empty list does not show whether flights exist. Relay the instruction: it asks to search again with a higher `max_wait_seconds`, or without it. A value outside 5 to 55, or `max_wait_seconds` sent with `offer_token`, is refused with **422** `BAD_REQUEST`. ## Offer freshness Each fare can carry `searched_at` and `expires_at` as RFC 3339 timestamps. `searched_at` is when the supplier search began. `expires_at` is the earlier of a known supplier deadline and Jinko's 75-minute token lifetime. When the supplier gives no deadline, it bounds token retention only. Neither field guarantees availability or price; suppliers can withdraw an offer sooner. Missing timestamps mean unknown. Repeated searches can return the same `trip_item_token`. Use the timestamps and latest search result to assess freshness. Complete checkout promptly; if the user pauses, search again before checkout. After `expires_at`, search again and replace the item. There is no universal safe maximum age, and creating a trip does not extend the offer's lifetime. > [!NOTE] > > **Prices are in minor units.** `value` is an integer — divide by > `10 ** decimal_places` to display it. `{ "value": 15977, "decimal_places": 2 }` > is **\$159.77**, not \$15,977. See [Money & prices](/concepts/money). # get-booking Source: https://docs.gojinko.com/api/get-booking api-reference/public-api.yaml POST /v1/get_booking Retrieve booked item IDs and per-item servicing eligibility using the Jinko booking reference Authenticated API lookup for a booking the user already made. Guest access verifies the booking reference and last name; the integrating application still supplies API credentials. Use it when the traveler has their Jinko booking reference and last name, for example to look up the itinerary days later without signing in. Returns the full booking envelope: status, travelers, and itinerary items, each with its `booked_item_id` and its supplier confirmations in `supplier_references` (the airline's record locator per airline, the hotel's confirmation number, the rental reservation number). The flight itinerary in `items[].confirmation.details.flight.legs` is the one booked and ticketed. It is not refreshed from the airline afterwards: a schedule change or a cancellation made by the airline doesn't appear here, and no webhook reports it. The customer contact you send at checkout (an email and a phone number, not necessarily the traveler's) is passed on with the flight booking. Depending on how the flight was booked, it is sent to the airline as part of the reservation, or it stays with an intermediary booking system and Jinko can't confirm that it reaches the airline. Whether an airline that has the contact uses it to tell anyone about a change is up to the airline. # hotel-ai-search Source: https://docs.gojinko.com/api/hotel-ai-search api-reference/public-api.yaml POST /v1/hotel_ai_search Search hotels from one sentence, with follow-ups Send the traveller's request in one sentence. The answer comes within about 20 seconds with `200`: the hotels, or a question to answer in the same conversation. When the search takes longer, the answer is `202` with the early reply and a `Location` to read until the task ends. Continue the conversation with its `context_id`. > [!NOTE] > > New to hotel AI search? The [Hotel AI search guide](/ai/hotel-search/overview) walks through the whole flow: the first call, the questions it asks, follow-ups, `202` and streaming, and booking a result. # hotel-ai-search-cancel Source: https://docs.gojinko.com/api/hotel-ai-search-cancel api-reference/public-api.yaml POST /v1/hotel_ai_search/tasks/{task_id}:cancel Cancel a hotel AI search task Cancels a task that has not ended. A task that already ended answers `409` `CONFLICT`. > [!NOTE] > > A new message in the conversation already replaces a search that is still running. See [Waiting for results](/ai/hotel-search/waiting-for-results#cancel-a-search). # hotel-ai-search-events Source: https://docs.gojinko.com/api/hotel-ai-search-events api-reference/public-api.yaml GET /v1/hotel_ai_search/tasks/{task_id}/events Stream a hotel AI search task's events The task's events as Server-Sent Events, from the start or after `Last-Event-ID`. The stream ends when the task ends its turn, or after 45 seconds: reconnect with the `Last-Event-ID` of the last event received. > [!NOTE] > > The events, their order and how to resume a stream are described in [Waiting for results](/ai/hotel-search/waiting-for-results#stream-the-events). # hotel-ai-search-task Source: https://docs.gojinko.com/api/hotel-ai-search-task api-reference/public-api.yaml GET /v1/hotel_ai_search/tasks/{task_id} Read a hotel AI search task The task's answer now: `working` with the early reply, or the final answer. > [!NOTE] > > Read the task every `Retry-After` seconds while `status` is `working`. See [Waiting for results](/ai/hotel-search/waiting-for-results#read-the-task). # hotel-cancel Source: https://docs.gojinko.com/api/hotel-cancel api-reference/public-api.yaml POST /v1/hotel_cancel DEPRECATED, use /v1/hotel_cancel_preview and /v1/hotel_cancel_commit. Cancel a hotel booking and get a refund when eligible. Preview and commit in one call, POST /v1/hotel_cancel_preview plus /v1/hotel_cancel_commit is the two-step form, which shows the customer the refund before anything is cancelled. `refund_amount` is what the CUSTOMER gets back; all amounts are customer-facing only. Returning the money outlives this call: poll the `operation` handle with POST /v1/hotel_cancel_status. Every call here needs API authentication (an API key or a Bearer token); this is about which mode identifies the booking. Call get_booking first, then send booking_ref and the selected booked_item_id. Guests must send last_name; an owning credential may omit it. The deprecated `provider`, `order_id`, `provider_reference` and `provider_booking_id` are accepted until 2027-04-30 where the request declares them; a request that sends one is answered with `Deprecation` and `Sunset` headers. Cancel a hotel booking using the Jinko `booking_ref` and the hotel’s `booked_item_id` from `get_booking`. Omit `booked_item_id` only when the booking has exactly one hotel item. * **Guest verification:** send `booking_ref` and `last_name` together. * **Authenticated owner:** send `booking_ref` with a credential that owns the booking; `last_name` may be omitted. # hotel-cancel-commit Source: https://docs.gojinko.com/api/hotel-cancel-commit api-reference/public-api.yaml POST /v1/hotel_cancel_commit Cancel a hotel booking against a quote the customer accepted Start the cancellation the preview described. The body is the `quote` handle and the `acknowledged` figure PLUS the same booking_ref, item_id and last_name the preview took: ownership is re-checked here rather than carried by the handle, so they have to be sent again. `acknowledged` is the refund the customer was shown, copied from the preview as it arrived (`value` and `decimal_places` included): if your figure differs from the still-live quote’s refund, the call is refused with 409 `quote_drift`. `retry_quote_id` is that same quote’s handle and `current.refund` its figure. Show it to the customer, then commit again with that handle and figure. Nothing is cancelled. If the supplier’s policy moved since the quote, `quote_drift` has no `retry_quote_id`; preview again. The other refusals are 409 `QUOTE_EXPIRED` (run hotel_cancel_preview again), `active_operation_exists` (poll the `active_operation` when present instead of starting a second one), `not_cancellable` and `funds_unavailable`. Success does NOT mean the money has moved: cancelling at the supplier and refunding the customer are separate steps, so the answer is an `operation` handle to poll with POST /v1/hotel_cancel_status. # hotel-cancel-preview Source: https://docs.gojinko.com/api/hotel-cancel-preview api-reference/public-api.yaml POST /v1/hotel_cancel_preview Preview what cancelling a hotel booking would cost Quote what cancelling would return to the customer right now: the refund, the penalty in force, and the policy behind them. NOTHING is cancelled. `refund` is the customer figure, what they paid for the item less the penalty. All amounts are customer-facing only. `commitable: false` means a commit would be refused and `not_commitable_reason` says why. The handle this returns is named `quote`: it is what POST /v1/hotel_cancel_commit consumes, and it stops binding at `expires_at`. Every call here needs API authentication; this is about which mode identifies the booking. Call get_booking first, then send booking_ref and the selected booked_item_id. An owning credential identifies the booking without last_name; guests must supply it. The deprecated `provider`, `order_id`, `provider_reference` and `provider_booking_id` are accepted until 2027-04-30 where the request declares them; a request that sends one is answered with `Deprecation` and `Sunset` headers. # hotel-cancel-status Source: https://docs.gojinko.com/api/hotel-cancel-status api-reference/public-api.yaml POST /v1/hotel_cancel_status Check how a hotel cancellation ended Report where one cancellation has got to, named by the `operation` handle a commit (or POST /v1/hotel_cancel) returned. Read-only. `state` is the platform view, keep polling while it is `in_progress` or `attention_required`, both of which mean the operation is still alive. `provider` is what the supplier says about the booking and `money` is where the refund itself has got to; the two move independently, so a booking can read `cancelled` while the money is still in flight. Do not tell a customer they have been refunded until `money.vehicle_state` says `paid`. Same auth modes as hotel_cancel_preview. # hotel-details Source: https://docs.gojinko.com/api/hotel-details api-reference/public-api.yaml GET /v1/hotel_details/{hotel_id} Fetch rich metadata (gallery, facilities, policies, per-room details) for a single hotel Pull the full marketing and operational profile of a single property after a search result catches the user's attention. Useful for questions like "what amenities does this hotel have", "is there a pool on site", or "what is the cancellation policy on the deluxe room". Returns the gallery, facilities, room metadata, and policies in one payload. # hotel-reviews Source: https://docs.gojinko.com/api/hotel-reviews api-reference/public-api.yaml GET /v1/hotel_reviews/{hotel_id} Guest review summary and recent reviews for a single hotel Read what guests say about a single property after a search result catches the user's attention. Useful for questions like "what do guests say about this hotel", "is it clean", or "how is the location". Returns the overall guest score and review count, a summary of pros and cons, per-category scores (for example cleanliness, location and staff), and recent individual reviews, each with its headline, score, pros and cons, date, language and reviewer name. Reviews are not attributed to a source. Use `limit` and `offset` to page through them. # hotel-search Source: https://docs.gojinko.com/api/hotel-search api-reference/public-api.yaml POST /v1/hotel_search Search live hotel inventory and rates Search live hotel inventory and nightly rates for a destination and stay window. It handles requests like "three nights in Lisbon next weekend for two adults" or "family room in Rome with one child in August". Each result includes an `htl_*` offer token you can hand to the trip tool to start a booking. A hotel search is a session. Each call returns within a time limit with the hotels found so far. `has_more: true` means the search can go on: send `next_handle` for the next page, even when this page holds no hotel (`empty_reason: search_in_progress`). `has_more: false` means the search is over; on an empty page, `empty_reason` says why, or, for a search by `hotel_ids` or `hotel_name`, `destination_resolution.hotel_ids_without_rates` lists the hotels that priced nothing. > [!NOTE] > > **Read hotel prices from the `*_money` fields.** `rates[].total_amount_money`, > `taxes_breakdown[].amount_money` and `cancellation_schedule[].amount_money` > carry `value` in minor units with its `decimal_places`, the same shape as > every other money field: divide `value` by `10 ** decimal_places`, or show > `display`. A cancellation step expressed as a percentage or a number of > nights carries `percent` or `nights` instead. The older `total_amount`, > `amount` and `currency` fields are deprecated and hold major units. A room's > capacity is `room_capacity`; the deprecated `max_occupancy` repeats the > requested occupancy. See [Money & prices](/concepts/money). # lowest-fare Source: https://docs.gojinko.com/api/lowest-fare api-reference/public-api.yaml POST /v1/lowest_fare Cheapest fares for a fixed route + date, up to `limit` itineraries, cheapest first The cheapest fares for a fixed route and date. Takes the same inputs as Flight Calendar but for one specific departure date (one-way, or with a return date for round-trip) returns up to `limit` itineraries (default 10, at most 100) sorted cheapest-first. It takes the same filters as Flight Calendar: stops, time-of-day windows, airlines and a radius around each airport. The fixed-date counterpart of Flight Calendar. Reach for it when the date is locked and you just want the cheapest options that day. Cache-backed; no live pricing. Each result includes an `offer_token` to pass to `flight_search` for live pricing. Add the selected live fare’s `trip_item_token` to a trip. > [!NOTE] > > **Prices are in minor units.** `value` is an integer — divide by > `10 ** decimal_places` to display it. `{ "value": 15977, "decimal_places": 2 }` > is **\$159.77**, not \$15,977. See [Money & prices](/concepts/money). # market Source: https://docs.gojinko.com/api/market api-reference/public-api.yaml GET /v1/market Rank origin markets feeding a destination Ranks origin markets by current demand share (a point-in-time snapshot). Requires `destination`. Optional `origin_country` (a `Country:` selector, allowed only with `level=city`) narrows the ranking to that country’s origin cities. # market trend Source: https://docs.gojinko.com/api/market/trend api-reference/public-api.yaml GET /v1/market/trend Demand time series for the top-N source markets Ranks source markets feeding the destination by within-window growth, then returns each top-N market’s series. Requires `destination`. Optional `origin_country` (a `Country:` selector, allowed only with `level=city`) narrows the ranking to that country’s origin cities. # price-monitoring Source: https://docs.gojinko.com/api/price-monitoring api-reference/public-api.yaml POST /v1/price_monitoring Monitor price for a specific origin, destination, and dates pair Get one cached price snapshot for a specific route and date pair. To watch for a fare drop, schedule repeated calls and send alerts from your own application or agent. Cache-only; never triggers a live call. When `status` is `"ok"`, read the cheapest cached fare from `flight.total_price` and pass `flight.offer_token` to `flight_search` for live pricing before booking. When `status` is `"stale"`, no cached itinerary matches the request filters, so the response has no `flight`, fare or offer token. This does not mean there are no flights: retry later, or use `flight_search` with the requested route and dates for a live quote. > [!NOTE] > > **Prices are in minor units.** `value` is an integer — divide by > `10 ** decimal_places` to display it. `{ "value": 15977, "decimal_places": 2 }` > is **\$159.77**, not \$15,977. See [Money & prices](/concepts/money). # refund check Source: https://docs.gojinko.com/api/refund/check api-reference/public-api.yaml POST /v1/refund_check DEPRECATED, use /v1/flight_refund_preview. Check refund eligibility only; use flight_refund_preview for customer-facing amounts Check eligibility only: read `is_refundable`, `is_voidable`, `support_level`, and the documents covered. This read-only call returns no amounts. Use [`flight_refund_preview`](/api/flight-refund-preview) to show the customer’s refund and penalties before committing. # refund commit Source: https://docs.gojinko.com/api/refund/commit api-reference/public-api.yaml POST /v1/refund_commit DEPRECATED, use /v1/flight_refund_commit. Initiate a refund for a booked flight Issue the refund after the user has reviewed the amount and confirmed cancellation. Poll [`refund status`](/api/refund/status) for terminal state. # refund status Source: https://docs.gojinko.com/api/refund/status api-reference/public-api.yaml POST /v1/refund_status DEPRECATED, use /v1/flight_refund_status. Check the status of a refund Poll for terminal state of a previously committed refund. # select-ancillaries Source: https://docs.gojinko.com/api/select-ancillaries api-reference/public-api.yaml POST /v1/select_ancillaries Select ancillaries (baggage, seats, meals) for a trip item Add baggage or seat selections to a flight item before checkout. Use it after the trip has a flight item and travelers attached but before `checkout`, for example when a user requests "two checked bags and a window seat for the outbound leg". Selections use full-replacement semantics: include everything the user wants kept on the trip in a single call. # trend Source: https://docs.gojinko.com/api/trend api-reference/public-api.yaml GET /v1/trend Demand time series for explicit origin/destination pairs Deep dive: returns one de-sampled search-volume series per (origin, destination) pair. v1 allows a list on only one side (a single origin OR a single destination). # trip Source: https://docs.gojinko.com/api/trip api-reference/public-api.yaml POST /v1/trip Create and manage a trip: add or remove items and set travelers Assemble and edit a trip before sending it to checkout. Use it to add a flight, hotel, or car rental offer, set traveler details, swap one item for another, or attach ancillaries like bags and seats. Flights, hotels, and rental cars can sit side by side in the same trip and settle through a single checkout. A trip with a car item also needs `contact.title` (the honorific, for example `mr` or `ms`) before checkout. Unified trip management endpoint. In a single call you can `add_item` (by `trip_item_token`), `remove_item` (by `item_id`), and `upsert_travelers` (travelers + contact). Omit `trip_id` to create a new trip; include it to update an existing one. Returns the resulting trip state. **Creating or editing a trip does not start pricing.** A new item has no `price` until pricing succeeds. Call [checkout](/api/checkout) to start pricing and wait for its result. Polling `GET /v1/trip/{trip_id}` after creation does not initiate a quote. A missing price means unpriced, never free. Ancillaries are selected on a separate endpoint. See [select-ancillaries](/api/select-ancillaries). A trip lapses after 24 hours with no activity, and the offers and quote inside it expire sooner. See [Lifetimes and expiry](/concepts/overview#lifetimes-and-expiry). # trip-status Source: https://docs.gojinko.com/api/trip-status api-reference/public-api.yaml GET /v1/trip/{trip_id} Fetch the full lifecycle state of a trip, items, travelers, quote, fulfillment, and any booking references Inspect the current state of a trip without modifying it. Reach for it when you need to confirm what items are on the trip, verify the travelers attached to a booking, or check whether a checkout has finalized after the user paid. The response covers items, traveler details, the quote and its `quote_id`, the booking's progress in `booking_state` once payment starts, and any booking references that have been issued. This read does not start pricing. Checkout starts pricing and waits for success or failure. If `quote.status` is `failed`, no payable quote was established, even if an older response also carries `expires_at`. Failed quotes omit `expires_at` and can include `failure_reason` and `failure_message`. For `offer_expired` or `offer_unavailable`, search again and replace the item before checking out. If `quote.status` is `partial`, some items are priced and others are not: each item's `quote_status` says which, and the trip cannot be paid until a new checkout prices every item: remove or replace the items with `quote_status: failed`, or, after `provider_error`, call checkout again on the unchanged trip. A missing item `price_money` or `total_amount_money` means the figure is not known yet and must not be displayed as zero. `status` is one value for the whole trip. Once payment starts, `booking_state` summarizes the booking and `fulfillment.status` gives the detailed status behind it. See [Trip status and booking state](/concepts/overview#trip-status-and-booking-state). # trip ancillaries Source: https://docs.gojinko.com/api/trip/ancillaries api-reference/public-api.yaml GET /v1/trip/{trip_id}/ancillaries List purchasable ancillaries for a trip (no checkout) Returns the available ancillaries for a trip without generating a checkout URL. A price quote runs automatically to retrieve the ancillary catalog and is reused while valid. Responds **200** with `status: "ready"` and `items[]` when the quote is complete. If the quote is still being priced it responds **202** with `status: "pricing"` and a `Retry-After` header, poll the same URL until it returns 200. Never returns a checkout URL. # trip payment-attempts Source: https://docs.gojinko.com/api/trip/payment-attempts api-reference/public-api.yaml GET /v1/trip/{trip_id}/payment_attempts/{payment_attempt_id} Read a payment attempt outcome Read a payment attempt outcome # webhooks delete Source: https://docs.gojinko.com/api/webhooks/delete api-reference/public-api.yaml DELETE /v1/webhooks/{id} Delete a webhook subscription Delete a webhook subscription # webhooks deliveries Source: https://docs.gojinko.com/api/webhooks/deliveries api-reference/public-api.yaml GET /v1/webhooks/{id}/deliveries List deliveries for a webhook subscription Lists event deliveries to a subscription you own, newest first. Each row records one event delivery and its attempts. `payload` is the exact envelope sent, or null after it is purged 30 days after the delivery's last attempt or replay. Use next_cursor to fetch the next page. # webhooks get Source: https://docs.gojinko.com/api/webhooks/get api-reference/public-api.yaml GET /v1/webhooks/{id} Get a webhook subscription and its recent deliveries Get a webhook subscription and its recent deliveries # webhooks list Source: https://docs.gojinko.com/api/webhooks/list api-reference/public-api.yaml GET /v1/webhooks List the caller's webhook subscriptions List the caller's webhook subscriptions # webhooks register Source: https://docs.gojinko.com/api/webhooks/register api-reference/public-api.yaml POST /v1/webhooks Register a webhook endpoint for booking lifecycle events Subscribe a callback URL to `booking.processing`, `booking.completed`, `booking.failed`, `booking.partial`, `servicing.completed`, `servicing.exchange_confirmed`, `servicing.ticket_issued`, `servicing.failed`, or `servicing.price_drop_rebooked`. The response includes the HMAC signing secret ONCE. Deliveries are signed with `X-Jinko-Signature: sha256=` over `"."`. # webhooks replay Source: https://docs.gojinko.com/api/webhooks/replay api-reference/public-api.yaml POST /v1/webhooks/{id}/deliveries/{delivery_id}/replay Replay a webhook delivery Replays a delivered or exhausted event delivery for a subscription you own. Sets its status to pending, resets attempt_count to 0, increments replay_count, and enqueues a fresh delivery of the same payload with a new signature timestamp. The replay keeps the same event_id, so your idempotency key still applies. Pending or failed deliveries are still being delivered or retried and cannot be replayed. Payloads are purged 30 days after the delivery's last attempt or replay; a delivery whose payload was purged can no longer be replayed. # webhooks test Source: https://docs.gojinko.com/api/webhooks/test api-reference/public-api.yaml POST /v1/webhooks/{id}/test Send a sample signed event to validate the endpoint Delivers a `livemode: false` sample event so you can verify signature + connectivity without a real booking. # AI agent self-registration Source: https://docs.gojinko.com/authentication/agent-registration An AI agent's own organization and API key, with an optional human claim. An AI agent can create a Jinko organization and API key before a person signs up. Jinko's sign-in service handles the anonymous registration. A person can claim the organization later from the dashboard. ## Where an agent starts 1. [auth.md](https://dashboard.gojinko.com/auth.md) covers registration, token exchange, and the claim. Jinko's sign-in service generates the file. Its **Jinko on this environment** section adds Jinko's hosts and handoff. 2. [agents.md](https://dashboard.gojinko.com/agents.md) is the Jinko-specific guide. It lists the token `resource` at `https://mcp.platform.gojinko.com`, the Platform MCP at `https://mcp.platform.gojinko.com/mcp`, the `get_api_key` tool, the travel API hosts, and the claim flow. ## What the agent gets The first `get_api_key` call creates an organization with a default tenant. It returns a `jnk_t_` tenant key for the REST API, SDK, CLI, and MCP. This is a standard server-to-server [API key](/authentication/api-keys). Agent registrations can create production keys only by using `environment: production`. They cannot create sandbox keys. ## Claiming the organization 1. The agent creates a claim link. 2. The person opens the dashboard's `/claim` page and signs in. 3. The dashboard returns a code to the person. A person who already belongs to a Jinko organization cannot claim a second one. After the claim, the person becomes an admin and the agent keeps its admin role. The person can change the agent's role or remove it from the Organization page. Removing the agent revokes its keys. ## Limits and lifecycle 1. Registration is limited to five attempts per IP address per hour. 2. Access tokens and claim links last about five minutes. 3. An unclaimed organization and its keys are suspended after the three-day claim window ends. For people who sign in themselves, see the browser-based [OAuth flow](/authentication/oauth). # API keys Source: https://docs.gojinko.com/authentication/api-keys Get and use API keys (jnk_*) for programmatic access to Jinko. Use an API key to authenticate agents, scripts, CI/CD jobs, server-side apps, and MCP clients without OAuth support. New tenant keys start with `jnk_t_` in production and `jnk_sandbox_t_` in sandbox. Older person-bound keys with the `jnk_` prefix remain valid as legacy keys. The same key works with the [SDK](/connect/sdk), [CLI](/connect/cli), MCP clients, and direct [REST](/api-reference/introduction) calls. Route permissions still apply. Tenant keys cannot manage [webhook subscriptions](/guides/webhooks), so use the dashboard for that. For browser-based sign-in, use [MCP OAuth](/authentication/oauth) with a compatible client. Cursor, Codex, and Openclaw can also use an API key. See the [quickstart](/quickstart#connect-via-api-key). ## Get a key Create a key in the dashboard or ask an AI coding agent to create one through the Jinko platform MCP server. > [tab] AI coding agent (MCP) > > This works with any MCP-capable coding agent, including Claude Code, Codex, Cursor, Openclaw, Lovable, Replit, and opencode. Connect the agent to the Jinko platform MCP server, then ask it to call `get_api_key`: > > ``` > https://mcp.platform.gojinko.com/mcp > ``` > > Add it like any remote MCP server. Use a CLI command (`claude mcp add --transport http jinko-platform `), add it to the client's MCP config, or paste the URL into the integrations UI of a hosted builder such as Lovable or Replit. > > Sign in once through OAuth in the browser. `get_api_key` creates the organization and tenant when needed, then returns a tenant key with connection instructions for REST, SDK, CLI, and the booking MCP. > > > [!NOTE] > > > > **This is a standard server-to-server key.** Use it in the backend you are building. It is not limited to chat or to the MCP session that created it. The key also appears in the dashboard, where you can revoke it. > > The same MCP serves these docs through `search_docs`, `get_doc`, and `get_openapi`. An agent can create the account, get a key, and set up the integration in one session. > > **For AI agents:** Tell the user they can create a key in the dashboard on the free plan without a card. With their approval, you can also create one through `get_api_key`. > [tab] Dashboard (human) > > **1. Sign in to the dashboard** > > [dashboard.gojinko.com/developers/keys](https://dashboard.gojinko.com/developers/keys) > > New users are onboarded through Jinko Auth without a waitlist. > > **2. Create a key** > > Select **Create key** and give the key a clear name. Keys use the organization's shared [credit balance](/concepts/rate-limits). > > **3. Copy it once** > > The full key appears only once. Save it in 1Password or your secrets manager before leaving the page. > > If you lose it, create a new key and delete the old one. ## Use a key > [tab] SDK > > ```typescript theme={null} > import { createJinkoClient } from '@gojinko/api-client' > const client = await createJinkoClient({ apiKey: 'jnk_t_...' }) > ``` > > Or set `JINKO_API_KEY=jnk_t_...` and call `createJinkoClient()` with no arguments. > [tab] CLI > > ```bash theme={null} > # Persist to ~/.jinko/config.yaml > jinko auth login --key jnk_t_... > > # Or use an env var (no login needed) > export JINKO_API_KEY=jnk_t_... > jinko flight-calendar --origins CDG --destinations JFK --month 2027-06 > ``` > [tab] MCP (any client) > > Attach as an `Authorization: Bearer` header on the MCP endpoint: > > ```bash theme={null} > claude mcp add --transport http jinko https://mcp.builders.gojinko.com/mcp \ > --header "Authorization: Bearer jnk_t_..." > ``` > > See [Connect via API key](/quickstart#connect-via-api-key) for client-specific configs. > [tab] REST (curl / any HTTP client) > > ```bash theme={null} > curl https://api.gojinko.com/v1/flight_search \ > -H "X-API-Key: jnk_t_..." \ > -H "Content-Type: application/json" \ > -d '{ "origin": "JFK", "destination": "CDG", "trip_type": "oneway", "departure_date": "2027-06-15" }' > ``` > > `X-API-Key` is the recommended header on REST. The REST API accepts both `X-API-Key: jnk_t_...` and `Authorization: Bearer jnk_t_...`; see [Which header to send](#which-header-to-send). The gateway also accepts [OAuth bearer tokens](/authentication/oauth) via `Authorization: Bearer `. Route-specific ownership and scope checks still apply. ## Which header to send The header depends on the surface you call, not on the key. The same `jnk_t_...` key works on all of them. | Surface | Send | Also accepted | | - | - | - | | REST API (`api.gojinko.com`, `api.sandbox.gojinko.com`) | `X-API-Key: jnk_t_...` (recommended) | `Authorization: Bearer jnk_t_...` | | MCP (`mcp.builders.gojinko.com/mcp` and its sandbox host) | `Authorization: Bearer jnk_t_...` | Nothing else. The MCP endpoint does not read `X-API-Key`. | | Sandbox control plane (`platform-api.sandbox.gojinko.com`) | `X-API-Key: jnk_sandbox_t_...` | | Two REST details: 1. If a request carries both headers, Jinko reads `X-API-Key`. It must contain a `jnk_` key or the request returns 401. Send one authentication header, not both. 2. Send an OAuth token as `Authorization: Bearer `. Never send it in `X-API-Key`. The MCP server's own instructions tell a client to use `Authorization: Bearer`. That rule is about the MCP endpoint only and does not apply to REST calls. ## Calling from a browser The REST API answers cross-origin requests from any web page, so browser JavaScript can call it with `fetch` and either header from the table above: ```javascript theme={null} const res = await fetch('https://api.gojinko.com/v1/flight_search', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-API-Key': 'jnk_t_...' }, body: JSON.stringify({ origin: 'JFK', destination: 'CDG', trip_type: 'oneway', departure_date: '2027-06-15' }), }); ``` 1. Every response includes `Access-Control-Allow-Origin: *`, including errors. Browser code can read the status, the `error` body, and `Retry-After`. 2. The key travels in the request header and the API sets no cookies. Do not set `credentials: 'include'`. The browser will reject that request with a `TypeError` because the API allows every origin. 3. Anyone who loads the page can see a key embedded in browser code. Every production call also uses the organization's credit. Only expose a key in internal tools or prototypes used by people who may access it. 4. For a public site, keep the key on your server. The page calls your server, and your server calls Jinko. 5. Users of MCP clients such as Claude or Cursor can sign in through [MCP OAuth](/authentication/oauth). That sign-in does not give a web page a REST API token. ## Sandbox keys Production and sandbox are isolated. Sandbox lets you test the full flow without changing production data. Production tenant keys start with `jnk_t_`. Sandbox tenant keys start with `jnk_sandbox_t_`. Older person-bound keys with the `jnk_` prefix remain valid as legacy keys. Each key works only in the environment where it was created. In the dashboard, enable **Sandbox mode**, open **Developers**, then **API keys**, and select **Create key**. If you see **Not provisioned in Sandbox**, the account needs sandbox provisioning first. Point the client to the matching base URL: | Surface | Production | Sandbox | | - | - | - | | REST / SDK | `https://api.gojinko.com` | `https://api.sandbox.gojinko.com` | | MCP | `https://mcp.builders.gojinko.com/mcp` | `https://mcp.builders.sandbox.gojinko.com/mcp` | | CLI | default | `--env sandbox` | | Test-token mint (agentic payment) | none, by design | `https://platform-api.sandbox.gojinko.com` | The [CLI](/connect/cli#environments) and [SDK](/connect/sdk#environments) store production and sandbox keys separately. For REST and MCP, use the sandbox URL with the sandbox key. The sandbox control plane uses the same key to mint a test Shared Payment Token in the [sandbox walkthrough](/guides/sandbox-walkthrough). **Use Jinko Airline (`ZZ`) for sandbox flight tests.** It exists only in sandbox. Search with `include_carriers: ["ZZ"]` on a route such as JFK to LHR from tomorrow onwards. Book flight ZZ101 for the normal flow. Other flight numbers trigger documented cases such as a price change, a sold-out booking, or a failed ticket. See [Testing in sandbox](/guides/testing-in-sandbox). > [!NOTE] > > **Sandbox calls are not billed or refused for lack of credit.** The credit model in [Limits & credits](/concepts/rate-limits) applies only to production. A sandbox key does not use the organization's balance, so you can test a full booking flow without spending the monthly grant. > > Other limits still apply. Sandbox is a shared test environment, so use it as you would production. ## Rotation If a key leaks (committed to git, posted in chat, etc.): 1. Create a new key in the dashboard. 2. Update your scripts / env / config to use the new key. 3. Delete the old key in the dashboard. **Anything still using it will stop immediately.** Always rotate a key. You cannot edit it in place, and there is no grace period. ## Credit Keys have **no individual request quota**. Every key in an organization uses the same credit balance. Creating more keys does not increase that balance. The Free plan includes **\$5.00 of usage per month**. Unused credit does not roll over. When the balance runs out, calls return `402 PAYMENT_REQUIRED`, but the key stays active. Top up the balance to resume calls. See [Limits & credits](/concepts/rate-limits) for the full picture, including the separate per-second rate limit. ## Common failures | Symptom | Likely cause | Fix | | - | - | - | | `401 Unauthorized` | Key missing, mistyped, or revoked | Verify the key in the dashboard; check for whitespace at start/end | | `401` with `unexpected iss claim` | You're sending a CLI **OAuth** token, not an API key | Use a `jnk_*` key instead, see [OAuth](/authentication/oauth) for why | | `402 Payment Required` | The organization's credit balance can't cover the call | [Top up](https://dashboard.gojinko.com/developers/billing/topup). Don't retry, retrying never fills a wallet. The key is fine | | `429 Too Many Requests` | Calling faster than your organization's per-second ceiling | Back off and retry, honouring `Retry-After` if present. See [Limits & credits](/concepts/rate-limits) | | `403 Forbidden` on a specific endpoint | The key lacks the scope or role the route requires | Check its scopes in the dashboard and the target environment; the credential is valid, so do not rotate it | | Browser `fetch` rejects with a `TypeError` (`Failed to fetch` in Chrome) and a CORS error in the console | The request was sent with `credentials: 'include'` | Remove `credentials`; the key goes in the header. See [Calling from a browser](#calling-from-a-browser) | For `4xx` debugging, also check the response body, Jinko returns a structured `error` object with a code and message. See [Errors & troubleshooting](/concepts/errors). # OAuth Source: https://docs.gojinko.com/authentication/oauth Browser-based OAuth for MCP clients, REST bearer authentication, and API keys for the CLI. Use browser-based OAuth when an end user connects Jinko to a compatible MCP client. Use an [API key](/authentication/api-keys) for the CLI and new SDK integrations. CLI OAuth login is deprecated. ## MCP OAuth (DCR) MCP OAuth is the simplest option for end-user-facing MCP clients. The client discovers Jinko's authorization server, registers itself, and runs OAuth 2.1 with PKCE in the user's browser. ### Supported clients 1. **Claude Desktop or Claude Web:** Open Settings, then Connectors, then Add custom connector. Enter `https://mcp.builders.gojinko.com/mcp` and leave the OAuth fields blank. 2. **Claude Code:** Run `claude mcp add --transport http jinko https://mcp.builders.gojinko.com/mcp`. 3. **ChatGPT:** Add the connector in the MCP settings on desktop or web. 4. **Cursor:** Open Settings, then MCP Servers, and add the endpoint URL. ### What happens under the hood **1. Discovery** The client reads `https://mcp.builders.gojinko.com/.well-known/oauth-authorization-server` to find the authorization server at `auth.gojinko.com`. **2. Dynamic Client Registration** The client registers itself and receives a client ID and secret. No user action is required. **3. Authorization with PKCE** The client opens `auth.gojinko.com` in a browser. The user signs in or creates an account, then Jinko redirects the client with an authorization code. **4. Token exchange** The client exchanges the code for access and refresh tokens, then stores them using its normal credential storage. **5. Account auto-provision** On first use, Jinko reads the JWT `sub` claim and creates the user without a waitlist or manual approval. The client refreshes tokens automatically. ## CLI and SDK authentication The CLI accepts API keys, including interactive key entry with `jinko auth login`: ```bash theme={null} jinko auth login --key jnk_t_... ``` The SDK can read and refresh existing OAuth credentials from its shared configuration. The CLI no longer creates OAuth credentials. Do not pass an OAuth token to the SDK's `apiKey` option. ## OAuth on the REST API The REST gateway accepts Jinko OAuth bearer tokens and `jnk_` API keys. Ownership and route permissions still apply. ```bash theme={null} curl https://api.gojinko.com/v1/flight_search \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "origin": "JFK", "destination": "CDG", "trip_type": "oneway", "departure_date": "2027-06-15" }' ``` The REST gateway sends a non-key bearer token to the backend for verification. API keys can use `X-API-Key: jnk_t_...` or `Authorization: Bearer jnk_t_...`. New tenant keys start with `jnk_t_` in production and `jnk_sandbox_t_` in sandbox. Older person-bound keys with the `jnk_` prefix remain valid as legacy keys. MCP OAuth has its own client-managed sign-in flow. An existing CLI token is not automatically valid on MCP. ## Which auth should I use? | Scenario | Recommended | | - | - | | Building an MCP server or agent for end users | **MCP OAuth** with dynamic client registration | | Server-side script, CI, agent backend | **API key**, long-lived, no refresh logic | | Local development with the CLI | **API key**, saved with `jinko auth login --key jnk_t_...` | | Single-script automation on a workstation | **API key**, shared by the CLI and SDK | Use an API key when no user-facing sign-in is needed. ## Common failures | Symptom | Cause | Fix | | - | - | - | | `401 unexpected iss claim` on MCP endpoint | You pasted a CLI OAuth token where a JWT-from-AuthKit was expected | Use an API key (`jnk_t_...`) on MCP, or use a client that supports DCR | | MCP client can't reach the auth server | Network or proxy blocking `auth.gojinko.com` | Allow `auth.gojinko.com`, `mcp.builders.gojinko.com`, and `api.gojinko.com` | | Token refresh fails after a long idle period | Refresh token also expired | Sign in again through the MCP client, or configure an API key for CLI or SDK use | See [Errors & troubleshooting](/concepts/errors) for HTTP-level debugging. # Changelog Source: https://docs.gojinko.com/changelog Every version of the public REST contract since 0.57.0, newest first: what was added, changed, deprecated or removed. The contract version is `info.version` in the [OpenAPI document](/api-reference/introduction), and each section below is one version of it. The rules for what counts as breaking and how much notice a removal gets are on [Versioning & deprecation](/concepts/versioning). This page starts at 0.57.0 (2026-10-13). Earlier versions are not listed one by one; [Contract changes](/concepts/versioning#contract-changes) on Versioning & deprecation describes what changed in 0.26.0, 0.33.0 and 0.39.0. ## 0.116.0 Released 2026-11-11. The cached itinerary routes take a layover filter. **Added** * `connection_time_min_minutes` and `connection_time_max_minutes` on `POST /v1/flight_calendar`, `POST /v1/find_dates`, `POST /v1/lowest_fare` and `POST /v1/price_monitoring`: the shortest and longest acceptable layover, in minutes, applied to every connection of every leg, as on `POST /v1/flight_search`. A non-stop leg passes; an itinerary whose connection times cannot be read is dropped. With either bound set, a response can hold fewer than `limit` itineraries even when more match: on `flight_calendar`, keep reading with `next_page_token`; a non-zero `offset` with a bound is refused with `422`. On `price_monitoring`, `status` is `stale` when none of the cheapest cached itineraries fits. `find_destination` does not take them. ## 0.115.0 Released 2026-11-11. `POST /v1/flight_search` can be told how long to wait for results. **Added** * `max_wait_seconds` (an integer from 5 to 55) on `POST /v1/flight_search`, search mode only: the search stops waiting that many seconds after the request reaches Jinko and answers with the offers found by then, which can be fewer than a search without it returns. Without it, a search answers once every source has answered. A value outside 5 to 55, or `max_wait_seconds` sent with `offer_token`, is refused with 422 `BAD_REQUEST`. * `timed_out` in `result` on the `POST /v1/flight_search` response: the request set `max_wait_seconds` and no offer had been found when that wait ended. `offers` is empty and `instruction` asks to search again with a higher `max_wait_seconds`, or without it. The search had not finished, so unlike `no_matches` it does not show whether flights exist. ## 0.114.0 Released 2026-11-11. `POST /v1/flight_calendar` pages with a token, so a paged read no longer skips itineraries when cached fares expire between pages. **Added** * `page_token` on `POST /v1/flight_calendar`: send the previous response's `next_page_token` with the same request to read the next page; `limit` may change between pages. A page starts right after the last itinerary of the previous one, so an itinerary that expires between pages moves no other itinerary across a page boundary. Keep reading until a response has no `next_page_token`. An itinerary whose price changes between two pages can appear on both or on neither: deduplicate by `offer_token`. A token from another request, or one that can no longer be resumed, is refused with 400; request the first page again. `page_token` cannot be combined with a non-zero `offset` (422). * `next_page_token` on the `POST /v1/flight_calendar` response is filled: present when more itineraries match, absent on the last page. `find_dates` and `lowest_fare` do not page and never return it. * `FlightCalendarRequest`: `POST /v1/flight_calendar` has its own request component, the `find_dates` request plus `page_token`. **Deprecated** * `offset` on `POST /v1/flight_calendar`: page with `page_token`. When cached fares expire between two requests, every later itinerary moves up and the one at the page boundary is skipped. It is still accepted, answered with `Deprecation: true` and the deprecated-inputs `Link`, and listed under [Deprecated inputs](/concepts/versioning#deprecated-inputs). No removal date is set; it stays at least 180 days. ## 0.113.0 Released 2026-11-10. The cached flight routes take the filters a traveler states: a stop limit, departure and arrival time-of-day windows, airline lists and a radius around the origin and the destination. `lowest_fare` returns up to `limit` itineraries. **Added** * `max_stops` (0 to 2, per leg) on `POST /v1/flight_calendar`, `/v1/find_dates`, `/v1/lowest_fare` and `/v1/price_monitoring`, as on `POST /v1/flight_search`. * `departure_time_range`, `arrival_time_range`, `return_departure_time_range` and `return_arrival_time_range` (`TimeRange`, local `HH:MM`) on the same four routes. They apply to every date searched. The return windows need a round trip (`return_date` on `price_monitoring`). * `origin_radius_km` and `destination_radius_km` (greater than 0, at most 500) on the same four routes: the search also covers every airport within that straight-line distance of each code. They add airports and never remove the codes sent. * `include_carriers` and `exclude_carriers` on `POST /v1/flight_calendar`, `/v1/find_dates`, `/v1/lowest_fare` and `/v1/find_destination`. On these cached routes they match the ticketing (validating) airline, not each segment's marketing airline as on `POST /v1/flight_search`. `price_monitoring` already took them. The two lists must not overlap. * On `flight_calendar`, `find_dates` and `lowest_fare`, `max_stops` 1 or 2, the time windows and `destination_radius_km` need at least one code in `destinations`. A search across every destination that sends one of them is refused with 422. `max_stops: 0` and `origin_radius_km` are accepted there. * `LowestFareRequest`: `POST /v1/lowest_fare` has its own request component, the `flight_calendar` request with `limit` defaulting to 10. **Changed** * `limit` on `POST /v1/lowest_fare` is applied: up to `limit` itineraries (1 to 100, default 10), cheapest first. Before, the route returned at most ten whatever `limit` said. **Deprecated** * `direct_only` on `POST /v1/flight_calendar`, `/v1/find_dates`, `/v1/lowest_fare` and `/v1/price_monitoring`: send `max_stops: 0`. It is still accepted as the same filter, answered with `Deprecation: true` and the deprecated-inputs `Link`, and refused beside a non-zero `max_stops`. No removal date is set. It is listed under [Deprecated inputs](/concepts/versioning#deprecated-inputs). On `POST /v1/find_destination`, which takes no `max_stops`, it is unchanged. ## 0.89.0 Not yet released. **Deprecated** * `sort_by: recommendation` on `POST /v1/flight_calendar`, `/v1/find_dates`, `/v1/lowest_fare` and `/v1/find_destination` leaves the OpenAPI document; the published values are `lowest` alone. No recommendation order was ever implemented: the platform answered it cheapest first, exactly as `lowest`. A request that still sends it is accepted, read as `lowest` and answered as before, with `Deprecation: true` and the deprecated-inputs `Link`; no removal date is set yet. It is listed under [Deprecated inputs](/concepts/versioning#deprecated-inputs). **Changed** * `sort_by` is described on those four requests: `lowest`, the only order, is cheapest first by the cached one-adult total; on `find_destination` it orders destinations by their cheapest itinerary. Nothing on the wire moves. ## 0.86.0 Not yet released. **Changed** Corrections to the `POST /v1/flight_search` document only; nothing on the wire moves (the second step of the live flight search review, JIN-2837). * `via_airports` restricts every connection of a leg to the listed airports, not "at least one". Some providers are asked for at most the first 9 per leg; the whole list is applied to what they return, and the 200 description no longer claims a 9-airport cap. * The filters `refundable_only`, `changeable_only` and `checked_bag_included` are no longer described as the same predicate as the fare flags `is_refundable`, `is_changeable` and `checked_bag_included`. The filters read the before-departure rules only, and the bag filter needs a free bag on every segment; the flags are folded from every rule (an after-departure rule alone makes them `true`) and the bag flag reads the first segment that states an allowance. * `max_total`: conversion to `currency` before the comparison is the usual case, not the rule. A provider whose first priced offer is already in `currency` drops its other-currency offers as unverifiable. * `offers[].offer_id` is `offer__` followed by 8 hex characters (the example was `off_…`). It is the `offer_token` of a re-price and the prefix of each `trip_item_token`, which is now described with a real-shaped example. * `offers[].origin.code` and `destination.code` are the city codes of the requested pair, never the airport flown, and can be an empty string when the platform cannot map the code to a city. The examples are city codes and names. * On a live segment, `flight_number` is a bare number (the cached segment keeps the either-form text), `departure_city` and `arrival_city` are IATA city codes (the examples were names), and `operating_carrier` is no longer promised on every segment: whether equality with `airline` is stated depends on the provider. * `offers[].fares[].expires_at`: the platform's token lifetime is 75 minutes from `searched_at`, not 30. * `included_baggage` and `carry_on_baggage` are read from the first segment that states an allowance, not per leg. Their `description` is text the platform writes from the allowance (`1 bag, 23KG each`, `No checked bags included`, `1 carry-on bag`), not the carrier's prose; `weight_unit` is `KG` or `LB`, absent when no recognised unit was stated. * `refund_policy` and `change_policy` list all eight values each: the four base terms and their ` after departure` variants. A cancellation rule with an unspecified penalty reads `Non-refundable`; a change rule with one sets no policy. * Fields that had no description now have one: `departure_date`; `offer_token` (a cached-itinerary token is re-shopped live and `exact_match_found` says whether the same flights and cabin were found; an `offer_id` from an earlier `flight_search` is answered from the cache of that search unless the passengers or `currency` differ, and answers `410 OFFER_EXPIRED` once its fares have expired); `multi_fare` (at most 10 fares per offer); `connection_time_min_minutes`, `connection_time_max_minutes` and `aircraft_types` (an itinerary the filter cannot verify is dropped); `same_origin_airport_only` and `same_turnaround_airport_only` (round trip only, no effect on a one-way search); `limit` (omitted means the cheapest flight plus up to 100 alternatives); the segment's `aircraft` (absent when the provider reports no equipment); and the fare's `brand_name`. ## 0.81.0 Not yet released. **Removed** * `aircraft` on the segments of a cached itinerary, on `POST /v1/flight_calendar`, `/v1/find_dates`, `/v1/lowest_fare` and `/v1/find_destination`. The cache carries no equipment, so the field was never sent there; it leaves the document and no response changes. The cached itinerary's legs are now their own components, `CachedFlightLeg` and `CachedSegment`, with the same fields and types as `FlightLeg` and `Segment`, which `flight_search` and the booking reads keep unchanged, `aircraft` included. **Changed** Corrections to the document only; nothing on the wire moves. * On a cached leg or segment, a datetime at an airport whose timezone the platform does not know is written as UTC (`…Z`) with its local wall-clock digits. The shared text said the offset was omitted, which is what a live leg does. The live text now scopes its `*_local` remark to booked and exchanged itineraries. * `operating_carrier` on a cached segment is sent only when the cached record carries one. The shared text promised it was always sent, equality with `airline` included. * `limit` is described per route: on `flight_calendar` a global cap on the sorted itineraries; on `find_dates` the number of date pairs, each with its cheapest itinerary, default 20, where the route summary promised ten; on `lowest_fare` not applied, the route returns at most ten itineraries; on `find_destination` the number of destinations. * On `POST /v1/price_monitoring`, `status` is the enum `ok` | `stale` rather than a free string; the four `*_local` datetimes carry the airport's UTC offset (RFC 3339) despite their suffix, as they always did on the wire, and their examples now show it; `inbound_stops` is documented as omitted on a one-way monitor and on a non-stop return, unlike `outbound_stops`, which is always sent. ## 0.80.0 Not yet released. **Deprecated** * `amount` on `price_per_person` of a `POST /v1/flight_search` fare leaves the OpenAPI document. The per-person fare is now published as `MoneyWithoutAmount`: the `Money` shape without its deprecated `amount` member — `value` (an integer in minor units), `currency`, `decimal_places` and `display`, unchanged. The platform never set `amount` on this figure, so no response changes; the member stays in the code for now and is listed under [Deprecated fields](/concepts/versioning#deprecated-fields). `total_price` on the same fare is unchanged. ## 0.79.0 Not yet released. **Deprecated** * The passenger fields on the cache-backed flight requests leave the OpenAPI document: `adults`, `children`, `infants_in_lap`, `infants_in_seat`, `youth`, `student`, `ages` and `residency_country` on `POST /v1/flight_calendar`, `/v1/find_dates`, `/v1/lowest_fare` and `/v1/find_destination`, and `adults`, `children` and `infants` on `POST /v1/price_monitoring`. Every cached fare is one adult's whatever party is sent (`priced_for: one_adult`), so none of them ever changed an answer. A request that still sends one is accepted, validated and answered exactly as before, with `Deprecation: true` and the deprecated-inputs `Link`; no removal date is set yet. They are listed under [Deprecated inputs](/concepts/versioning#deprecated-inputs). Price a party with `POST /v1/flight_search`, which is unchanged. * On those requests a `passengers` object is still refused with 422, and the message now says the request takes no passenger counts instead of naming the fields above. ## 0.78.0 Released 2026-10-19. **Added** * Seat maps: `GET /v1/trip/{trip_id}` returns `seat_map_url`, a link to a page where the traveler picks seats on a seat map. The link expires; read the trip again for a fresh one. See [Seats](/concepts/ancillaries/seats). * Seat offers in `GET /v1/trip/{trip_id}/ancillaries` carry `seat_map_status`: `pending` while the seats are still loading, `ready` once they can be selected. * Selected and booked seats can carry `not_charged: true`: this seat is not charged to the traveler. ## 0.77.0 Released 2026-10-19. **Restored** Inputs and a response field removed without notice since 2026-08-29 that the platform still serves come back, deprecated, until 2027-04-30. A request that uses one of the restored inputs is answered as it was before the input was removed, with `Deprecation: true`, the deprecated-inputs `Link` and `Sunset: Fri, 30 Apr 2027 23:59:59 GMT`; each is listed under [Deprecated inputs](/concepts/versioning#deprecated-inputs). The restored response field sends no header, since reading a field is invisible to the server: it is marked `deprecated` in the OpenAPI document and listed under [Deprecated fields](/concepts/versioning#deprecated-fields). * The two `enable_*` query parameters on `hotel_search` that turned individual hotel suppliers on or off, refused since 0.57.0, are accepted and ignored: the platform chooses which hotel inventory to search. * `date_flexibility_days` on `POST /v1/flight_search`, refused since 2026-08-31, is accepted within its published range (an integer from 0 to 3) and ignored: the search runs on the exact dates, as it did then. * On `POST /v1/exchange_shop`, a `segments_to_exchange` entry may again name its airports as flat `origin` / `destination` codes, read as airports, and an empty `segments_to_exchange` reshops like leaving the field out, as before 0.43.0. * `hotel_ref` is back on `hotel_search` hotels and nearby alternatives, `hotel_details.hotel` and `hotel_reviews.hotel`, marked `deprecated` and sent until 2027-04-30 (listed under [Deprecated fields](/concepts/versioning#deprecated-fields)). `hotel_id` (search) and `id` (details, reviews) stay the identifier to use. **Unchanged** * `ticket_numbers` on the refund and exchange routes, `place_id` on `hotel_search` and a child age outside 0 to 17 stay refused. ## 0.76.1 Released 2026-10-18. **Changed** * `POST /v1/book` answers until 2027-04-30 instead of 2026-12-31; its `Sunset` header says so. The earlier date, published on 2026-09-07, gave less than the 180 days of notice this policy promises. `/v1/book` stays deprecated in favour of `POST /v1/checkout`. ## 0.76.0 Released 2026-10-18. **Added** * A request that uses a deprecated input is answered with `Deprecation: true` and `Link: ; rel="deprecation"`, and with `Sunset` when the input has a removal date. The response is otherwise unchanged; a request refused for naming one value under both its old and new name carries the headers too. The deprecated inputs are listed on [Versioning & deprecation](/concepts/versioning#deprecated-inputs). * `refund_check`, `refund_commit`, `refund_status` and the one-step `hotel_cancel`, deprecated in 0.74.0, answer with `Deprecation: true` and a `Link` to the route that replaces each (`rel="successor-version"`). No removal date is set, so they send no `Sunset`. **Restored** * The booking handles 0.57.0 removed without notice are accepted again, deprecated, until 2027-04-30: `order_id` instead of `booking_ref` on `refund_check`, `refund_commit`, `refund_status` and the exchange routes; `provider_reference` instead of `booking_ref` and `last_name` on `flight_refund_preview`, `flight_refund_commit`, `flight_refund_status`, `hotel_cancel_preview`, `hotel_cancel_commit` and `hotel_cancel_status`; `provider_booking_id` the same way on `hotel_cancel`; and `provider` on the flight refund and exchange routes and on `hotel_cancel`, which the platform does not need. A handle sent beside `booking_ref` is refused with 422. `booking_ref` is optional on these routes again, and required when no handle names the booking. A request that sends a handle gets `Sunset: Fri, 30 Apr 2027 23:59:59 GMT`. ## 0.75.0 Released 2026-10-18. **Added** * `booking.completed` data lists `items[]`: each booked item with its `item_id`, `kind`, `booked_item_id` and `supplier_references`, as `booking.partial` lists its completed items. You no longer need a `get_booking` call after every booking to learn the airline or hotel reference. `booked_item_id` is the `itm_` handle `get_booking` names the item by, and is omitted when the platform cannot name it. Events sent before this version carry no `items`. ## 0.74.2 Released 2026-10-18. **Fixed** * `exchange_price` and `exchange_commit` refuse an empty `offer_id` with 422 `BAD_REQUEST`. It used to come back as 502 `UPSTREAM_ERROR`. * `get_booking` `booked_ancillaries[].type` lists every kind that is booked: `seat`, `bag`, `meal`, `cabin_bag_upgrade`, `sports_equipment`, `priority_boarding`, `assistance`, `insurance`, `lounge`, `frequent_flyer`, `other`. The contract said seats only while bags and meals were already listed. * `flight_refund_preview` and `hotel_cancel_preview` document the 409 `active_operation_exists` a preview answers while another operation is in progress on the item, naming it in `active_operation`. * Payment attempt answers document that `trip_id` carries the `trip_` prefix, which the trip answers do not. ## 0.74.1 Released 2026-10-18. **Fixed** * `get_booking`: `booking.booking_ref` and `items[].booking_ref` are always the booking's own Jinko reference, including after an exchange and when the booking is looked up with the reference of one of its exchanges. In 0.74.0 an exchanged item named the exchange's own reference. The deprecated `booking_reference` fields keep their meaning. ## 0.74.0 Released 2026-10-17. **Breaking** * `error.code` is uppercase everywhere. `attempt_in_progress`, `attempt_terminal`, `credential_format_invalid`, `departure_date_in_past`, `idempotency_key_reused`, `invalid_exchange_request`, `invalid_segments_to_exchange`, `leg_already_departed`, `leg_dates_out_of_order`, `not_exchangeable`, `partial_exchange_unsupported`, `payment_credential_invalid`, `payment_type_not_enabled`, `temporarily_unavailable` and `trip_owned_by_other_payment` are now sent in uppercase (for example `ATTEMPT_IN_PROGRESS`), and `quote_expired` is now `QUOTE_EXPIRED`. * `payment_error.code` on payment attempts and payment refusals is uppercase, with the same codes as `error.code`. * On refund and cancellation conflicts, the sibling `code` `quote_expired` → `QUOTE_EXPIRED`. The other sibling codes are unchanged. * Exchange and ancillary `status` values are lowercase: `confirmed`, `pending`, `partial_failure` and `failed` on the `exchange_commit` and `exchange_status` answers; `pending`, `confirmed` and `failed` on selected and booked ancillaries. * `failure_reason` reads `offer_unavailable`, where it read `offer_not_available`, in the `booking.failed` data and wherever a booking failure is reported. * The travel demand `trip_type` is `oneway` or `roundtrip` on `/v1/destination`, `/v1/market`, `/v1/audience`, `/v1/trend`, `/v1/destination/trend`, `/v1/market/trend` and `/v1/audience/trend`. Requests still accept `One-Way` and `Round-Trip`. **Added** * `booking_state` on `GET /v1/trip/{trip_id}` and on the booking `get_booking` returns: a summary of the booking's progress after payment, one of `awaiting_payment`, `processing`, `completed`, `partial`, `failed`, `cancelled` or `needs_review`. It is absent before payment. `fulfillment.status`, the booking's `status` and `booking_status` stay as the detailed status. * `POST /v1/agent_payment/submit` declares 404 `NOT_FOUND` when the trip, or the `quote_id` among its quotes, is not found. Nothing is charged. * The answer to the legacy flat body of `POST /v1/agent_payment/submit` names the quote it charged as `quote_id`. **Changed** * Renamed request fields. Only the new name is documented; the old name is still accepted. Sending both names with different values is refused with 422 `BAD_REQUEST`, or 400 `CREDENTIAL_FORMAT_INVALID` on a typed payment body. * The integer `item_id` → `booked_item_id` on `refund_check`, `refund_commit`, `refund_status`, `flight_refund_preview`, `flight_refund_commit`, `flight_refund_status`, `hotel_cancel`, `hotel_cancel_preview`, `hotel_cancel_commit`, `hotel_cancel_status`, `car_cancel_preview`, `car_cancel_commit`, `car_cancel_status`, `exchange_shop`, `exchange_price`, `exchange_commit` and `exchange_status`. * `quote` → `quote_id` on `flight_refund_commit` and `hotel_cancel_commit`; `cancellation_id` → `quote_id` on `car_cancel_commit`; `session_reference` → `quote_id` on `exchange_commit`; the deprecated `quoted_cart_id` → `quote_id` on the typed `POST /v1/agent_payment/submit` body. * `max_price` → `max_total` on `flight_search` and `price_monitoring`. * `offer_id` → `trip_item_token` on the Best Price Guarantee claim. * `pax_ref_id` → `traveler_ref` on `select_ancillaries` selections; `passenger_type` → `traveler_type` on `upsert_travelers`. * The webhook `event_id` is documented as an opaque string, unique to each occurrence. Its format is not part of the contract. * On the cached flight searches, `max_total` is documented as a cap on the cached fare's total, and cached fares are priced for one adult. `direct_only` is documented as their only stop filter. **Deprecated** * Renamed response fields. Each new field is sent beside the old one, which keeps the same value and is marked `deprecated: true`. No removal date is set. * `quoted_cart_id` → `quote_id` on the checkout answer, the trip's `quote`, the trip ancillaries answer, payment attempts, payment refusals and the quote-expired answer; `quote` → `quote_id` on the flight refund and hotel cancellation previews; `cancellation_id` → `quote_id` on the rental car cancellation answers; `session_reference` → `quote_id` on `exchange_price`. `quote_id` is a string, and the deprecated names stay beside it. * `requote` → `retry_quote_id` on refund and cancellation conflicts. * `booking_reference` → `booking_ref`, the Jinko booking reference, on the `get_booking` booking and its items, the `exchange_commit` and `exchange_status` answers and the one-step `hotel_cancel` answer; `fulfillment_cart_id` → `booking_ref` on the trip's `fulfillment`, payment attempts and the legacy agent payment answer. The deprecated `fulfillment_cart_id` is an internal number. * The integer `item_id` → `booked_item_id`, the `itm_` handle the servicing routes take, on `get_booking` items and on payment attempt `items[]`; the integer `item` → `booked_item_id` on servicing webhook data; `item` → `booked_item_id` on the refund and cancellation previews, where `item` already held the same `itm_` value. * `quoted_item_id` → `item_id` on the `select_ancillaries` answer. * `pnr` and `airline_locators` on flight details, `hotel_confirmation_number` on hotel details, `confirmation.confirmation_number`, `bookings[].booking_reference`, `bookings[].pnr` and the `booking.partial` item's `booking_reference` → `supplier_references[]`, one `{ issuer, reference }` per confirmation the airline, hotel or rental company itself issued, `[]` when none is known. It is on each `get_booking` item, each `bookings[]` entry of `GET /v1/trip/{trip_id}` and each `booking.partial` item. * The single `airline_locator` on the exchange answers and `confirmation_number` on the one-step `hotel_cancel` answer: read the booking's `supplier_references[]` from `get_booking` instead. * `offer_id` → `trip_item_token` on hotel, rental car and Best Price Guarantee offers. The `offer_id` echo on trip items and bookings is deprecated; hotel and rental car items now also echo `trip_item_token`. * `id` → `offer_token` on cached itineraries. * `pax_ref_id` → `traveler_ref` and `passenger_type` → `traveler_type` on stored travelers and on ancillaries. `traveler_type` is lowercase: `adult`, `child`, `infant`. * `reason_code` → `failure_reason` in the booking failure email content, in the words of the `booking.failed` data. * `stripe_checkout_session_url` → `checkout_url` on `exchange_commit`. * `stripe_reference` and `stripe_refund_id`. * `refund_check`, `refund_commit` and `refund_status`, in favour of `flight_refund_preview`, `flight_refund_commit` and `flight_refund_status`; the one-step `hotel_cancel`, in favour of `hotel_cancel_preview`, `hotel_cancel_commit` and `hotel_cancel_status`. * The webhook envelope's `status`: branch on `event`, which already names the outcome. * The trip `status` values that describe booking progress (`fulfilling`, `fulfilled`, `partially_fulfilled`, `failed`): read `booking_state`. **Fixed** * `POST /v1/checkout` says it waits about 55 seconds for the quote. It said 25. * `GET /v1/trip/{trip_id}/ancillaries` declares its 202 answer (`status: "pricing"`, with `Retry-After`), which it already returned. * `Idempotency-Key` is documented as required on a typed payment submission. A submission without it is refused with 400 `CREDENTIAL_FORMAT_INVALID`. * `origin` is documented as required on `/v1/destination` and `/v1/destination/trend`, which refuse a request without it. * `TRIP_STATE_CONFLICT` no longer says a trip refuses writes while it is being quoted. A trip refuses writes once payment has started, or when it is cancelled or failed. `QUOTE_PENDING` lists `quote_id` among its extra keys. ## 0.73.0 Released 2026-10-17. **Deprecated** * On `hotel_search`, each of these is still accepted or still sent with its behaviour unchanged. No removal date is set. * `adults`, `children` and `rooms` → `occupancies`, one element per room, with children given by `children_ages`. The shorthand is ignored whenever `occupancies` is sent. * `star_rating` → `min_star_rating` and `max_star_rating`. `star_rating` only fills a bound the request leaves unset. * `offset` → `next_handle`. A search that answers with `next_handle` already refuses a non-zero `offset`. * The `search_handle` answer field → `next_handle`. No endpoint accepts `search_handle`. ## 0.72.0 Released 2026-10-17. **Breaking** * `hotel_ref` is removed from `hotel_search` hotels, from `hotel` on `hotel_details` and from `hotel` on `hotel_reviews`. One identifier remains: `hotel_id` on a search hotel and `id` on details and reviews, with the same value. `/v1/hotel_details/{hotel_id}` and `/v1/hotel_reviews/{hotel_id}` take that value, and still accept a `hotel_ref` kept from an earlier search. **Changed** * `hotel_id` is opaque. Pass it back exactly as received to `hotel_details`, `hotel_reviews` and `hotel_ids`. Do not parse or build it, and do not keep it across contract versions: the value a hotel is known by can change, so read it from a fresh `hotel_search`. **Fixed** * The `hotel_details` example `id` shows the same value as the `hotel_search` example. ## 0.71.0 Released 2026-10-17. **Added** * `hotel_search` declares `destination_resolution.radius_source`, which destination searches already sent beside `radius_km`: `caller` when the request's own `radius_km` was searched, `city` when the radius came from the spread of the resolved city's hotels (no smaller than the platform minimum), and `default` when coordinates came without a radius and the platform default was used. A `city` or `default` radius may be widened when the first search finds too little; `radius_km` is then the radius finally searched. It is absent on the `hotel_name` and `hotel_ids` shapes. **Removed** * `destination_resolution.place_id`, and `place_id` as a value of `destination_resolution.shape`. No answer carried them, since a `place_id` destination is refused on input with 422. `shape` is one of `city`, `coordinates`, `query`, `hotel_name` and `hotel_ids`, and its description says which other fields each one brings. ## 0.70.0 Released 2026-10-17. **Breaking** * `hotel_search` no longer returns `pagination`, which some destination searches sent although the contract never declared it. Page with `next_handle`, `has_more` and `expires_at`; `total` still counts the hotels on the page. * Each entry of `hotels[].offers[]` and `nearby_alternatives[].offers[]` no longer carries `semantic_matches`, `promotions[].code` or `room_rates[].rate_id`. No operation accepted `rate_id`. `promotions[].name` and `promotions[].remark`, which must be shown to the guest, stay, as do `room_id`, `occupancy_number`, `occupancy` and the rest of each room rate. The deprecated `rooms[].rates[]` shape, including its promotion `code`, is unchanged. ## 0.69.0 Released 2026-10-17. **Breaking** * `hotel_search` no longer returns `budget_filter`, the report of how `max_budget_per_night` was applied. The filter itself is unchanged: `max_budget_per_night` stays on the request, every hotel returned fits it, `empty_reason` is `all_dropped_by_budget` when none did, and `warnings` still carries the budget advisories. * `hotel_search` no longer returns `search_context.trip_id`. `trip_id` on a first request is no longer declared; a request that still sends it is accepted and the field is ignored. It never selected, priced or filtered anything. Adding a hotel offer to a trip with `POST /v1/trip` is unchanged. ## 0.68.0 Released 2026-10-17. **Breaking** * `hotel_search` no longer returns `search_scope`, which described how the search ran: `plan_kind`, `coverage`, `snapshot_size`, `candidate_count`, `coverage_unknown`, `truncated`, `widened_from_km` and `providers[]`. Paging is unchanged, and `destination_resolution` still reports the radius a destination search ended at. ## 0.67.0 Released 2026-10-16. **Breaking** * `hotel_search` no longer returns `intent_match_probability`, `intent_confidence`, `intent_evidence_status` or `intent_facts` on hotels in `hotels` and `nearby_alternatives`, nor `internal_search` on the answer. `distance_km` and `recommendation_score` stay, and the order of `hotels` and `recommendation_score` still reflect `intent.user_intent`. ## 0.66.0 Released 2026-10-16. **Fixed** * The legacy flat body of `POST /v1/agent_payment/submit` no longer declares `intent`. A body that still carries it is accepted and the field is ignored. Before, such a submission was refused with `CREDENTIAL_FORMAT_INVALID`. ## 0.65.0 Released 2026-10-16. **Breaking** * The Best Price Guarantee answer no longer carries `negotiator`. Read `status`, `offer` and `decline`; `offer.reference.verified` still says whether Jinko confirmed the reference. ## 0.64.1 Released 2026-10-15. **Fixed** * The Best Price Guarantee answer's example is one complete `offered` answer. It showed every money field with the same value, beside `decline` and `poll_after_seconds`, which an `offered` answer does not carry. No field or rule changed. ## 0.64.0 Released 2026-10-15. **Added** * `exchange_shop` says why an exchange is not automatic. When `support_level` is not `AUTO`, the answer carries `reason_code` (`NOT_EXCHANGEABLE` with `UNSUPPORTED`, `MANUAL_REQUIRED` with `MANUAL_REQUIRED`) and `reason`, a fixed sentence to show the customer: "This booking cannot be exchanged online. Contact Jinko support." or "This request needs manual handling by Jinko support." An `AUTO` answer carries neither. * `exchange_price` adds `customer_amounts.residual_value`, in the money shape and in the booking's charge currency: the part of the original fare the airline keeps as a credit in the traveller's name after an exchange to a cheaper fare. It is not refunded to the card, is not part of `total_due` or `total_refund`, and is present only when the airline reports one. **Changed** * `exchange_price` `customer_amounts.new_fare` no longer includes the residual value, so the figures add up as `original_fare + total_due - total_refund = new_fare + penalty_amount + residual_value`. Before, an `EVEN` exchange to a cheaper fare showed a new ticket worth exactly the old one. * `refund_check` states a reason on every answer that is not `AUTO`. `manual_reason` is present with `UNSUPPORTED` as well as with `MANUAL_REQUIRED`, and an `UNSUPPORTED` answer always carries a `reason_code`: a refusal that came with no code now carries `NOT_CANCELLABLE`. A refusal's `manual_reason` reads the same sentence as the `flight_refund_preview` 409 `not_cancellable` for that booking, and that 409 carries the same `reason_code`. * `provider.references.cancellation_reference` on the refund and cancellation status answers is documented as the reference the supplier issued for the cancellation or refund itself, for example the ticket number a void settles or the refund id. It is never the supplier's identifier for the booking, and it is absent when the supplier issued none. ## 0.63.0 Released 2026-10-15. **Added** * Best Price Guarantee: `POST /v1/best_price_guarantee` and `GET /v1/best_price_guarantee/{id}`. The submit takes a hotel offer from `hotel_search` and the lower price the traveller found for the same stay on another site. Both routes answer the state of the request: `pending`, `offered` with a new offer to add to a trip, or `declined` with `decline.reason` and, where Jinko compared the reference page, `decline.detail`. They take a `jnk_` API key, as `X-API-Key` or as a Bearer token. Where the feature is not enabled for your key, the answer is 200 with `status: declined` and `decline.reason: feature_disabled`. ## 0.62.0 Released 2026-10-15. **Added** * `hotel_search` `empty_reason` can be `all_dropped_by_rating_filter`: the destination matched properties, but every one fell below the requested `min_rating` or `min_reviews`, or below the default `min_rating` of 7.0 when the request set none. A property whose rating is unknown is removed only by a `min_rating` the request sets, and one whose review count is unknown only by `min_reviews`. **Fixed** * The `min_rating` description states the default of 7.0, and that `0` turns the floor off on destination searches. * The `hotel_name` description says property filters sent with `hotel_name` or `hotel_ids` are rejected. It said they were ignored. ## 0.61.0 Released 2026-10-14. **Added** * Each flight fare carries `refund_policy` (`Free cancellation`, `Refundable`, `Refundable with fee` or `Non-refundable`) and `change_policy` beside `is_refundable` and `is_changeable`, stating the refund and change terms in words. ## 0.60.0 Released 2026-10-14. **Breaking** * Checkout of a trip with a flight requires a contact email. Without one, checkout is refused with 422 `MISSING_CUSTOMER_DETAILS` naming `email`. * In a trip with a hotel, a `child` or `infant` traveller requires a `date_of_birth`. A traveller without one is refused on that field. * `date_of_birth` and `passport_expiry` must be exactly `YYYY-MM-DD`. **Changed** * Travellers are checked against the trip before payment. In a trip with a flight, `upsert_travelers` (once the trip holds the flight) and `checkout` answer 400 `BAD_REQUEST`, with `error.field` naming the traveller, when a `date_of_birth` is in the future, when `traveler_type` does not match the traveller's age on the date the booking counts ages from (the trip's first flight, or for some bookings the return flight of a round trip: `adult` 12 or older, `child` 2 to 11, `infant` under 2 and still under 2 on the last flight), or when `passport_expiry` is before the trip's last flight. Before, such a trip reached a payable checkout or failed at checkout with 502 `UPSTREAM_ERROR`. * Each hotel in a trip is booked for the trip's travellers, or for the room guests that `hotel_room_guests` names on a `room_bundle` hotel. They cannot include more adults or more children than its rooms were priced for, counted by age at check-in, and each child's age at check-in must be one of the priced `children_ages`. Otherwise the answer is 400 `BAD_REQUEST` naming the first traveller over a count or with an age the room was not priced for. * A flight searched for a different party is re-priced at checkout for the trip's travellers, on the same flights and fare family. When that is not possible, or the airline declines to price the fare, checkout answers 409 `OFFER_UNAVAILABLE`. ## 0.59.2 Released 2026-10-14. **Changed** * A card declined on the payment page is reported on the trip. When the issuer declines the card the payer used on the `checkout_url` page, or its authentication fails, `payment_attempt.payment_error.code` is `CARD_DECLINED` or `AUTHENTICATION_FAILED` while `payment_status` stays `pending` and `recovery.action` is `poll`: the payer can use another card on the same page until the quote expires. `payment_error` returns to `null` once a card is authorized. Before, the trip read `pending` with `payment_error: null`. **Fixed** * On a payment attempt, `booking_ref` and the deprecated `fulfillment_cart_id` are absent until the booking and its reference exist, and `retry_after_seconds` is present only while `recovery.action` is `poll`. None of them is ever `null`. Before a booking existed, the first two were sent as `null`, which the published schema does not allow. ## 0.59.1 Released 2026-10-14. **Added** * `get_booking` declares the booked flight itinerary, which it already sent. Flight details carry `legs[]`, each with the origin, the destination, `departure_datetime`, `arrival_datetime`, `stops` and `segments[]`, and the older names `outbound_flight` and `inbound_flight` for `legs[0]` and `legs[1]`. Each segment carries the carriers, `flight_number`, `aircraft`, the airports, and `departure_time` and `arrival_time` (airport local time with its UTC offset) beside `departure_time_local` and `arrival_time_local` (no offset). The itinerary is the one booked and ticketed: it is not refreshed from the airline, and no webhook reports an airline schedule change or cancellation. There is no terminal and no per-segment status. * Booking and item `status` values are documented as an open set: in progress (from `pending` to `confirming`), final (`completed`, `partial` on the booking, `failed`, `cancelled`, `expired_quote`) and needing attention (`exchange_partial_failure`, `needs_review`). They follow Jinko's booking and servicing steps, never an airline change. **Fixed** * The `get_booking` status example reads `completed`, which a ticketed booking returns. It said `confirmed`. ## 0.59.0 Released 2026-10-14. **Breaking** * `slices` → `legs` on `exchange_shop` offers, which no longer carry `metadata`. The new fare on `exchange_price` no longer carries `baggage_source`. The exchange answers, `exchange_commit` included, carry only the fields the contract declares. * `exchange_commit` no longer returns `exchange_reference`. On some exchanges it held the supplier's reference for the booking the change creates, and no route takes it as input: `exchange_status` reads by `booking_ref` and `last_name`. **Added** * `exchange_shop` declares each offer's itinerary and fare: `legs[]` with `stops`, `duration_minutes` and `segments[]`, whose members use the names of a flight search segment (`airline`, `operating_carrier`, `flight_number`, `departure_airport`, `departure_time`, `arrival_airport`, `arrival_time`, `duration_minutes`), the fare per segment (`cabin_name`, `fare_brand_key`, `fare_basis_code`, `rbd`) and the fare per offer (`fare_basis_codes`, `booking_classes`, `cabin`). Exchange times are local wall-clock time with no UTC offset, unlike a flight search segment's. * `exchange_price` declares the new fare's terms and baggage: `new_fare_details` adds `fare_brand_name`, `fare_brand_code`, `fare_basis_codes`, `endorsements`, `is_refundable`, `is_changeable`, `refund_policy`, `change_policy`, `checked_baggage` and `carry_on_baggage`, and the extra bag options declare `is_included`, `segment_id` and `journey_id`. `fare_change_notice` is declared. ## 0.58.0 Released 2026-10-14. **Added** * `GET /v1/hotel_reviews/{hotel_id}`: the guest score and review count, a summary of what guests praise and criticise, a score per category (cleanliness, location, staff and others) and a page of recent reviews, newest first, each with its headline, score, pros and cons, date and language. Page with `limit` (1 to 50, default 10) and `offset`. It takes the same `hotel_id` as `hotel_details`. * `hotel_details` adds `rating`, `review_count`, `child_allowed`, `pets_allowed`, `facility_items`, `rooms[].amenity_items`, `rooms[].max_adults` and `rooms[].max_children`, and `child_allowed` and `pets_allowed` on the policy. `max_adults` and `max_children` are how many adults and children a room accepts; `max_children: 0` means the room does not take children. `facility_items` pairs each facility with its Jinko facility dictionary id, the value `facility_ids` accepts on `hotel_search`; a facility without a dictionary id stays in `facilities` only. `rooms[].amenity_items` carries room amenity ids, a separate list from the facility dictionary. * 422 `MISSING_CUSTOMER_DETAILS` on `checkout` and `book` carries `missing_fields` and `missing_by_domain` when the platform can name what the booking still needs, such as the passport fields an airline requires: the field names as `upsert_travelers` takes them (`passport_number` and others), and the same names grouped by product (`flight`). Both are absent when the refusal names no field. Send the named fields with `upsert_travelers`. ## 0.57.1 Released 2026-10-13. **Changed** * A checkout quote is payable for up to one hour. `expires_at` on the checkout answer is at most one hour after the checkout call (it was about fifteen minutes), and earlier when an offer in the trip has a shorter deadline of its own: some airline fares last twenty minutes from their search. A payment submitted after it is still refused with 410 `QUOTE_EXPIRED`. ## 0.57.0 Released 2026-10-13. This version was first served on 2026-10-13 at 19:34 UTC under the number 1.0.0 and renumbered 0.57.0 at 20:19 UTC; the contract is the same. **Breaking** * Supplier fields are removed from responses: `provider` and `provider_name` on flight offers; `provider_statuses` on `flight_search`, in success and error bodies; `provider` on hotels, on `search_scope` and its `providers[]`, and on `hotel_details`, `hotel_cancel` and `flight_refund_preview`. The raw supplier status word is removed too: `provider_status` on `bookings[]` entries and on refund status, and inside the `provider` object of `hotel_cancel_status` and `flight_refund_status`, which keeps `state`, `references` and `documents`. * `flight_search` no longer answers `result: "provider_error"`. A search that completes without a match answers `result: "no_matches"` as before. A search that could not be completed at all answers an error: `UPSTREAM_REJECTED`, `UPSTREAM_ERROR`, `UPSTREAM_UNAVAILABLE` or `UPSTREAM_TIMEOUT`. Offers that were found are returned even when part of the search failed. * Servicing inputs that named the supplier or its references are removed: `provider` on the flight refund and exchange requests and on `hotel_cancel`, `order_id`, `provider_reference` and `provider_booking_id`. A request carrying one is refused with 422 `BAD_REQUEST` naming the field. Name the booking with `booking_ref`, which is now required, and the item from `get_booking` (`booked_item_id`, named `item_id` until 0.74.0). * The two `enable_*` query parameters on `hotel_search` that turned individual hotel suppliers on or off are removed. A request carrying either is refused with 422 naming the parameter. **Changed** * `payment_types` on a hotel rate is a closed enum: `pay_now`, `pay_at_property`, `deposit`. * `hotel_ref` and an ancillary `offer_id` are opaque. Pass them back exactly as received; their format is not part of the contract. `hotel_details` takes a `hotel_ref` as received, or a plain `hotel_id`. `hotel_ref` was later removed in 0.72.0. * The supplier-facing error codes carry fixed messages. `UPSTREAM_REJECTED`, `UPSTREAM_UNAVAILABLE`, `UPSTREAM_TIMEOUT`, `UPSTREAM_ERROR`, `RATE_LIMITED`, `OFFER_UNAVAILABLE` and `OFFER_EXPIRED` always carry the same message and never upstream text; see [Messages on supplier failures](/concepts/errors#messages-on-supplier-failures). A 429 documents `Retry-After`. * Upstream statuses follow the error categories. A 503 from the platform is answered 503 `UPSTREAM_UNAVAILABLE` with its `Retry-After`, and a 504 is answered 504 `UPSTREAM_TIMEOUT`; both used to be answered 502 `UPSTREAM_ERROR`. A 429 carries the platform's `Retry-After`. A hotel refusal is 502 `UPSTREAM_REJECTED`, as a flight refusal already was. * Refusals that used to quote the supplier carry fixed sentences: 409 `not_cancellable` ("This booking cannot be cancelled online. Contact Jinko support."), 409 `not_exchangeable` ("This booking cannot be exchanged online. Contact Jinko support."), 400 `invalid_exchange_request` and `partial_exchange_unsupported` (uppercase since 0.74.0) from the supplier ("This exchange cannot be processed as requested. Change the selected flights or contact Jinko support."), and `manual_reason` where it would be the supplier's own words ("This request needs manual handling by Jinko support."). * The other supplier refusals carry fixed sentences too: 400 on `flight_search` (search and price check) and on `hotel_search` when a supplier declined the inputs ("The request was declined for these inputs. Check the dates, places and travellers, then retry."), 422 on `car_search` ("The rental request was declined. Try another vehicle, location or time."), and a quote's `failure_message` where it would carry the supplier's words ("The booking could not be completed. Contact Jinko support."). `warnings` on `refund_check` and on the exchange answers leave out notes the supplier sends as free text without a code. * `flight_price_advice` answers a refusal of its inputs as 400 or 422 `BAD_REQUEST` with the platform's sentence. It used to answer 502 `UPSTREAM_REJECTED`. * Descriptions and examples in the contract no longer name a supplier. # jinko agent-pay submit Source: https://docs.gojinko.com/cli/agent-pay/submit Submit a Shared Payment Token to schedule + authorize the booking Present a trip ID and a Shared Payment Token: Jinko schedules the agent fulfillment and redeems the token to authorize the booking server-side, advancing it to fulfillment. If the issuer requires 3-D Secure, the response carries payment_status requires_authentication and an authentication_url (no checkout_url): send the traveller to authentication_url + "#hv=" + the token's next_action.use_stripe_sdk.value, then poll trip-status. Only a declined card returns a checkout_url fallback. ## Usage ```bash theme={null} jinko agent-pay submit [options] ``` ## Options | Flag | Required | Description | Default | | - | - | - | - | | `--trip-id ` | Yes | trip ID (from the trip command) | | | `--token ` | Yes | Shared Payment Token (spt\_...) | | | `--quote-id ` | No | the quote_id checkout returned. With it the payment is bound to that quote: a quote_id that is not one of the trip's quotes is refused and nothing is charged, an expired one is refused with QUOTE_EXPIRED, and the same trip, quote and token again returns the first attempt's outcome instead of charging again. Without it the trip's latest valid quote is charged and the answer names it as quote_id. JSON: quote_id. | | # jinko auth login Source: https://docs.gojinko.com/cli/auth/login Authenticate with a Jinko API key (jnk_...). Get one from dashboard.gojinko.com → Developers → API keys. Authenticate with a Jinko API key (jnk\_...). Get one from dashboard.gojinko.com → Developers → API keys. ## Usage ```bash theme={null} jinko auth login [options] ``` ## Options | Flag | Required | Description | Default | | - | - | - | - | | `--key ` | No | API key (jnk\_...), skip the interactive prompt | | ## Examples ```bash theme={null} # Interactive (prompts for the key) jinko auth login # Non-interactive jinko auth login --key jnk_t_your_key ``` The key lands in `~/.jinko/config.yaml`. The SDK picks it up automatically. # jinko auth logout Source: https://docs.gojinko.com/cli/auth/logout Clear stored credentials. Clear stored credentials. ## Usage ```bash theme={null} jinko auth logout [options] ``` ## Options *No options.* ## Examples ```bash theme={null} jinko auth logout ``` Clears the stored API key from `~/.jinko/config.yaml`. The session file (`~/.jinko/session.yaml`) is untouched, delete it manually if you want a fresh session ID. # jinko auth status Source: https://docs.gojinko.com/cli/auth/status Show current authentication status. Show current authentication status. ## Usage ```bash theme={null} jinko auth status [options] ``` ## Options *No options.* ## Examples ```bash theme={null} jinko auth status # → authenticated: true # environment: prod # method: api_key # token: jnk_t_...ab12 # source: config ``` # jinko best-price-guarantee claim Source: https://docs.gojinko.com/cli/best-price-guarantee/claim Claim a matched price for a hotel offer Submit the hotel offer the traveller compared and the lower price they found for the same hotel, dates, guests, room, meals and cancellation terms on another site. Jinko checks the reference and answers pending, offered (a new offer at the matched price; a trip holding it holds nothing else) or declined (decline.reason, and decline.detail where Jinko compared the page). --wait-seconds makes the call wait up to 20 seconds for the result; the check continues either way. ## Usage ```bash theme={null} jinko best-price-guarantee claim [options] ``` ## Options | Flag | Required | Description | Default | | - | - | - | - | | `--trip-item-token ` | Yes | hotel offer from hotel-search: hotels\[].offers\[].trip_item_token. JSON: trip_item_token. | | | `--reference-url ` | Yes | https link to the page where the traveller saw the lower price. JSON: reference.url. | | | `--screenshot-url ` | No | https address a screenshot of that page can be downloaded from; most accounts require it. JSON: reference.screenshot_url. | | | `--total ` | Yes | total payable at booking on that page, as a plain decimal (e.g. 412.50), without taxes paid at the property. JSON: reference.total. | | | `--currency ` | Yes | ISO 4217 currency of --total; must be the offer's currency. JSON: reference.currency. | | | `--wait-seconds ` | No | seconds to wait for the result, 0-20 (default 0: answer at once). JSON: wait_seconds. | | # jinko best-price-guarantee get Source: https://docs.gojinko.com/cli/best-price-guarantee/get Read a Best Price Guarantee request by id Read the state of a request made with `best-price-guarantee claim`: pending, offered or declined. Read-only. While it is pending, read it again after poll_after_seconds. ## Usage ```bash theme={null} jinko best-price-guarantee get [options] ``` ## Options | Flag | Required | Description | Default | | - | - | - | - | | `--id ` | Yes | the id `best-price-guarantee claim` returned. JSON: id. | | # jinko car-cancel commit Source: https://docs.gojinko.com/cli/car-cancel/commit Cancel a booked car rental Cancel a booked car rental, bound to the fee quoted by a preceding `car-cancel preview`. Pass that preview's `quote_id`. A 409 refuses the commit without cancelling anything: `QUOTE_EXPIRED` (preview again), `QUOTE_DRIFT` (a fresh `retry_quote_id` and the figure now, show it, then commit against it), `ACTIVE_OPERATION_EXISTS` (wait for it; poll `car-cancel status`), `NOT_CANCELLABLE`, `FUNDS_UNAVAILABLE`, or `MANUAL_REQUIRED` (resend with --manual-ok once the customer agrees). ## Usage ```bash theme={null} jinko car-cancel commit [options] ``` ## Options | Flag | Required | Description | Default | | - | - | - | - | | `--booking-ref ` | Yes | Jinko booking reference from get-booking. JSON: `booking_ref`. | | | `--last-name ` | No | Driver surname, required for guest lookup; owning credentials may omit it. JSON: `last_name`. | | | `--booked-item-id ` | No | The booked item to service: booked_item_id from get-booking items\[] (an "itm\_..." string); required when several items of this domain exist. JSON: booked_item_id. | | | `--quote-id ` | Yes | the "ccl\_..." quote_id from `car-cancel preview`, binds this commit to the fee the customer saw. JSON: `quote_id`. | | | `--reason ` | No | free-text cancellation reason. JSON: `reason`. | | | `--manual-ok` | No | commit a preview that answered `manual_required: true`: the cancellation is recorded for a Jinko agent, nothing is sent to the rental company by this call, and the answer is `state: pending` with `refund_pending_review: true`. Without it such a commit is refused 409 `MANUAL_REQUIRED`. Send it only once the customer has agreed; on a preview that can be committed online it changes nothing. JSON: `manual_ok`. | | | `--user-intent ` | No | the end user's request in their own words, forwarded to Jinko for observability and relevance (avoid PII). Env fallback: JINKO_USER_INTENT. JSON: `intent.user_intent`. | | # jinko car-cancel preview Source: https://docs.gojinko.com/cli/car-cancel/preview Quote the cancellation fee for a car rental Quote the cancellation fee for a booked car rental and mint the `quote_id` that binds a later commit to this quote. `fee_known: false` means the fee could NOT be established, unknown, not free. `manual_required: true` means it cannot be completed online; commit with --manual-ok, once the customer agrees, to hand it to a Jinko agent. ## Usage ```bash theme={null} jinko car-cancel preview [options] ``` ## Options | Flag | Required | Description | Default | | - | - | - | - | | `--booking-ref ` | Yes | Jinko booking reference from get-booking. JSON: `booking_ref`. | | | `--last-name ` | No | Driver surname, required for guest lookup; owning credentials may omit it. JSON: `last_name`. | | | `--booked-item-id ` | No | The booked item to service: booked_item_id from get-booking items\[] (an "itm\_..." string); required when several items of this domain exist. JSON: booked_item_id. | | | `--user-intent ` | No | the end user's request in their own words, forwarded to Jinko for observability and relevance (avoid PII). Env fallback: JINKO_USER_INTENT. JSON: `intent.user_intent`. | | # jinko car-cancel status Source: https://docs.gojinko.com/cli/car-cancel/status Check the status of a car-rental cancellation Poll the current status of a previously committed car-rental cancellation. Read-only. `pending` with `refund_pending_review: true` means a Jinko agent has it, do not commit again. ## Usage ```bash theme={null} jinko car-cancel status [options] ``` ## Options | Flag | Required | Description | Default | | - | - | - | - | | `--booking-ref ` | Yes | Jinko booking reference from get-booking. JSON: `booking_ref`. | | | `--last-name ` | No | Driver surname, required for guest lookup; owning credentials may omit it. JSON: `last_name`. | | | `--booked-item-id ` | No | The booked item to service: booked_item_id from get-booking items\[] (an "itm\_..." string); required when several items of this domain exist. JSON: booked_item_id. | | | `--user-intent ` | No | the end user's request in their own words, forwarded to Jinko for observability and relevance (avoid PII). Env fallback: JINKO_USER_INTENT. JSON: `intent.user_intent`. | | # jinko car-search Source: https://docs.gojinko.com/cli/car-search Search live car-rental offers Search live car-rental inventory for a pick-up location, date-time window and driver age. Pick-up and drop-off times are BRANCH-LOCAL with no timezone (2027-09-12T10:00:00), the rental desk's own wall clock. Give exactly one of --pick-up-airport, --pick-up-place or --pick-up-geo; a free-text --pick-up-place that resolves ambiguously comes back as a candidate list instead of offers, which is a retry signal, not an error. Each offer's `offer_id` is a trip item token you can hand straight to the trip command to start a booking. ## Usage ```bash theme={null} jinko car-search [options] ``` ## Options | Flag | Required | Description | Default | | - | - | - | - | | `--pick-up-date-time ` | Yes | pick-up date-time, branch-local, no timezone: 2027-09-12T10:00:00. JSON: `pick_up.date_time`. | | | `--pick-up-airport ` | No | pick-up IATA airport code, e.g. LYS. JSON: `pick_up.airport_code`. | | | `--pick-up-place ` | No | free-text pick-up location, a city, district or landmark, e.g. "Lyon city centre". Resolved server-side. JSON: `pick_up.place`. | | | `--pick-up-geo ` | No | pick-up coordinates and search radius in metres (min 50), e.g. 45.72,4.94,5000. JSON: `pick_up.geo`. | | | `--drop-off-date-time ` | No | drop-off date-time, branch-local, no timezone. JSON: `drop_off_date_time`. \[required unless a --drop-off-\* location carries its own time] | | | `--drop-off-airport ` | No | drop-off IATA airport code, for a one-way rental. JSON: `drop_off.airport_code`. | | | `--drop-off-place ` | No | free-text drop-off location, for a one-way rental. JSON: `drop_off.place`. | | | `--drop-off-geo ` | No | drop-off coordinates and radius. Geo search is round-trip only: omit drop-off or use the same place as pick-up. JSON: `drop_off.geo`. | | | `--driver-age ` | Yes | driver's age at pick-up, 18-99. Pricing and availability are age-dependent. JSON: `driver_age`. | | | `--residence-country ` | Yes | driver's country of residence, ISO 3166-1 alpha-2, e.g. FR. Rates and inclusions vary by residence. JSON: `residence_country`. | | | `--currency ` | No | ISO 4217 display currency, e.g. EUR. Defaults to USD. JSON: `currency`. | | | `--lang ` | No | BCP-47 language tag for vehicle and branch text, e.g. en-gb. JSON: `lang`. | | | `--user-intent ` | No | the end user's request in their own words, forwarded to Jinko for observability and relevance (avoid PII). Env fallback: JINKO_USER_INTENT. JSON: `intent.user_intent`. | | # jinko checkout Source: https://docs.gojinko.com/cli/checkout Checkout a trip, returns a checkout URL the user opens to pay, plus agent payment params > [!NOTE] > > **Read amounts from the `*_money` fields** in this command's output, such as > `total_amount_money`, `items[].price_money` and > `agent_spt_params.max_amount_money`. Each carries `value` in minor units with > its `decimal_places`: divide `value` by `10 ** decimal_places`, or show > `display`. To mint a Shared Payment Token, pass > `agent_spt_params.max_amount_money.value` unchanged. The older `total_amount` > and `items[].price` are deprecated and hold major units; the deprecated > `agent_spt_params.max_amount` holds minor units. See [Money & prices](/concepts/money). Finalize a trip for payment. Use it once the trip is set and traveler details are filled in, for example after the user picks a Paris to Tokyo round trip and adds a hotel for the stay. The response carries two payment paths: `checkout_url` is what a human opens in a browser to pay, and `agent_spt_params` (max amount, currency, profile) is what an agent uses to mint a Shared Payment Token and pay programmatically via `agent-pay submit`. ## Usage ```bash theme={null} jinko checkout [options] ``` ## Options | Flag | Required | Description | Default | | - | - | - | - | | `--trip-id ` | Yes | trip ID (from trip command) | | | `--user-intent ` | No | the end user's request in their own words, forwarded to Jinko for observability and relevance (avoid PII). Env fallback: JINKO_USER_INTENT. JSON: `intent.user_intent`. | | # jinko config set Source: https://docs.gojinko.com/cli/config/set Set a config value. Keys: api_key, environment Set a config value. Keys: api_key, environment ## Usage ```bash theme={null} jinko config set [options] ``` ### Arguments | Argument | Required | Description | | - | - | - | | `key` | Yes | | | `value` | Yes | | ## Options *No options.* ## Examples ```bash theme={null} # Switch the active environment (prod | sandbox) jinko config set environment sandbox # Store an API key under the active environment jinko config set api_key jnk_sandbox_t_your_key ``` # jinko config show Source: https://docs.gojinko.com/cli/config/show Show current configuration. Show current configuration. ## Usage ```bash theme={null} jinko config show [options] ``` ## Options *No options.* ## Examples ```bash theme={null} jinko config show # Dumps the current ~/.jinko/config.yaml (secrets masked) ``` # jinko exchange commit Source: https://docs.gojinko.com/cli/exchange/commit Commit a flight exchange > [!NOTE] > > **Prices in this command's output are integers in minor units.** Money objects > carry `decimal_places` — divide by `10 ** decimal_places` to display > (`{ "value": 15977, "decimal_places": 2 }` is **159.77**, not 15,977). See > [Money & prices](/concepts/money). Execute a flight exchange. ## Usage ```bash theme={null} jinko exchange commit [options] ``` ## Options | Flag | Required | Description | Default | | - | - | - | - | | `--offer-id ` | Yes | exchange offer ID | | | `--quote-id ` | No | quote_id from the price response. Not needed after a refused price, when committing the same offer to send it to Jinko support. JSON: quote_id. | | | `--booking-ref ` | Yes | Jinko booking reference | | | `--last-name ` | No | Traveler surname, required for guest lookup; owning credentials may omit it. | | | `--booked-item-id ` | No | The booked item to service: booked_item_id from get-booking items\[] (an "itm\_..." string); required when several items of this domain exist. JSON: booked_item_id. | | | `--user-intent ` | No | the end user's request in their own words, forwarded to Jinko for observability and relevance (avoid PII). Env fallback: JINKO_USER_INTENT. JSON: `intent.user_intent`. | | ## Examples ```bash theme={null} jinko exchange commit \ --booking-ref JNK-ABC123 \ --last-name Doe \ --offer-id exch_offer_abc \ --quote-id sess_xyz789 ``` Returns `status: "pending"` and the `payment_outcome`. With `ADD_COLLECT` it also returns `checkout_url`: send the customer there to pay the difference, as nothing is exchanged until that payment authorizes. Poll `jinko exchange status` with the same `booking_ref` and selected `booked_item_id` from `get-booking`. # jinko exchange price Source: https://docs.gojinko.com/cli/exchange/price Price a specific exchange offer > [!NOTE] > > **Prices in this command's output are integers in minor units.** Money objects > carry `decimal_places` — divide by `10 ** decimal_places` to display > (`{ "value": 15977, "decimal_places": 2 }` is **159.77**, not 15,977). See > [Money & prices](/concepts/money). Price a specific exchange offer. ## Usage ```bash theme={null} jinko exchange price [options] ``` ## Options | Flag | Required | Description | Default | | - | - | - | - | | `--offer-id ` | Yes | exchange offer ID from shop response | | | `--booking-ref ` | Yes | Jinko booking reference | | | `--last-name ` | No | Traveler surname, required for guest lookup; owning credentials may omit it. | | | `--booked-item-id ` | No | The booked item to service: booked_item_id from get-booking items\[] (an "itm\_..." string); required when several items of this domain exist. JSON: booked_item_id. | | | `--user-intent ` | No | the end user's request in their own words, forwarded to Jinko for observability and relevance (avoid PII). Env fallback: JINKO_USER_INTENT. JSON: `intent.user_intent`. | | ## Examples ```bash theme={null} jinko exchange price \ --booking-ref JNK-ABC123 \ --last-name Doe \ --offer-id exch_offer_abc ``` Prints the `POST /v1/exchange_price` answer: `payment_outcome`, `total_due` or `total_refund`, the traveler's figures in `customer_amounts`, and a `quote_id` to commit against. In `customer_amounts`, `original_fare` is what the traveler paid for the ticket, `new_fare` the new ticket's value, `penalty_amount` the airline's change fee (absent when there is none), `total_due` or `total_refund` exactly what is charged or refunded, and `residual_value` the part of the original fare the airline keeps as a credit (EMD) in the traveler's name after an exchange to a cheaper fare (present only when the airline reports one; it is not refunded to the card and not part of `total_due` or `total_refund`). They add up: `original_fare + total_due − total_refund = new_fare + penalty_amount + residual_value`, with `residual_value` counted as 0 when absent. The top-level `fare_difference`, `original_fare`, `new_fare` and `penalty_amount` are the supplier's figures and are deprecated. Moving a ZZ Standard ticket to ZZ Flex on the [sandbox test airline](/guides/testing-in-sandbox#exchange) prints, among the other fields: ```json theme={null} { "payment_outcome": "ADD_COLLECT", "customer_amounts": { "original_fare": { "value": 78900, "currency": "USD", "decimal_places": 2, "display": "USD 789.00" }, "new_fare": { "value": 106200, "currency": "USD", "decimal_places": 2, "display": "USD 1062.00" }, "penalty_amount": { "value": 2500, "currency": "USD", "decimal_places": 2, "display": "USD 25.00" }, "total_due": { "value": 29800, "currency": "USD", "decimal_places": 2, "display": "USD 298.00" } } } ``` 78900 + 29800 = 106200 + 2500. # jinko exchange shop Source: https://docs.gojinko.com/cli/exchange/shop Shop for flight exchange alternatives > [!NOTE] > > **Prices in this command's output are integers in minor units.** Money objects > carry `decimal_places` — divide by `10 ** decimal_places` to display > (`{ "value": 15977, "decimal_places": 2 }` is **159.77**, not 15,977). See > [Money & prices](/concepts/money). Shop for flight exchange alternatives. ## Usage ```bash theme={null} jinko exchange shop [options] ``` ## Options | Flag | Required | Description | Default | | - | - | - | - | | `--booking-ref ` | Yes | Jinko booking reference | | | `--last-name ` | No | Traveler surname, required for guest lookup; owning credentials may omit it. | | | `--booked-item-id ` | No | The booked item to service: booked_item_id from get-booking items\[] (an "itm\_..." string); required when several items of this domain exist. JSON: booked_item_id. | | | `--segment ` | No | a leg to change: its first departure and final arrival airport as get-booking lists them, and the new date. Repeat it for each leg to change; legs not named stay as booked. | | | `--preferred-departure-date ` | No | new date (YYYY-MM-DD) for the first leg; every leg is reshopped. For a booking with a single leg; to change one leg of several, use --segment. | | | `--user-intent ` | No | the end user's request in their own words, forwarded to Jinko for observability and relevance (avoid PII). Env fallback: JINKO_USER_INTENT. JSON: `intent.user_intent`. | | ## Examples ```bash theme={null} jinko exchange shop \ --booking-ref JNK-ABC123 \ --last-name Doe \ --segment LHR:JFK:2027-07-15 ``` `--segment ORIGIN:DESTINATION:YYYY-MM-DD` names one leg to change, by the first departure and final arrival airport `jinko get-booking` lists for it; repeat it to change several legs. Legs you do not name stay as booked. `--preferred-departure-date` moves the first leg and reshops every leg, so use it only for a booking with a single leg. Returns alternative itineraries with `offer_id` values, pick one and pass to `jinko exchange price`. # jinko exchange status Source: https://docs.gojinko.com/cli/exchange/status Check the status of an exchange > [!NOTE] > > **Prices in this command's output are integers in minor units.** Money objects > carry `decimal_places` — divide by `10 ** decimal_places` to display > (`{ "value": 15977, "decimal_places": 2 }` is **159.77**, not 15,977). See > [Money & prices](/concepts/money). Poll the status of an in-flight exchange. ## Usage ```bash theme={null} jinko exchange status [options] ``` ## Options | Flag | Required | Description | Default | | - | - | - | - | | `--booking-ref ` | Yes | Jinko booking reference | | | `--last-name ` | No | Traveler surname, required for guest lookup; owning credentials may omit it. | | | `--booked-item-id ` | No | The booked item to service: booked_item_id from get-booking items\[] (an "itm\_..." string); required when several items of this domain exist. JSON: booked_item_id. | | | `--user-intent ` | No | the end user's request in their own words, forwarded to Jinko for observability and relevance (avoid PII). Env fallback: JINKO_USER_INTENT. JSON: `intent.user_intent`. | | ## Examples ```bash theme={null} jinko exchange status \ --booking-ref JNK-ABC123 \ --last-name Doe \ --booked-item-id itm_aaaaaaaaaaaaafhuxsdxpbzrbfz5hm3a ``` Use the selected `booked_item_id` from `get-booking`. `status` reads `pending` until the exchange ends `confirmed`, `partial_failure` or `failed`; read `warnings` beside it. While an `ADD_COLLECT` exchange waits for the customer's payment, the response carries `checkout_url`, the page to send them to. # jinko find-dates Source: https://docs.gojinko.com/cli/find-dates Best date options for a route, up to ten cheapest itineraries, one per date-pair, spread across the month > [!NOTE] > > **Prices in this command's output are integers in minor units.** Money objects > carry `decimal_places` — divide by `10 ** decimal_places` to display > (`{ "value": 15977, "decimal_places": 2 }` is **159.77**, not 15,977). See > [Money & prices](/concepts/money). Answers "when should I fly?" for a known route. Takes the same inputs as Flight Calendar but returns up to ten cheapest itineraries, one per (departure, return) date-pair, spread across the requested departure window, so the user gets a diverse shortlist rather than ten near-adjacent cheapest days. Cache-backed; no live pricing. Each result includes an `offer_token`: pass it to flight-search --offer-token for a live price, which returns the `trip_item_token` you add to a trip. ## Usage ```bash theme={null} jinko find-dates [options] ``` ## Options | Flag | Required | Description | Default | | - | - | - | - | | `--origins ` | Yes | origin IATA airport/city codes. JSON: `origins[]`. | | | `--destinations ` | No | destination IATA airport/city codes. Omit to scan all destinations. JSON: `destinations[]`. | | | `--month ` | No | departure month to scan (YYYY-MM), defaults to current month | | | `--trip-type ` | No | oneway or roundtrip (default: roundtrip). JSON: `trip_type`. | | | `--stay-days ` | No | nights away for a roundtrip (default: 7). JSON: `stay_days`. | | | `--cabin-class ` | No | cabin class: economy, premium_economy, business, first (default: economy). JSON: `cabin_class`. | | | `--direct-only` | No | only direct flights. JSON: `direct_only`. | | | `--limit ` | No | max date-pairs to return (1-100, default 20). JSON: `limit`. | | | `--user-intent ` | No | the end user's request in their own words, forwarded to Jinko for observability and relevance (avoid PII). Env fallback: JINKO_USER_INTENT. JSON: `intent.user_intent`. | | # jinko find-destination Source: https://docs.gojinko.com/cli/find-destination Discover travel destinations using cached flight fares for one adult > [!NOTE] > > **Prices in this command's output are integers in minor units.** Money objects > carry `decimal_places` — divide by `10 ** decimal_places` to display > (`{ "value": 15977, "decimal_places": 2 }` is **159.77**, not 15,977). See > [Money & prices](/concepts/money). Discover destinations from your departure airports using cached fares for one adult, even when passenger counts are supplied. Use the results to choose a route, then run flight-search with the full passenger counts to confirm live prices and availability before quoting or booking. ## Usage ```bash theme={null} jinko find-destination [options] ``` ## Options | Flag | Required | Description | Default | | - | - | - | - | | `--origins ` | Yes | IATA airport or city codes (e.g. JFK LGA). JSON: `origins[]`. | | | `--destinations ` | No | IATA airport or city codes to filter to. Omit for global discovery. JSON: `destinations[]`. | | | `--origin-type ` | No | How to interpret --origins: `city` or `airport`. Omitted: a code that names a multi-airport city is searched as the city, every other code as the airport, NYC, LON, PAR are cities; JFK, LHR, CDG are airports; LAX, MIA, LAS (a city sharing its code with its main airport) are the CITY. Send airport when the user named the airport. JSON: `origin_type`. | | | `--destination-type ` | No | How to interpret --destinations: `city` or `airport`. Omitted: a code that names a multi-airport city is searched as the city, every other code as the airport, NYC, LON, PAR are cities; JFK, LHR, CDG are airports; LAX, MIA, LAS (a city sharing its code with its main airport) are the CITY. Send airport when the user named the airport. JSON: `destination_type`. | | | `--departure-dates ` | No | Exact departure dates (YYYY-MM-DD), OR logic. JSON: `departure_dates[]`. | | | `--departure-date-ranges ` | No | Flexible departure ranges, repeatable. Format: `YYYY-MM-DD:YYYY-MM-DD`. JSON: `departure_date_ranges[]`. | | | `--return-dates ` | No | Exact return dates (YYYY-MM-DD), roundtrip only. JSON: `return_dates[]`. | | | `--return-date-ranges ` | No | Flexible return ranges, roundtrip only. Format: `YYYY-MM-DD:YYYY-MM-DD`. JSON: `return_date_ranges[]`. | | | `--stay-days ` | No | Exact stay length in days, roundtrip only. Add --trip-type roundtrip when no return dates or ranges are supplied. JSON: `stay_days`. | | | `--stay-days-range ` | No | Flexible stay range, e.g. `5:10`, roundtrip only. Add --trip-type roundtrip when no return dates or ranges are supplied. JSON: `stay_days_range`. | | | `--trip-type ` | No | `oneway` or `roundtrip`. Defaults to roundtrip with --return-dates or --return-date-ranges, otherwise oneway; stay-length flags alone do not change it. JSON: `trip_type`. | | | `--cabin-class ` | No | `economy`, `premium_economy`, `business`, or `first` (default: `economy`). JSON: `cabin_class`. | `"economy"` | | `--direct-only` | No | Only return nonstop flights. JSON: `direct_only`. | | | `--adults ` | No | Requested adult count (default: 1); cached fares remain for one adult. JSON: `adults`. | | | `--children ` | No | Child passengers. JSON: `children`. | | | `--infants-in-lap ` | No | Infants on lap (no seat). JSON: `infants_in_lap`. | | | `--infants-in-seat ` | No | Infants in own seat. JSON: `infants_in_seat`. | | | `--youth ` | No | Youth fare. JSON: `youth`. | | | `--student ` | No | Student fare. JSON: `student`. | | | `--ages ` | No | Explicit ages array (alternative to counts). JSON: `ages[]`. | | | `--residency-country ` | No | Residency country, ISO 3166-1 alpha-2. JSON: `residency_country`. | | | `--max-total ` | No | Upper bound on the cached fare's total in --currency; cached fares are priced for one adult. JSON: `max_total`. | | | `--currency ` | No | ISO 4217 currency code (default: USD). JSON: `currency`. | | | `--locale ` | No | BCP 47 locale, e.g. `en-US`, `fr-FR` (default: `en-US`). JSON: `locale`. | | | `--limit ` | No | Maximum destinations (1-100, default 20). JSON: `limit`. | `"20"` | | `--offset ` | No | Pagination offset (default 0). JSON: `offset`. | | | `--flights-per-destination ` | No | Itineraries per destination (1-10, default 1). JSON: `flights_per_destination`. | | | `--sort-by ` | No | `lowest` or `recommendation` (default: `lowest`). JSON: `sort_by`. | `"lowest"` | | `--user-intent ` | No | the end user's request in their own words, forwarded to Jinko for observability and relevance (avoid PII). Env fallback: JINKO_USER_INTENT. JSON: `intent.user_intent`. | | ## Examples Discover destinations reachable from your origins within a budget and date window: ```bash theme={null} jinko find-destination \ --origins JFK LGA EWR \ --departure-date-ranges 2027-06-01:2027-06-30 \ --stay-days-range 5:10 \ --trip-type roundtrip \ --adults 2 \ --max-total 500 \ --currency USD ``` The equivalent REST and SDK calls live in the [API reference](/api/find-destination). # jinko flight-calendar Source: https://docs.gojinko.com/cli/flight-calendar Search flights between a known origin and destination for flexible dates > [!NOTE] > > **Prices in this command's output are integers in minor units.** Money objects > carry `decimal_places` — divide by `10 ** decimal_places` to display > (`{ "value": 15977, "decimal_places": 2 }` is **159.77**, not 15,977). See > [Money & prices](/concepts/money). Find priced itineraries between a known origin and destination using cached results, ideal when the user is flexible on dates. It answers questions like "cheapest week to fly Paris to Barcelona in June" or "best Friday to Sunday options from JFK to LAX next month". Each result includes an `offer_token`: pass it to flight-search --offer-token for a live price, which returns the `trip_item_token` you add to a trip. ## Usage ```bash theme={null} jinko flight-calendar [options] ``` ## Options | Flag | Required | Description | Default | | - | - | - | - | | `--origins ` | Yes | origin IATA airport/city codes. JSON: `origins[]`. | | | `--destinations ` | No | destination IATA airport/city codes. Omit to scan all destinations. JSON: `destinations[]`. | | | `--month ` | No | month to display (YYYY-MM), defaults to current month | | | `--trip-type ` | No | oneway or roundtrip (default: roundtrip). JSON: `trip_type`. | | | `--stay-days ` | No | nights away for a roundtrip (default: 7). JSON: `stay_days`. | | | `--cabin-class ` | No | cabin class: economy, premium_economy, business, first (default: economy). JSON: `cabin_class`. | | | `--adults ` | No | number of adult passengers (default: 1). JSON: `adults`. | | | `--direct-only` | No | only direct flights. JSON: `direct_only`. | | | `--limit ` | No | max results to return per page (1-100, default 20). JSON: `limit`. | | | `--offset ` | No | number of results to skip, for pagination (default 0). JSON: `offset`. | | | `--user-intent ` | No | the end user's request in their own words, forwarded to Jinko for observability and relevance (avoid PII). Env fallback: JINKO_USER_INTENT. JSON: `intent.user_intent`. | | ## Examples ```bash theme={null} # Cheapest days JFK → CDG in June jinko flight-calendar --origins JFK --destinations CDG --month 2027-06 ``` # jinko flight-price-advice Source: https://docs.gojinko.com/cli/flight-price-advice Accept a flight with its current price for price advice This command is in preview. Contact support to request access. It accepts a flight with its current price and returns price advice for one adult's total fare including tax, excluding optional paid extras. It compares the fare with typical fares for comparable flights and provides fixed 1-day and 3-day price forecasts, each with a forecasted price and estimated probabilities of an increase, decrease, or no change. Initial numeric coverage is one-way, nonstop, USD; other structurally valid currencies, trip types, and stop counts return a reasoned unavailable result. stops is the actual number of connections and may be omitted when unknown. The summary is deterministic and can be displayed without an LLM. Supply city IATA codes only; airport codes are not mapped to cities. ## Usage ```bash theme={null} jinko flight-price-advice [options] ``` ## Options | Flag | Required | Description | Default | | - | - | - | - | | `--origin ` | Yes | uppercase three-letter city IATA code. JSON: `origin`. | | | `--destination ` | Yes | uppercase three-letter city IATA code, different from origin. JSON: `destination`. | | | `--departure-date ` | Yes | real YYYY-MM-DD date strictly after the current UTC date. JSON: `departure_date`. | | | `--trip-type ` | Yes | trip type: oneway or roundtrip. JSON: `trip_type`. | | | `--stops ` | No | actual flight connections: 0 for nonstop, 1, or 2; omit when unknown. JSON: `stops`. | | | `--cabin-class ` | Yes | cabin class: economy, premium_economy, business, or first. JSON: `cabin_class`. | | | `--current-price ` | Yes | one adult total fare including tax as a positive integer in minor units, e.g. 32000 with USD/2 is \$320.00. JSON: `current_price.value`. | | | `--currency ` | Yes | supported uppercase ISO 4217 currency code. JSON: `current_price.currency`. | | | `--decimal-places ` | Yes | currency minor-unit precision, e.g. 2 for USD or 0 for JPY. JSON: `current_price.decimal_places`. | | # jinko flight-search Source: https://docs.gojinko.com/cli/flight-search Get live flight pricing, search by route, or re-price a known offer ## Cabin class in live search Omit `--cabin-class` when the user has not requested a cabin. Providers search economy by default, and other recognized cabins can still be returned. Explicit `--cabin-class economy`, `premium_economy`, `business`, or `first` strictly filters fares by the cabin on the longest segment; shorter connections may use another cabin. A live search with no matching offers exits successfully with code **0**, reports `no_matches`, and includes an instruction: it asks the user which filter to relax when the search sent a narrowing filter, and otherwise whether to try other dates or airports. Keep their current filters until they agree to a change. This holds even when one airline source could not be searched, as long as another answered. JSON output carries the response body; table output prints the instruction. A search where every provider failed remains an error; retry later with the same filters when instructed. This behavior applies to route search, with reprice mode (`--offer-token`) retaining its existing behavior. > [!NOTE] > > **Prices in this command's output are integers in minor units.** Money objects > carry `decimal_places` — divide by `10 ** decimal_places` to display > (`{ "value": 15977, "decimal_places": 2 }` is **159.77**, not 15,977). See > [Money & prices](/concepts/money). Fetch live, bookable pricing for a specific route and date pair. Use it once the user has settled on exact travel dates, for example "Paris to New York departing June 1 returning June 8 in economy". It also reprices an offer surfaced earlier by the calendar or destination tools so you can confirm availability before adding it to a trip. Every filter that narrows the results is applied exactly as sent: no returned offer violates one, and the search never widens. Empty offers come with an instruction to relay: it asks which filter to relax when a narrowing filter was sent, and otherwise whether to try other dates or airports. ## Usage ```bash theme={null} jinko flight-search [options] ``` ## Options | Flag | Required | Description | Default | | - | - | - | - | | `--origin ` | Yes, search mode | origin IATA code (e.g. PAR for city, JFK for airport). See --origin-type for how an untyped code is read. JSON: `origin`. | | | `--destination ` | Yes, search mode | destination IATA code (e.g. NYC for city, CDG for airport; LAX alone is the Los Angeles CITY). See --destination-type. JSON: `destination`. | | | `--origin-type ` | No | how to read --origin: city (every airport of the city) or airport. Omitted: a code that names a multi-airport city is searched as the city, every other code as the airport, NYC, LON, PAR are cities; JFK, LHR, CDG are airports; LAX, MIA, LAS (a city sharing its code with its main airport) are the CITY. Send airport when the user named the airport. JSON: `origin_type`. | | | `--destination-type ` | No | how to read --destination: city (every airport of the city) or airport. Omitted: a code that names a multi-airport city is searched as the city, every other code as the airport, NYC, LON, PAR are cities; JFK, LHR, CDG are airports; LAX, MIA, LAS (a city sharing its code with its main airport) are the CITY. Send airport when the user named the airport. On a live search the provider decides what a city holds: untyped LAX returns Ontario (ONT) fares too. JSON: `destination_type`. | | | `--departure-date ` | Yes, search mode | departure date (YYYY-MM-DD). JSON: `departure_date`. | | | `--return-date ` | No | return date for round-trip (YYYY-MM-DD). JSON: `return_date`. | | | `--trip-type ` | No | oneway or roundtrip (default: roundtrip when --return-date is set, else oneway). JSON: `trip_type`. | | | `--adults ` | No | number of adult passengers (default: 1). JSON: `adults`. | | | `--children ` | No | number of child passengers. JSON: `children`. | | | `--infants ` | No | number of infant passengers. JSON: `infants`. | | | `--cabin-class ` | No | exact representative cabin: economy, premium_economy, business, first. Omit to let providers default to economy without cabin filtering. The representative cabin is the longest segment; shorter connections may use another cabin. JSON: `cabin_class`. | | | `--direct-only` | No | only show direct flights. DEPRECATED in the contract, prefer --max-stops 0, which the platform treats the same. JSON: `direct_only`. | | | `--max-stops ` | No | maximum stops per leg: 0 non-stop, 1 one connection, 2 two. JSON: `max_stops`. | | | `--multi-fare` | No | return the branded fare ladder, several fares per itinerary (the platform default). JSON: `multi_fare`. | | | `--no-multi-fare` | No | return a single fare per itinerary and a smaller response. JSON: `multi_fare`. | | | `--max-total ` | No | drop fares whose total price for all travelers exceeds this cap, in --currency, major units. JSON: `max_total`. | | | `--include-carriers ` | No | keep only itineraries marketed by these IATA 2-letter carrier codes (e.g. AF KL); never widened to other carriers. JSON: `include_carriers`. | | | `--exclude-carriers ` | No | exclude these IATA 2-letter carrier codes (e.g. FR U2). JSON: `exclude_carriers`. | | | `--departure-time-range ` | No | filter the OUTBOUND leg by local departure time-of-day, HH:MM-HH:MM (either bound may be omitted, e.g. 08:00- or -12:00). JSON: `departure_time_range`. | | | `--arrival-time-range ` | No | filter the OUTBOUND leg by local arrival time-of-day, HH:MM-HH:MM. JSON: `arrival_time_range`. | | | `--return-departure-time-range ` | No | filter the RETURN leg by local departure time-of-day, HH:MM-HH:MM (round-trip only). JSON: `return_departure_time_range`. | | | `--return-arrival-time-range ` | No | filter the RETURN leg by local arrival time-of-day, HH:MM-HH:MM (round-trip only). JSON: `return_arrival_time_range`. | | | `--connection-time-min-minutes ` | No | shortest acceptable layover, in minutes, on every connection. JSON: `connection_time_min_minutes`. | | | `--connection-time-max-minutes ` | No | longest acceptable layover, in minutes, on every connection. JSON: `connection_time_max_minutes`. | | | `--max-total-duration-minutes ` | No | cap each leg's door-to-door elapsed travel time, in minutes. JSON: `max_total_duration_minutes`. | | | `--single-carrier-only` | No | only itineraries marketed end-to-end by one carrier. JSON: `single_carrier_only`. | | | `--via-airports ` | No | restrict connections to these airports, an itinerary qualifies when at least one connection is one of them; non-stops are kept. JSON: `via_airports`. | | | `--exclude-via-airports ` | No | ban connections at these airports. Must not overlap --via-airports. JSON: `exclude_via_airports`. | | | `--aircraft-types ` | No | only itineraries whose every segment flies one of these IATA equipment codes (e.g. 320 77W). JSON: `aircraft_types`. | | | `--same-connection-airport-only` | No | only itineraries whose connections leave from the airport they arrived at (no cross-town transfer). JSON: `same_connection_airport_only`. | | | `--same-origin-airport-only` | No | only round trips that return to the airport the trip departed from. JSON: `same_origin_airport_only`. | | | `--same-turnaround-airport-only` | No | only round trips whose return departs from the airport the outbound arrived at. JSON: `same_turnaround_airport_only`. | | | `--origin-alternate-airports ` | No | ADDITIONAL departure airports searched alongside --origin (widening only). Works with an airport or a city anchor (--origin NYC --origin-alternate-airports BOS covers New York and Boston). The anchor decides ranking, so put the airport that matters most in --origin. JSON: `origin_alternate_airports`. | | | `--destination-alternate-airports ` | No | ADDITIONAL arrival airports searched alongside --destination (widening only). Same anchor rules as --origin-alternate-airports. JSON: `destination_alternate_airports`. | | | `--nearby-airports` | No | also search the alternate airports around each leg's origin and destination (widening). JSON: `nearby_airports`. | | | `--refundable-only` | No | only fares that can be cancelled before departure. Conservative, fares whose rules cannot be verified are dropped. JSON: `refundable_only`. | | | `--changeable-only` | No | only fares that allow a voluntary change. Conservative in the same way as --refundable-only. JSON: `changeable_only`. | | | `--checked-bag-included` | No | only fares whose price already includes a checked bag. JSON: `checked_bag_included`. | | | `--limit ` | No | TOTAL flights to return (1-300), not a page size. Search mode only; omit to let the platform choose. JSON: `limit`. | | | `--currency ` | No | ISO 4217 currency for the returned prices and --max-total. JSON: `currency`. | | | `--locale ` | No | locale for provider-supplied text (e.g. fr-FR). JSON: `locale`. | | | `--offer-token ` | Yes, price-check mode | price-check a cached offer (live pricing): the `offer_token` from flight-calendar, find-dates, lowest-fare or find-destination. JSON: `offer_token`. | | | `--user-intent ` | No | the end user's request in their own words, forwarded to Jinko for observability and relevance (avoid PII). Env fallback: JINKO_USER_INTENT. JSON: `intent.user_intent`. | | ## Examples ```bash theme={null} # Price-check a discovery offer jinko flight-search --offer-token "$OFFER_TOKEN" --format json | jq '.offers[0].fares[0]' # Live search by route jinko flight-search --origin CDG --destination JFK --departure-date 2027-06-15 --return-date 2027-06-22 \ --adults 2 --cabin-class economy --format json ``` # jinko get-ancillaries Source: https://docs.gojinko.com/cli/get-ancillaries List purchasable ancillaries for a trip (bags, seats, meals), no checkout URL Lists the available ancillaries for a trip WITHOUT generating a checkout URL. A price quote runs transparently behind the API and is reused while valid, so repeat calls are cheap. Set travelers first, ancillaries are priced per passenger. If the quote is still being priced the API returns status="pricing"; by default this command polls up to 15 more times while that status persists. Check the returned status: if it is still "pricing", run get-ancillaries again with the same --trip-id to check progress. Pass --no-wait to return the pricing status immediately. ## Usage ```bash theme={null} jinko get-ancillaries [options] ``` ## Options | Flag | Required | Description | Default | | - | - | - | - | | `--trip-id ` | Yes | trip ID | | | `--no-wait` | No | return immediately even if the quote is still pricing (status="pricing") | | # jinko get-booking Source: https://docs.gojinko.com/cli/get-booking Retrieve a booking using the Jinko booking reference and the traveler's last name > [!NOTE] > > **Prices in this command's output are integers in minor units.** The integer > field here is named `amount` but the rule is the same: the object carries > `decimal_places`, so divide by `10 ** decimal_places` to display. See > [Money & prices](/concepts/money). Call this first before refund, exchange or cancellation. Read each stable items\[].booked_item_id and items\[].servicing eligibility, then pass --booking-ref and --booked-item-id to the action. Retrieve a booking the user already made. Use it when the traveler has their Jinko booking reference and last name, for example to look up the itinerary days later without signing in. Returns the full booking envelope: status, booking_state, travelers, and itinerary items with the supplier's own references (items\[].supplier_references: the airline record locator for flights, the hotel's or rental company's confirmation), plus `calendar`, the iCalendar (.ics) files for the booking's flights and stays, the same bytes the confirmation email attaches. The human format lists one line per file; `--format json` carries the file contents. ## Usage ```bash theme={null} jinko get-booking [options] ``` ## Options | Flag | Required | Description | Default | | - | - | - | - | | `--booking-ref ` | Yes | Jinko booking reference (e.g. JNK-A7B3X9), the `booking_ref` returned by trip-status / agent-pay submit, not a supplier PNR. JSON: `booking_ref`. | | | `--last-name ` | No | Traveler surname, required for guest lookup; owning credentials may omit it. JSON: last_name. | | | `--user-intent ` | No | the end user's request in their own words, forwarded to Jinko for observability and relevance (avoid PII). Env fallback: JINKO_USER_INTENT. JSON: `intent.user_intent`. | | ## Examples ```bash theme={null} jinko get-booking --booking-ref JNK-ABC123 --last-name Doe ``` The CLI still needs API credentials. Guest lookup verifies the booking reference and last name without requiring the traveler to log in. Returns the booking envelope or a generic 404 (existence non-leak). # jinko hotel-cancel commit Source: https://docs.gojinko.com/cli/hotel-cancel/commit Cancel a hotel at the refund the customer agreed to Start the cancellation a preview described, once the customer has agreed to its refund. Send the same --booking-ref, --booked-item-id and --last-name as the preview. A 409 cancels nothing: QUOTE_DRIFT (show the customer current.refund, then commit again with the retry_quote_id and that figure, or preview again when no retry_quote_id is given), QUOTE_EXPIRED (preview again), ACTIVE_OPERATION_EXISTS (poll the operation already running), NOT_CANCELLABLE, FUNDS_UNAVAILABLE. Success answers an operation handle: the refund has not moved yet; follow it with `hotel-cancel status`. ## Usage ```bash theme={null} jinko hotel-cancel commit [options] ``` ## Options | Flag | Required | Description | Default | | - | - | - | - | | `--booking-ref ` | Yes | Jinko booking reference from get-booking. JSON: booking_ref. | | | `--last-name ` | No | Lead guest surname, required for guest lookup; owning credentials may omit it. JSON: last_name. | | | `--booked-item-id ` | No | The booked item to service: booked_item_id from get-booking items\[] (an "itm\_..." string); required when several items of this domain exist. JSON: booked_item_id. | | | `--quote-id ` | Yes | the "svq\_..." quote_id returned by hotel-cancel preview. JSON: quote_id. | | | `--acknowledged ` | Yes | the preview refund object verbatim as JSON, the figure the customer agreed to; its amount_money is sent, else its inline value/currency/decimal_places: \{"amount_money":\{"value":45000,"currency":"EUR","decimal_places":2},…}. JSON: acknowledged. | | | `--user-intent ` | No | the end user's request in their own words, forwarded to Jinko for observability and relevance (avoid PII). Env fallback: JINKO_USER_INTENT. JSON: `intent.user_intent`. | | # jinko hotel-cancel preview Source: https://docs.gojinko.com/cli/hotel-cancel/preview Quote the refund and penalty before cancelling a hotel Quote what cancelling the hotel item would return to the customer right now: the refund, the penalty in force and the policy behind them. Nothing is cancelled. A penalty with fee_known: false is unknown, not zero. commitable: false means a commit would be refused and not_commitable_reason says why. Pass the returned quote_id to `hotel-cancel commit --quote-id` and the refund object verbatim as JSON to --acknowledged, before expires_at. ## Usage ```bash theme={null} jinko hotel-cancel preview [options] ``` ## Options | Flag | Required | Description | Default | | - | - | - | - | | `--booking-ref ` | Yes | Jinko booking reference from get-booking. JSON: booking_ref. | | | `--last-name ` | No | Lead guest surname, required for guest lookup; owning credentials may omit it. JSON: last_name. | | | `--booked-item-id ` | No | The booked item to service: booked_item_id from get-booking items\[] (an "itm\_..." string); required when several items of this domain exist. JSON: booked_item_id. | | | `--user-intent ` | No | the end user's request in their own words, forwarded to Jinko for observability and relevance (avoid PII). Env fallback: JINKO_USER_INTENT. JSON: `intent.user_intent`. | | # jinko hotel-cancel status Source: https://docs.gojinko.com/cli/hotel-cancel/status Check how a hotel cancellation and its refund are going Report where a committed hotel cancellation has got to, by the operation handle the commit (or the deprecated one-shot form) returned. Read-only. Keep polling while state is in_progress or attention_required. Do not tell the customer they have been refunded until money.vehicle_state is paid. ## Usage ```bash theme={null} jinko hotel-cancel status [options] ``` ## Options | Flag | Required | Description | Default | | - | - | - | - | | `--booking-ref ` | Yes | Jinko booking reference from get-booking. JSON: booking_ref. | | | `--last-name ` | No | Lead guest surname, required for guest lookup; owning credentials may omit it. JSON: last_name. | | | `--booked-item-id ` | No | The booked item to service: booked_item_id from get-booking items\[] (an "itm\_..." string); required when several items of this domain exist. JSON: booked_item_id. | | | `--operation ` | Yes | the "svc\_..." operation handle returned by hotel-cancel commit. JSON: operation. | | | `--user-intent ` | No | the end user's request in their own words, forwarded to Jinko for observability and relevance (avoid PII). Env fallback: JINKO_USER_INTENT. JSON: `intent.user_intent`. | | # jinko hotel-details Source: https://docs.gojinko.com/cli/hotel-details Fetch rich metadata (gallery, facilities, policies, per-room details) for a single hotel Pull the full marketing and operational profile of a single property after a search result catches the user's attention. Useful for questions like "what amenities does this hotel have", "is there a pool on site", or "what amenities does the deluxe room include". Returns the gallery, facilities, room metadata, and property policies in one payload. For cancellation terms, use hotel-search and read the selected rate: rates for the same hotel can have different refund policies. ## Usage ```bash theme={null} jinko hotel-details [options] ``` ## Options | Flag | Required | Description | Default | | - | - | - | - | | `--hotel-id ` | Yes | the hotels\[].hotel_id of a hotel-search result, an opaque string: pass it unchanged. Not a rate token | | | `--checkin ` | No | check-in date (YYYY-MM-DD); accepted, currently unused by Jinko | | | `--checkout ` | No | check-out date (YYYY-MM-DD); accepted, currently unused by Jinko | | ## Examples ```bash theme={null} # Minimal: just the hotel ID returned by hotel-search jinko hotel-details --hotel-id lpe2264 # Optional dates are accepted but currently unused by Jinko jinko hotel-details --hotel-id lpe2264 --checkin 2027-07-15 --checkout 2027-07-18 ``` # jinko hotel-search Source: https://docs.gojinko.com/cli/hotel-search Search live hotel inventory and rates > [!NOTE] > > **Read amounts from the `*_money` fields** in this command's output, such as > `rates[].total_amount_money`. Each carries `value` in minor units with its `decimal_places`: divide > `value` by `10 ** decimal_places`, or show `display`. The older fields beside > them (`total_amount`, `taxes_breakdown[].amount`, `cancellation_schedule[].amount`) are deprecated and hold major units. See > [Money & prices](/concepts/money). Search live hotel inventory and nightly rates for a destination and stay window. It handles requests like "three nights in Lisbon next weekend for two adults" or "family room in Rome with one child in August". Choose an offer from `hotels[].offers[]` and pass its `offer_id` to `jinko trip --trip-item-token` to start a booking. ## Usage ```bash theme={null} jinko hotel-search [options] ``` ## Options | Flag | Required | Description | Default | | - | - | - | - | | `--query ` | No | unambiguous city or well-known POI only. For regions, use --latitude + --longitude or --city-name + --country-code. Mode B. JSON: `query`. | | | `--city-name ` | No | city name (e.g. "Paris"), Mode B destination, or Mode A lookup scope when combined with --hotel-name. JSON: `city_name`. | | | `--country-code ` | No | ISO 3166-1 alpha-2 country code (e.g. fr), Mode B destination, or Mode A lookup scope when combined with --hotel-name. JSON: `country_code`. | | | `--latitude ` | No | latitude for geo-radius search, Mode B. JSON: `latitude`. | | | `--longitude ` | No | longitude for geo-radius search, Mode B. JSON: `longitude`. | | | `--radius-km ` | No | search radius in km (default 5, max 50), Mode B. JSON: `radius_km`. | | | `--hotel-ids ` | No | re-shop specific hotel IDs, Mode A. JSON: `hotel_ids`. | | | `--hotel-name ` | No | look up a specific hotel by name, Mode A. Pair with --city-name and --country-code to narrow the lookup scope. | | | `--checkin ` | Yes | check-in date (YYYY-MM-DD). JSON: `checkin`. | | | `--checkout ` | Yes | check-out date (YYYY-MM-DD). JSON: `checkout`. | | | `--adults ` | No | number of adults (shorthand). JSON: `adults`. | `"2"` | | `--children ` | No | children ages (shorthand, e.g. 5 7). JSON: `children`. | | | `--rooms ` | No | number of rooms (shorthand). JSON: `rooms`. | | | `--currency ` | No | ISO 4217 currency code (default USD). JSON: `currency`. | | | `--guest-nationality ` | No | guest nationality (ISO 3166-1 alpha-2). JSON: `guest_nationality`. | | | `--min-rating ` | No | minimum guest review rating (0-10). JSON: `min_rating`. | | | `--star-rating ` | No | minimum star rating (1-5). JSON: `min_star_rating`. | | | `--max-star-rating ` | No | maximum star rating (1-5). JSON: `max_star_rating`. | | | `--min-reviews ` | No | minimum number of reviews. JSON: `min_reviews`. | | | `--max-results ` | No | maximum hotels to return per page (default 50). JSON: `max_results`. | | | `--offset ` | No | pagination offset, skip this many hotels at the upstream search (default 0). JSON: `offset`. | | | `--max-budget-per-night ` | No | keep only hotels whose cheapest per-night price (per room, in the request currency) fits this budget; the search scans deeper automatically when few hotels fit. JSON: `max_budget_per_night`. | | | `--user-intent ` | No | the end user's request in their own words, forwarded to Jinko for observability and relevance (avoid PII). Env fallback: JINKO_USER_INTENT. JSON: `intent.user_intent`. | | ## Examples ```bash theme={null} # Paris, 2 adults, 3 nights jinko hotel-search --query "Paris" --checkin 2027-07-15 --checkout 2027-07-18 --adults 2 # By city + country, filtered jinko hotel-search --city-name "Barcelona" --country-code ES \ --checkin 2027-08-01 --checkout 2027-08-05 --adults 2 \ --min-rating 8 --star-rating 4 ``` # jinko lowest-fare Source: https://docs.gojinko.com/cli/lowest-fare Cheapest fares for a fixed route + date, up to ten itineraries, cheapest first > [!NOTE] > > **Prices in this command's output are integers in minor units.** Money objects > carry `decimal_places` — divide by `10 ** decimal_places` to display > (`{ "value": 15977, "decimal_places": 2 }` is **159.77**, not 15,977). See > [Money & prices](/concepts/money). The cheapest fares for a fixed route and date. Takes the same inputs as Flight Calendar but for one specific departure date (one-way, or with a return date for round-trip) returns up to ten itineraries sorted cheapest-first. The fixed-date counterpart of Flight Calendar, reach for it when the date is locked and you just want the cheapest options that day. Cache-backed; no live pricing. Each result includes an `offer_token`: pass it to flight-search --offer-token for a live price, which returns the `trip_item_token` you add to a trip. ## Usage ```bash theme={null} jinko lowest-fare [options] ``` ## Options | Flag | Required | Description | Default | | - | - | - | - | | `--origins ` | Yes | origin IATA airport/city codes. JSON: `origins[]`. | | | `--destinations ` | No | destination IATA airport/city codes. Omit to scan all destinations. JSON: `destinations[]`. | | | `--date ` | Yes | departure date (YYYY-MM-DD). JSON: `departure_dates[0]`. | | | `--return-date ` | No | return date (YYYY-MM-DD), makes it a round-trip. JSON: `return_dates[0]`. | | | `--cabin-class ` | No | cabin class: economy, premium_economy, business, first (default: economy). JSON: `cabin_class`. | | | `--direct-only` | No | only direct flights. JSON: `direct_only`. | | | `--user-intent ` | No | the end user's request in their own words, forwarded to Jinko for observability and relevance (avoid PII). Env fallback: JINKO_USER_INTENT. JSON: `intent.user_intent`. | | # Overview Source: https://docs.gojinko.com/cli/overview What you can do with the Jinko CLI and how to run it from your shell: explore travel demand, search flights, hotels, and rental cars, build a trip, pay, and manage bookings. The Jinko CLI brings the whole platform to your terminal. Install it, sign in once, and you can explore travel demand, search flights, hotels, and rental cars, build a trip, pay, and manage bookings, straight from your shell or a script. New to this? Start with [Connect via CLI](/connect/cli) for install and first-run setup. The commands are grouped by what they do (below), and each page lists its flags, arguments, and examples. ## Install ```bash theme={null} npm install -g @gojinko/cli ``` ## Authenticate ```bash theme={null} jinko auth login # prompts for your API key jinko auth login --key jnk_t_your_key # non-interactive ``` ## Environments The CLI targets **production** by default. Use `--env sandbox` to run against isolated sandbox data, which uses **separate API keys**: | Environment | API base | Flag | | - | - | - | | Production (default) | `https://api.gojinko.com` | `--env prod` | | Sandbox | `https://api.sandbox.gojinko.com` | `--env sandbox` | ```bash theme={null} jinko config set environment sandbox # make sandbox the default for this machine jinko --env prod find-destination --origins JFK # …or override per-command ``` ## Output Commands print **JSON** by default. Pass `--format table` for a human-readable view. ## Command groups > [card] [Travel Demand](/cli/travel-demand/destination) > > Use `jinko travel-demand` to explore search demand with `destination`, `market`, `audience`, their `-trend` variants, and `trend`. > [card] [Flights](/cli/flight-search) > > Discover routes and dates, run a live search, then handle refunds and exchanges: `find-destination`, `flight-calendar`, `find-dates`, `lowest-fare`, `price-monitoring`, `flight-search`, `refund`, `exchange`. > [card] [Hotels](/cli/hotel-search) > > Search hotels and pull details: `hotel-search`, `hotel-details`, `hotel-cancel`. > [card] [Cars](/cli/car-search) > > Search live rental offers and cancel a rental with the fee shown first; a `car_*` offer books through `trip`: `car-search`, `car-cancel preview` / `commit` / `status`. > [card] [Trip & Payment](/cli/trip) > > Build a trip, add ancillaries, check out, pay, and look up the booking: `trip`, `get-ancillaries`, `select-ancillaries`, `checkout`, `agent-pay submit`, `trip-status`, `get-booking`. > [card] [Account & utilities](/cli/auth/login) > > Sign in and configure the CLI: `auth login` / `logout` / `status`, `config set` / `show`, and `schema`. To try a Travel Demand ranking in sandbox, include the group name and the required `--origin` selector: ```bash theme={null} jinko --env sandbox travel-demand destination --origin global --limit 1 ``` `global` includes all origins. Run `jinko travel-demand --help` to list the other subcommands. # jinko price-monitoring Source: https://docs.gojinko.com/cli/price-monitoring Get one cached price snapshot for a specific route and date pair > [!NOTE] > > **Prices in this command's output are integers in minor units.** Money objects > carry `decimal_places` — divide by `10 ** decimal_places` to display > (`{ "value": 15977, "decimal_places": 2 }` is **159.77**, not 15,977). See > [Money & prices](/concepts/money). Get one cached price snapshot for a specific route and date pair, then exit. To track fare changes over time, schedule repeated calls and send notifications from your own script or agent. When status is "ok", the response includes the cheapest cached fare for one adult and an offer token you can pass to flight-search for live pricing. When status is "stale", there is no matching cached itinerary and no fare or offer token; retry later, or use flight-search if a live quote is needed now. A stale result does not mean there are no flights. The fare and --max-total cap do not scale with --adults. For an exact whole-trip budget check, use flight-search with --max-total and the full traveler counts. Cache-only; never triggers a live call. ## Usage ```bash theme={null} jinko price-monitoring [options] ``` ## Options | Flag | Required | Description | Default | | - | - | - | - | | `--origin ` | Yes | origin IATA code (e.g. PAR for city, CDG for airport). See --origin-type for how an untyped code is read. JSON: `origin`. | | | `--destination ` | Yes | destination IATA code (e.g. NYC for city, JFK for airport). See --destination-type. JSON: `destination`. | | | `--origin-type ` | No | how to read --origin: city or airport. Omitted: a code that names a multi-airport city is searched as the city, every other code as the airport, NYC, LON, PAR are cities; JFK, LHR, CDG are airports; LAX, MIA, LAS (a city sharing its code with its main airport) are the CITY. Send airport when the user named the airport. JSON: `origin_type`. | | | `--destination-type ` | No | how to read --destination: city or airport. Omitted: a code that names a multi-airport city is searched as the city, every other code as the airport, NYC, LON, PAR are cities; JFK, LHR, CDG are airports; LAX, MIA, LAS (a city sharing its code with its main airport) are the CITY. Send airport when the user named the airport. JSON: `destination_type`. | | | `--departure-date ` | Yes | departure date (YYYY-MM-DD). JSON: `departure_date`. | | | `--return-date ` | No | return date for round-trip (YYYY-MM-DD). JSON: `return_date`. | | | `--adults ` | No | requested adult count (default: 1), echoed in the response only; the cached fare and cap remain for one adult. JSON: `adults`. | | | `--cabin-class ` | No | cabin class: economy, premium_economy, business, first. JSON: `cabin_class`. | | | `--direct-only` | No | only consider direct flights. JSON: `direct_only`. | | | `--max-total ` | No | upper bound on the cached fare's total; cached fares are priced for one adult. JSON: `max_total`. | | | `--include-carriers ` | No | whitelist IATA 2-letter carrier codes (e.g. AF KL). JSON: `include_carriers`. | | | `--exclude-carriers ` | No | blacklist IATA 2-letter carrier codes (e.g. FR U2). JSON: `exclude_carriers`. | | | `--user-intent ` | No | the end user's request in their own words, forwarded to Jinko for observability and relevance (avoid PII). Env fallback: JINKO_USER_INTENT. JSON: `intent.user_intent`. | | ## Examples ```bash theme={null} # Plain poll for the cheapest cached PAR → NYC. jinko price-monitoring --origin PAR --destination NYC \ --departure-date 2027-06-17 --return-date 2027-06-26 --format json ``` ```bash theme={null} # Cron entry: poll every 6 hours, alert on a hit. # 0 */6 * * * jinko price-monitoring --origin PAR --destination NYC \ --departure-date 2027-06-17 --return-date 2027-06-26 \ --direct-only --cabin-class economy --max-total 800 \ --format json | jq -e '.status == "ok"' \ && /usr/local/bin/notify-on-price-drop.sh ``` # jinko refund check Source: https://docs.gojinko.com/cli/refund/check Check refund eligibility (deprecated: use refund preview) Check refund eligibility without changing the booking. This command returns no amounts; the customer's refund and penalty come from the [refund preview](/api/flight-refund-preview). Deprecated: use refund preview, which answers the same eligibility with the customer refund and penalty. Checks refund eligibility only. ## Usage ```bash theme={null} jinko refund check [options] ``` ## Options | Flag | Required | Description | Default | | - | - | - | - | | `--booking-ref ` | Yes | Jinko booking reference | | | `--last-name ` | No | Traveler surname, required for guest lookup; owning credentials may omit it. | | | `--booked-item-id ` | No | The booked item to service: booked_item_id from get-booking items\[] (an "itm\_..." string); required when several items of this domain exist. JSON: booked_item_id. | | | `--user-intent ` | No | the end user's request in their own words, forwarded to Jinko for observability and relevance (avoid PII). Env fallback: JINKO_USER_INTENT. JSON: `intent.user_intent`. | | ## Examples ```bash theme={null} jinko refund check --booking-ref JNK-ABC123 --last-name Doe ``` Read-only, never triggers a refund. `check` answers eligibility only (`is_refundable`, `is_voidable`, `support_level`) and returns no amounts. Show the customer's refund and penalty from the [refund preview](/api/flight-refund-preview) (`flight_refund_preview`) before committing. # jinko refund commit Source: https://docs.gojinko.com/cli/refund/commit Initiate a refund for a booked flight > [!NOTE] > > **Prices in this command's output are integers in minor units.** Money objects > carry `decimal_places` — divide by `10 ** decimal_places` to display > (`{ "value": 15977, "decimal_places": 2 }` is **159.77**, not 15,977). See > [Money & prices](/concepts/money). Initiate a refund for a booked flight, bound to a preview: --quote-id \ --acknowledged \. A MANUAL_REQUIRED preview that names no refund is committed with --quote-id and --manual-ok alone. Without --quote-id it uses the deprecated one-shot commit, which is not bound to a preview. ## Usage ```bash theme={null} jinko refund commit [options] ``` ## Options | Flag | Required | Description | Default | | - | - | - | - | | `--booking-ref ` | Yes | Jinko booking reference | | | `--last-name ` | No | Traveler surname, required for guest lookup; owning credentials may omit it. | | | `--booked-item-id ` | No | The booked item to service: booked_item_id from get-booking items\[] (an "itm\_..." string); required when several items of this domain exist. JSON: booked_item_id. | | | `--quote-id ` | No | quote_id returned by refund preview. JSON: quote_id. | | | `--acknowledged ` | No | preview refund object verbatim as JSON; its amount_money is sent, else the inline value/currency/decimal_places an older API returns: \{"amount_money":\{"value":12000,"currency":"USD","decimal_places":2},…} | | | `--manual-ok` | No | consent to manual handling of the quoted refund | | | `--user-intent ` | No | the end user's request in their own words, forwarded to Jinko for observability and relevance (avoid PII). Env fallback: JINKO_USER_INTENT. JSON: `intent.user_intent`. | | ## Examples ```bash theme={null} jinko refund commit --booking-ref JNK-ABC123 --last-name Doe # → { "refund_reference": "REF-xyz789", "refund_status": "IN_PROGRESS", "state": "in_progress" } ``` Follow with `jinko refund status` to poll until terminal. # jinko refund preview Source: https://docs.gojinko.com/cli/refund/preview Preview the customer's refund and penalty before committing Preview the customer refund and penalty for the whole booked flight item. Nothing is cancelled. Pass the returned quote_id to refund commit --quote-id and the refund object verbatim as JSON to --acknowledged. ## Usage ```bash theme={null} jinko refund preview [options] ``` ## Options | Flag | Required | Description | Default | | - | - | - | - | | `--booking-ref ` | Yes | Jinko booking reference | | | `--last-name ` | No | Traveler surname, required for guest lookup; owning credentials may omit it. | | | `--booked-item-id ` | No | The booked item to service: booked_item_id from get-booking items\[] (an "itm\_..." string); required when several items of this domain exist. JSON: booked_item_id. | | | `--user-intent ` | No | the end user's request in their own words, forwarded to Jinko for observability and relevance (avoid PII). Env fallback: JINKO_USER_INTENT. JSON: `intent.user_intent`. | | # jinko refund status Source: https://docs.gojinko.com/cli/refund/status Check the status of a refund > [!NOTE] > > **Prices in this command's output are integers in minor units.** Money objects > carry `decimal_places` — divide by `10 ** decimal_places` to display > (`{ "value": 15977, "decimal_places": 2 }` is **159.77**, not 15,977). See > [Money & prices](/concepts/money). Poll the current status of a previously committed refund. ## Usage ```bash theme={null} jinko refund status [options] ``` ## Options | Flag | Required | Description | Default | | - | - | - | - | | `--booking-ref ` | Yes | Jinko booking reference | | | `--last-name ` | No | Traveler surname, required for guest lookup; owning credentials may omit it. | | | `--booked-item-id ` | No | The booked item to service: booked_item_id from get-booking items\[] (an "itm\_..." string); required when several items of this domain exist. JSON: booked_item_id. | | | `--operation ` | No | operation field returned by quote-bound refund commit | | | `--user-intent ` | No | the end user's request in their own words, forwarded to Jinko for observability and relevance (avoid PII). Env fallback: JINKO_USER_INTENT. JSON: `intent.user_intent`. | | ## Examples ```bash theme={null} jinko refund status \ --booking-ref JNK-ABC123 \ --last-name Doe \ --refund-reference REF-xyz789 ``` For `refund_status`, terminal values are `SUCCEEDED`, `FAILED`, and `CANCELLED`. `PENDING` and `IN_PROGRESS` are still running; `MANUAL_REQUIRED` and `UNCONFIRMED` are not terminal. For the platform’s `state` field, `succeeded` and `failed` are terminal; keep polling for `in_progress` or `attention_required`. Treat unknown `refund_status` values as still running and inspect `state`. Poll every 15-30s until terminal. # jinko schema Source: https://docs.gojinko.com/cli/schema Show a bundled request/response schema. List available schemas if no command is given. Not every CLI command has a bundled schema. Show a bundled request/response schema. List available schemas if no command is given. Not every CLI command has a bundled schema. ## Usage ```bash theme={null} jinko schema [options] [command] ``` ### Arguments | Argument | Required | Description | | - | - | - | | `command` | No | | ## Options *No options.* ## Examples ```bash theme={null} # List commands with documented schemas jinko schema # List flight command names jinko schema | jq -r '.[] | select(.command | startswith("flight-")) | .command' # Inspect a command's request and response jinko schema flight-search ``` Without a command name, `schema` returns an array of command summaries. Pass a command name to inspect its request and response shapes. # jinko select-ancillaries Source: https://docs.gojinko.com/cli/select-ancillaries Select ancillaries (baggage, seats, meals) for a trip item > [!NOTE] > > **Prices in this command's output are integers in minor units.** The integer > field here is named `amount` but the rule is the same: the object carries > `decimal_places`, so divide by `10 ** decimal_places` to display. See > [Money & prices](/concepts/money). Add ancillaries to a flight item before checkout, after travelers are attached. Selections use full-replacement semantics, include every bag, seat, or meal the user wants kept on the flight item identified by --item-id in each call. Use --select offer_id\@traveler_ref for per-traveler bags or meals. Seats come from get-ancillaries: each segment has a seat offer with a seat_map. Choose one seat per traveler per segment; chargeable seats add to the total. The traveler_ref comes from the trip travelers (pax_1, pax_2, …; run trip-status --trip-id \). Supply at least one of --select or --seat. ## Usage ```bash theme={null} jinko select-ancillaries [options] ``` ## Options | Flag | Required | Description | Default | | - | - | - | - | | `--trip-id ` | Yes | trip ID | | | `--item-id ` | Yes | trip item ID | | | `--select ` | No | comma-separated offer_id or offer_id\@traveler_ref entries (bags/meals) | | | `--traveler-ref ` | No | traveler_ref for --select entries without @traveler_ref; does not apply to --seat | | | `--quantity ` | No | quantity for --select entries only (default: 1) | `"1"` | | `--user-intent ` | No | the end user's request in their own words, forwarded to Jinko for observability and relevance (avoid PII). Env fallback: JINKO_USER_INTENT. JSON: `intent.user_intent`. | | | `--seat ` | No | seat for one traveler on one segment: \:\:\ (repeatable, e.g. --seat seat_2202_0:pax_1:14A --seat seat_2202_0:pax_2:14B). Offers and seat numbers come from get-ancillaries; traveler_ref from the trip travelers. | `[]` | ## Examples ```bash theme={null} # Preselect a baggage offer before checkout jinko select-ancillaries \ --trip-id 42 \ --item-id 7 \ --select anc_bag_20kg ``` # jinko travel-demand audience Source: https://docs.gojinko.com/cli/travel-demand/audience Traveler-type mix for a destination Traveler-type composition (Solo/Couple/Family/Group) of demand for a destination. --destination is required. (traveler_type is not a filter here, it is the dimension.) ## Usage ```bash theme={null} jinko travel-demand audience [options] ``` ## Options | Flag | Required | Description | Default | | - | - | - | - | | `--origin ` | No | origin filter, e.g. Country:US or City:NYC (or 'global' for all origins) | | | `--destination ` | Yes | destination, e.g. Country:JP | | | `--departure-date-from ` | No | start of departure window (use with --departure-date-to; omit both for no departure-date filter) | | | `--departure-date-to ` | No | end of departure window (use with --departure-date-from; omit both for no departure-date filter) | | | `--trip-type ` | No | oneway\|roundtrip | | | `--trip-duration-min ` | No | minimum trip length in nights (round-trips only, >= 0) | | | `--trip-duration-max ` | No | maximum trip length in nights (>= --trip-duration-min) | | | `--search-window-min ` | No | minimum advance-purchase window in days before departure (>= 0) | | | `--search-window-max ` | No | maximum advance-purchase window in days (>= --search-window-min) | | | `--snapshot-window-days ` | No | days of recent search activity aggregated into the demand level (2-90, default 7) | | | `--limit ` | No | max rows, 1-200 (default 20) | | # jinko travel-demand audience-trend Source: https://docs.gojinko.com/cli/travel-demand/audience-trend Demand time series for the traveler-type mix A series per traveler-type segment (Solo/Couple/Family/Group) of demand for a destination. --destination is required. (traveler_type is not a filter here, it is the dimension.) ## Usage ```bash theme={null} jinko travel-demand audience-trend [options] ``` ## Options | Flag | Required | Description | Default | | - | - | - | - | | `--origin ` | No | origin filter, e.g. Country:US or City:NYC (or 'global' for all origins) | | | `--destination ` | Yes | destination, e.g. Country:JP | | | `--departure-date-from ` | No | start of departure window (use with --departure-date-to; omit both for no departure-date filter, buckets count searches for all departure dates, recommended) | | | `--departure-date-to ` | No | end of departure window (use with --departure-date-from; omit both for no departure-date filter) | | | `--trip-type ` | No | oneway\|roundtrip | | | `--trip-duration-min ` | No | minimum trip length in nights (round-trips only, >= 0) | | | `--trip-duration-max ` | No | maximum trip length in nights (>= --trip-duration-min) | | | `--search-window-min ` | No | minimum advance-purchase window in days before departure (>= 0) | | | `--search-window-max ` | No | maximum advance-purchase window in days (>= --search-window-min) | | | `--trend-window ` | No | number of buckets the series spans, in the granularity unit (day 2-60 \| week 2-52 \| month 2-12, default 12) | | | `--granularity ` | No | series bucket size: week (default) \| day \| month | `"week"` | | `--limit ` | No | max number of series (top-N), 1-50 (default 10) | | # jinko travel-demand destination Source: https://docs.gojinko.com/cli/travel-demand/destination Top destinations by search demand Most-searched destinations by de-sampled request share. --origin is required: use a location such as Country:US or City:NYC, or global for all origins. Optional --destination-country (a Country selector, allowed only with --level city) narrows the ranking to that country's destination cities. ## Usage ```bash theme={null} jinko travel-demand destination [options] ``` ## Options | Flag | Required | Description | Default | | - | - | - | - | | `--origin ` | Yes | origin filter, e.g. Country:US or City:NYC (or 'global' for all origins) | | | `--traveler-type ` | No | Solo\|Couple\|Group\|Family | | | `--departure-date-from ` | No | start of departure window (use with --departure-date-to; omit both for no departure-date filter) | | | `--departure-date-to ` | No | end of departure window (use with --departure-date-from; omit both for no departure-date filter) | | | `--trip-type ` | No | oneway\|roundtrip | | | `--trip-duration-min ` | No | minimum trip length in nights (round-trips only, >= 0) | | | `--trip-duration-max ` | No | maximum trip length in nights (>= --trip-duration-min) | | | `--search-window-min ` | No | minimum advance-purchase window in days before departure (>= 0) | | | `--search-window-max ` | No | maximum advance-purchase window in days (>= --search-window-min) | | | `--snapshot-window-days ` | No | days of recent search activity aggregated into the demand level (2-90, default 7) | | | `--limit ` | No | max rows, 1-200 (default 20) | | | `--level ` | No | ranked output granularity: country (default) or city | `"country"` | | `--destination-country ` | No | destination country to rank cities within, e.g. Country:FR, allowed only with --level city | | # jinko travel-demand destination-trend Source: https://docs.gojinko.com/cli/travel-demand/destination-trend Demand time series for the top-N destinations Ranks destinations by within-window growth, then returns each top-N destination’s series. --origin is required: use a location such as Country:US or City:NYC, or global for all origins. Optional --destination-country (a Country selector, allowed only with --level city) narrows the ranking to that country's destination cities. ## Usage ```bash theme={null} jinko travel-demand destination-trend [options] ``` ## Options | Flag | Required | Description | Default | | - | - | - | - | | `--origin ` | Yes | origin filter, e.g. Country:US or City:NYC (or 'global' for all origins) | | | `--traveler-type ` | No | Solo\|Couple\|Group\|Family | | | `--departure-date-from ` | No | start of departure window (use with --departure-date-to; omit both for no departure-date filter, buckets count searches for all departure dates, recommended) | | | `--departure-date-to ` | No | end of departure window (use with --departure-date-from; omit both for no departure-date filter) | | | `--trip-type ` | No | oneway\|roundtrip | | | `--trip-duration-min ` | No | minimum trip length in nights (round-trips only, >= 0) | | | `--trip-duration-max ` | No | maximum trip length in nights (>= --trip-duration-min) | | | `--search-window-min ` | No | minimum advance-purchase window in days before departure (>= 0) | | | `--search-window-max ` | No | maximum advance-purchase window in days (>= --search-window-min) | | | `--trend-window ` | No | number of buckets the series spans, in the granularity unit (day 2-60 \| week 2-52 \| month 2-12, default 12) | | | `--granularity ` | No | series bucket size: week (default) \| day \| month | `"week"` | | `--limit ` | No | max number of series (top-N), 1-50 (default 10) | | | `--level ` | No | ranked output granularity: country (default) or city | `"country"` | | `--destination-country ` | No | destination country to rank cities within, e.g. Country:FR, allowed only with --level city | | # jinko travel-demand market Source: https://docs.gojinko.com/cli/travel-demand/market Top source markets for a destination Which source markets generate the most demand for a destination. --destination is required. Optional --origin-country (a Country selector, allowed only with --level city) narrows the ranking to that country's origin cities. ## Usage ```bash theme={null} jinko travel-demand market [options] ``` ## Options | Flag | Required | Description | Default | | - | - | - | - | | `--destination ` | Yes | destination, e.g. Country:TH | | | `--traveler-type ` | No | Solo\|Couple\|Group\|Family | | | `--departure-date-from ` | No | start of departure window (use with --departure-date-to; omit both for no departure-date filter) | | | `--departure-date-to ` | No | end of departure window (use with --departure-date-from; omit both for no departure-date filter) | | | `--trip-type ` | No | oneway\|roundtrip | | | `--trip-duration-min ` | No | minimum trip length in nights (round-trips only, >= 0) | | | `--trip-duration-max ` | No | maximum trip length in nights (>= --trip-duration-min) | | | `--search-window-min ` | No | minimum advance-purchase window in days before departure (>= 0) | | | `--search-window-max ` | No | maximum advance-purchase window in days (>= --search-window-min) | | | `--snapshot-window-days ` | No | days of recent search activity aggregated into the demand level (2-90, default 7) | | | `--limit ` | No | max rows, 1-200 (default 20) | | | `--level ` | No | ranked output granularity: country (default) or city | `"country"` | | `--origin-country ` | No | origin country to rank cities within, e.g. Country:US, allowed only with --level city | | # jinko travel-demand market-trend Source: https://docs.gojinko.com/cli/travel-demand/market-trend Demand time series for the top-N source markets Ranks source markets for a destination by within-window growth, then returns each top-N market’s series. --destination is required. Optional --origin-country (a Country selector, allowed only with --level city) narrows the ranking to that country's origin cities. ## Usage ```bash theme={null} jinko travel-demand market-trend [options] ``` ## Options | Flag | Required | Description | Default | | - | - | - | - | | `--destination ` | Yes | destination, e.g. Country:TH | | | `--traveler-type ` | No | Solo\|Couple\|Group\|Family | | | `--departure-date-from ` | No | start of departure window (use with --departure-date-to; omit both for no departure-date filter, buckets count searches for all departure dates, recommended) | | | `--departure-date-to ` | No | end of departure window (use with --departure-date-from; omit both for no departure-date filter) | | | `--trip-type ` | No | oneway\|roundtrip | | | `--trip-duration-min ` | No | minimum trip length in nights (round-trips only, >= 0) | | | `--trip-duration-max ` | No | maximum trip length in nights (>= --trip-duration-min) | | | `--search-window-min ` | No | minimum advance-purchase window in days before departure (>= 0) | | | `--search-window-max ` | No | maximum advance-purchase window in days (>= --search-window-min) | | | `--trend-window ` | No | number of buckets the series spans, in the granularity unit (day 2-60 \| week 2-52 \| month 2-12, default 12) | | | `--granularity ` | No | series bucket size: week (default) \| day \| month | `"week"` | | `--limit ` | No | max number of series (top-N), 1-50 (default 10) | | | `--level ` | No | ranked output granularity: country (default) or city | `"country"` | | `--origin-country ` | No | origin country to rank cities within, e.g. Country:US, allowed only with --level city | | # jinko travel-demand trend Source: https://docs.gojinko.com/cli/travel-demand/trend Demand time series for explicit origin/destination pairs Deep dive: one de-sampled search-volume series per (origin, destination) pair. --origin and --destination are required and repeatable (or comma-separated); v1 allows a list on only one side (keep the other a single location). ## Usage ```bash theme={null} jinko travel-demand trend [options] ``` ## Options | Flag | Required | Description | Default | | - | - | - | - | | `--origin ` | Yes | origin selector, e.g. Country:US (repeatable). JSON: `origins`. | `[]` | | `--destination ` | Yes | destination selector, e.g. Country:FR (repeatable). JSON: `destinations`. | `[]` | | `--traveler-type ` | No | Solo\|Couple\|Group\|Family | | | `--departure-date-from ` | No | start of departure window (use with --departure-date-to; omit both for no departure-date filter, buckets count searches for all departure dates, recommended) | | | `--departure-date-to ` | No | end of departure window (use with --departure-date-from; omit both for no departure-date filter) | | | `--trip-type ` | No | oneway\|roundtrip | | | `--trip-duration-min ` | No | minimum trip length in nights (round-trips only, >= 0) | | | `--trip-duration-max ` | No | maximum trip length in nights (>= --trip-duration-min) | | | `--search-window-min ` | No | minimum advance-purchase window in days before departure (>= 0) | | | `--search-window-max ` | No | maximum advance-purchase window in days (>= --search-window-min) | | | `--trend-window ` | No | number of buckets the series spans, in the granularity unit (day 2-60 \| week 2-52 \| month 2-12, default 12) | | | `--granularity ` | No | series bucket size: week (default) \| day \| month | `"week"` | # jinko trip Source: https://docs.gojinko.com/cli/trip Create and manage a trip, add or remove items, set travelers > [!NOTE] > > **Read amounts from the `*_money` fields** in this command's output, such as > `items[].price_money` and `totals.total_money`. Each carries `value` in minor units with its `decimal_places`: divide > `value` by `10 ** decimal_places`, or show `display`. The older fields beside > them (`price`, `currency`, `totals.total`) are deprecated and hold major units. See > [Money & prices](/concepts/money). Assemble and edit a trip before sending it to checkout. Use it to add a flight, hotel or car-rental offer, set traveler details, swap one item for another, or remove an item. For bags, seats and meals, use get-ancillaries to list offers, then the separate select-ancillaries command to choose them. Flights, hotels and cars can sit side by side in the same trip and settle through a single checkout; a trip holding a car needs the contact's honorific (`contact.title`) before checkout. ## Usage ```bash theme={null} jinko trip [options] ``` ## Options | Flag | Required | Description | Default | | - | - | - | - | | `--trip-id ` | No | existing trip ID (omit to create new) | | | `--trip-item-token ` | No | add an item: the trip_item_token of a fare (flight-search), an htl\_\* hotel rate (hotel-search) or a car\_\* offer (car-search). JSON: `add_item.trip_item_token`. | | | `--remove-item-id ` | No | remove an existing item by item_id (from a prior trip response items\[].item_id). Requires --trip-id. Can be combined with --trip-item-token to swap an item in one call. | | | `--special-request ` | No | HOTEL ONLY: a free-text request for the property (late arrival, quiet room, cot…), sent with --trip-item-token. Repeat the flag for several: at most 10, 500 characters each, 1500 in total; blank values are dropped. Requests only, neither Jinko nor the hotel guarantees them. JSON: `add_item.special_requests`. | `[]` | | `--travelers ` | No | travelers JSON array, each \{first_name, last_name, traveler_type: adult \| child \| infant, date_of_birth?, gender?, …}. Required to complete a booking; date_of_birth + gender are required for flights but optional for hotel-only trips; the first traveler also supplies the booking contact name. | | | `--contact ` | No | contact JSON \{email, phone, title?} (sent as upsert_travelers.contact), email and phone are required; phone is in international format: a leading + and country code, e.g. +12025550147. Spaces, hyphens, dots and parentheses are accepted and removed. A number without the leading + is rejected with INVALID_PHONE_NUMBER. title is the honorific (mr / ms / mx), required to book a car rental and optional otherwise. Optional while building the trip, but required before booking. Must be passed together with --travelers (the full travelers list); --contact alone is refused. | | | `--user-intent ` | No | the end user's request in their own words, forwarded to Jinko for observability and relevance (avoid PII). Env fallback: JINKO_USER_INTENT. JSON: `intent.user_intent`. | | ## Examples ```bash theme={null} # Create a trip with an item + travelers in one call jinko trip \ --trip-item-token "$TRIP_ITEM_TOKEN" \ --travelers '[{"first_name":"Jane","last_name":"Doe","date_of_birth":"1990-01-15","gender":"FEMALE","traveler_type":"adult","frequent_flyer":{"airline":"LH","number":"992100100"}}]' \ --contact '{"email":"jane@example.com","phone":"+33612345678"}' # Add another item to an existing trip jinko trip --trip-id trip_1048576 --trip-item-token "htl_def..." ``` # jinko trip-status Source: https://docs.gojinko.com/cli/trip-status Fetch the full lifecycle state of a trip, items, travelers, quote, fulfillment, and any booking references > [!NOTE] > > **Read amounts from the `*_money` fields** in this command's output, such as > `total_amount_money` and `items[].price_money`. Each carries `value` in minor units with its `decimal_places`: divide > `value` by `10 ** decimal_places`, or show `display`. The older fields beside > them (`total_amount`, `items[].price`) are deprecated and hold major units. See > [Money & prices](/concepts/money). Inspect the current state of a trip without modifying it. Reach for it when you need to confirm what items are on the trip, verify the travelers attached to a booking, or check whether a checkout has finalized after the user paid. The response covers items, traveler details, quote status, and any booking references that have been issued. ## Usage ```bash theme={null} jinko trip-status [options] ``` ## Options | Flag | Required | Description | Default | | - | - | - | - | | `--trip-id ` | Yes | trip_id returned by the trip command; not the booking_ref used by get-booking | | ## Examples ```bash theme={null} # Full trip state: items, travelers, quote, fulfillment, bookings jinko trip-status --trip-id trip_1048576 # Poll until fulfillment is terminal while true; do status=$(jinko trip-status --trip-id trip_1048576 --format json | jq -r '.fulfillment.status') echo "Status: $status" case "$status" in completed|partial|failed|cancelled|expired_quote|exchange_partial_failure) break ;; esac sleep 5 done ``` # Ancillaries Source: https://docs.gojinko.com/concepts/ancillaries Find, select, and manage flight add-ons, car rental extras, and hotel options with Jinko. Help travelers choose the extras they need before payment and follow each booking outcome. Availability depends on the supplier and selected offer. An empty ancillary list means that no purchasable option was returned for that item. ## Booking flow ```mermaid theme={null} flowchart LR A["Discover extras"] --> B["Select extras"] B --> C["Payment"] C --> D["Manage
booking outcomes"] classDef jinko fill:#FFF4F4,stroke:#FF6363,color:#1A1A1A,stroke-width:2px; class A,B,C,D jinko; ``` ## Capabilities > [card] [Discover](#discover-available-extras) > > Find the extras available for the selected travel items. > [card] [Select](#select-extras-and-check-out) > > Choose extras for each traveler or for the booking. > [card] [Payment](#select-extras-and-check-out) > > Review the total and pay with the latest checkout. > [card] [Manage](#manage-after-booking) > > Check each flight ancillary and explain pending or failed outcomes. ## Build the flow 1. **Discover:** add the travel items and travelers to a trip, then retrieve the available extras. 2. **Select:** check what is included and keep every extra the traveler wants in the selection. 3. **Payment:** review the total, create checkout, and collect payment. 4. **Manage:** retrieve the booking and check each flight ancillary separately. ## Discover available extras Show travelers what they can add to the selected offer. Ancillaries are optional products or requests attached to a travel item. Flights offer a catalog of extra checked bags and seats. Car rental rates can offer extras paid at checkout or at the rental desk. Hotels handle options through the selected rate and special requests. ### Retrieve the available extras Add the travel item and travelers to a trip, then let the item finish pricing. Use the same endpoint to retrieve every purchasable ancillary available for the items in the trip: ```http theme={null} GET /v1/trip/{trip_id}/ancillaries ``` The response groups the available ancillaries by trip item. A trip that contains a flight and a rental car can return both flight ancillaries and car extras in the same response. The endpoint can take a few seconds to price the items. A `202` response means pricing is still running; call the same endpoint again after `retry_after_seconds`. A `200` response returns the catalogs in `items[].available_ancillaries`; seats can still be loading. Check each seat offer's `seat_map_status` and read again while it is `pending`. ### Show the available options Each offer carries a lowercase `type`, such as `bag` or `seat`. The set is open: new types can appear, so handle a type you do not recognize by showing its `display_label`. Car rental extras use provider-defined types. Hotel special requests are not purchasable ancillaries. They remain in `special_requests` on the hotel item and are not returned as ancillary offers. **Example questions** 1. "What extras can I add to this flight?" 2. "Can I add a second checked bag?" 3. "Which extras are available with this rental?" ## Seats Choose a seat for each traveler and flight segment, then follow its booking outcome. See [Seats](/concepts/ancillaries/seats) for the seat map, availability, selection, charges, and refunds. ## Bags Check the fare's included baggage allowance before adding extra bags. See [Bags](/concepts/ancillaries/bags) for selection and booking outcomes. ## Car rental extras Show which extras the traveler can add and when they will pay for them. Car rental extras use the same available and selected ancillary lists, but their types are provider-defined rather than limited to the eleven flight categories. Each extra can include a label, quantity, unit price, and payment timing. | `paid_at` | Meaning | | - | - | | `now` | Jinko collects the extra at checkout and includes it in the item price. | | `local` | The rental company collects the extra at the desk. It is not included in the Jinko charge. | This illustrative extra is paid at the rental desk. Use the returned `offer_id` when selecting it. ```json theme={null} { "offer_id": "anc_70b5ea55948e40e6", "type": "other", "display_label": "Infant Seat", "price_per_unit_money": { "value": 4712, "currency": "USD", "decimal_places": 2, "display": "USD 47.12" }, "per_pax": false, "max_quantity": 3, "paid_at": "local" } ``` The rental offer also carries its included coverages, optional insurance lines, mandatory fees, amount due at the desk, and security deposit. These are part of the rate breakdown and should not be presented as selected extras unless the supplier returns them in `available_ancillaries`. **Example questions** 1. "Add an infant seat to this rental." 2. "Do I pay for the extra now or at the rental desk?" 3. "Is the security deposit part of the price?" ## Hotel options and requests Help travelers choose the right rate and send their requests before checkout. Hotels do not currently return a separate catalog of purchasable ancillaries. The selected hotel rate already defines the room, meal plan, taxes, fees, and cancellation terms. Free-text special requests can be added to the hotel item before checkout. Common examples include a late arrival, quiet room, high floor, baby cot, or non-smoking room. For example, include `add_item.special_requests` when adding the hotel to a trip with `POST /v1/trip`. Use the returned hotel token: ```json theme={null} { "trip_id": "12345", "add_item": { "trip_item_token": "", "special_requests": [ "Expected arrival around 11:30 PM", "Quiet room on a high floor, if available", "Baby cot requested" ] } } ``` Special requests are sent to the property, but they are not guaranteed. A confirmed booking does not mean the hotel accepted them. **Example questions** 1. "Does this rate include breakfast and taxes?" 2. "Ask for a quiet room on a high floor." 3. "Has the hotel confirmed my request for a baby cot?" ## Select extras and check out Keep the traveler's full selection together before collecting payment. ### Keep every selected extra Select available extras through the [API](/api/select-ancillaries), Builder MCP `trip` with `select_ancillaries`, or [CLI](/cli/select-ancillaries). Pass each returned `offer_id` exactly as received, with the traveler and quantity where applicable. Selecting ancillaries replaces the previous selection for that item. Send every ancillary that should remain selected. The `select_ancillaries` response includes `total_with_ancillaries`, the item total after selected ancillaries are added. Read its `value` in minor units or show its `display`. ### Checkout and payment Review the extras, payment timing, and total with the traveler. After choosing or changing extras, create checkout again and use the latest checkout link or agent payment parameters. See [Trips and checkout](/guides/trips-and-checkout) for the payment flow. **Example questions** 1. "Add one checked bag and keep the seats I chose." 2. "What is the total with these extras?" 3. "Confirm what I pay now and what is due at the rental desk." ## Manage after booking Check each flight ancillary before telling the traveler it is confirmed. After booking, Jinko can return each selected flight ancillary's outcome in `booked_ancillaries`, including seats and bags. Read its `status` (`confirmed`, `pending`, or `failed`) and any `failure_reason`. A confirmed flight does not by itself confirm every extra. For seat confirmation, charges, and refunds, follow the [Seats guide](/concepts/ancillaries/seats#manage-after-booking). **Example questions** 1. "Are my seats and bags confirmed?" 2. "Why is this extra still pending?" 3. "Was my paid seat refunded?" ## Ancillary reference Use these fields to display available extras, keep selections, and report booking outcomes. ### The ancillary model | Object | What it represents | | - | - | | `available_ancillaries[]` | The add-ons available for a flight or rental car item. | | Available ancillary | One add-on you can select: its `type`, label, unit price, and, for a seat, its seat map. | | `SelectedAncillary` | An add-on selected for a traveler or for the booking. | | `BookedAncillary` | The confirmed, pending, or failed outcome of a booked flight ancillary, such as a seat or bag. | | `total_with_ancillaries` | The item total after selected ancillaries are added, on the `select_ancillaries` response. | ### The available ancillary | Field | Type | What it means | | - | - | - | | `offer_id` | string | The opaque identifier used to select the ancillary. Pass it back exactly as received. | | `type` | string | The ancillary family, such as `bag` or `seat`. | | `display_label` | string | The label cleaned for display. Show this one. | | `description` | string | A longer description of the add-on, when returned. | | `price_per_unit_money` | MoneyValue | The unit price in minor units. Absent on a seat offer, which prices each seat in `seat_map`, and on a free add-on. | | `per_pax` | boolean | `true` when the price is charged per traveler rather than once per booking. | | `max_quantity` | integer | The maximum number of units that can be selected, when returned. | | `scope` | string | `PER_PAX_PER_SEGMENT` means the offer applies per traveler and flight segment; returned for seats. | | `segment_ref_ids` | string\[] | The segments the offer covers, when returned. For a seat, pass its one segment back in the selection. | | `seat_map_status` | enum | Seat availability: `pending` while loading, `ready` when listed. | | `seat_map` | object | Seat offers only: the numbered seats for that segment, each with `seat_number`, `available`, `characteristics`, and, for a paid seat, `price_money`. | | `paid_at` | enum | Car extras only: whether the traveler pays `now` or `local` at the rental desk. | This illustrative item excerpt includes a bag and a seat from `items[].available_ancillaries`. Use the identifiers returned for your trip when selecting extras. ```json theme={null} { "available_ancillaries": [ { "offer_id": "anc_bag_23", "type": "bag", "display_label": "1 checked bag 23kg", "price_per_unit_money": { "value": 4500, "currency": "EUR", "decimal_places": 2, "display": "EUR 45.00" }, "per_pax": true, "max_quantity": 3 }, { "offer_id": "anc_seat_seg1", "type": "seat", "display_label": "Seat selection", "per_pax": true, "scope": "PER_PAX_PER_SEGMENT", "segment_ref_ids": ["seg_1"], "seat_map_status": "ready", "seat_map": { "flight_number": "AF1234", "seats": [ { "seat_number": "12A", "available": true, "price_money": { "value": 1500, "currency": "EUR", "decimal_places": 2, "display": "EUR 15.00" }, "characteristics": ["WINDOW"] } ] } } ] } ``` ### The `SelectedAncillary` object | Field | What it means | | - | - | | `offer_id` | The selected ancillary offer. | | `traveler_ref` | The traveler it applies to; absent on a booking-level ancillary. | | `quantity` | The selected quantity. | | `type` | The ancillary family, such as `seat` or `bag`. | | `seat_number` | The selected seat, when applicable. | | `segment_ref_ids` | The segments covered by the selection. | | `price_money` | The exact unit price, when returned. | | `status` | `pending`, `confirmed`, or `failed` after booking; absent before. | | `not_charged` | `true` means this seat is not charged to the traveler. | | `failure_reason` | Explains why the ancillary is pending or failed. | ### The `BookedAncillary` object After booking, Jinko can return each selected flight ancillary's outcome in `booked_ancillaries` as a `BookedAncillary`, including seats and bags. | Field | What it means | | - | - | | `type` | The booked ancillary type, such as `seat` or `bag`. Treat the list as open: new types can appear. | | `seat_number` | The assigned seat, when applicable. | | `traveler_ref` | The traveler the ancillary applies to, when returned. | | `segment_ref_ids` | The segments covered by the ancillary, when returned. | | `status` | `confirmed`, `pending`, or `failed`. | | `not_charged` | `true` means this seat is not charged to the traveler. | | `failure_reason` | Explains why the ancillary is pending or failed. | | `price` | The ancillary price in the trip currency; read `value` in minor units with `currency` and `decimal_places`, or show `display`. Omitted for an included or free ancillary. | | `refund` | Refund information when a paid seat is refunded. | ## Related guides 1. [Seats](/concepts/ancillaries/seats) 2. [Bags](/concepts/ancillaries/bags) 3. [Trips and checkout](/guides/trips-and-checkout) 4. [Flight booking](/guides/flight-booking) 5. [Hotel booking](/guides/hotel-booking) 6. [Car rental booking](/guides/car-rental-booking) # Bags Source: https://docs.gojinko.com/concepts/ancillaries/bags Check included baggage, select extra bags, and follow booking outcomes with Jinko. Help travelers check their included baggage before choosing extra bags and paying for their trip. Bags follow the same flow as every ancillary: see [Ancillaries](/concepts/ancillaries#booking-flow). ## Check included baggage Start with what the traveler already gets with the fare. Included baggage belongs to the fare. The fare's `checked_bag_included` indicates whether its price includes at least one checked bag; the same search filter keeps only fares with an included checked bag. Check the fare's allowance for the number of pieces and weight limits before offering extra bags. **Example questions** 1. "Does this fare include a checked bag?" 2. "How many bags can I take, and what is the weight limit?" 3. "Show me fares that include a checked bag." ## Find extra bags Show the traveler the bags available for the selected flight. Read `items[].available_ancillaries` from `GET /v1/trip/{trip_id}/ancillaries` and look for `type: "bag"`. Show the `display_label`, `price_per_unit_money`, and `max_quantity`. See [Ancillaries](/concepts/ancillaries#discover-available-extras) for availability and pricing responses. `per_pax: true` means the bag is priced per traveler; otherwise it is priced once per booking. **Example questions** 1. "What does an extra checked bag cost?" 2. "Is that price per traveler or for the whole booking?" 3. "How many extra bags can I add?" ## Select bags Add the quantity the traveler needs without losing other selected extras. ### Traveler and quantity Select a bag through `POST /v1/select_ancillaries` using its `offer_id` and `quantity`, with `traveler_ref` for a per-traveler offer. When `max_quantity` is returned, keep the quantity within that limit. Copy `traveler_ref` from the trip response. See the [selection API reference](/api/select-ancillaries) for the request fields. ### Keep existing extras Selected bags appear in `selected_ancillaries`. Each call replaces the item's previous selection, so send every bag, seat, and other ancillary that should remain selected. **Example questions** 1. "Add one extra checked bag for me." 2. "Keep our seats and add a bag for my partner." ## Check out Review the bags and total with the traveler before payment. After choosing or changing bags, create checkout with the current selections and use the latest checkout link or agent payment parameters. See [Trips and checkout](/guides/trips-and-checkout) for the payment flow. **Example questions** 1. "What is the total with the extra bags?" 2. "Does this payment include the bag I just added?" ## Manage after booking Check each bag's outcome before telling the traveler it is confirmed. After booking, bags appear alongside seats in `booked_ancillaries`. Read each bag's `status` (`confirmed`, `pending`, or `failed`) and any `failure_reason`; a confirmed flight does not by itself confirm the bag. **Example questions** 1. "Is my extra checked bag confirmed?" 2. "My flight is confirmed. Why is my bag still pending?" 3. "Why could my extra bag not be booked?" ## Related guides 1. [Flight booking](/guides/flight-booking) 2. [Seats](/concepts/ancillaries/seats) 3. [Ancillaries](/concepts/ancillaries) 4. [Trips and checkout](/guides/trips-and-checkout) # Seats Source: https://docs.gojinko.com/concepts/ancillaries/seats Find, choose, and manage flight seats with Jinko. Help travelers choose where they sit and follow their seat confirmation, charges, and refunds. Seats follow the same flow as every ancillary: see [Ancillaries](/concepts/ancillaries#booking-flow). ## Find available seats Show travelers the seats available for their flight before payment. Seat offers contain a numbered `seat_map` for one flight segment. Each seat lists its availability and characteristics, with `price_money` for a paid seat. Availability depends on the flight, and the traveler can book without selecting seats. ### Open the seat map Read `GET /v1/trip/{trip_id}` after adding the flight and travelers. When a seat map is available and the trip can still be changed, the response includes `seat_map_url`. Open that link to let the traveler pick seats on a seat map. No API key is needed to use the page. The link expires. Read the trip again for a fresh link. Builder MCP `get_trip` / `trip` and the CLI command `jinko trip-status` show the same link. ### Wait for availability A seat offer in `items[].available_ancillaries[]` carries `seat_map_status` beside `seat_map`: | Status | What to do | | - | - | | `pending` | Seats are still loading. Read the trip again shortly. If it stays pending, continue booking without seats. | | `ready` | Seats are listed and can be selected. | **Example questions** 1. "Can I choose my seats before paying?" 2. "Are seats available on both flights?" 3. "Can I book without choosing a seat?" ## Choose seats Help each traveler choose an available seat for each flight segment. ### Seat map page Open the Jinko seat map page using `seat_map_url` so the traveler can choose seats before payment. Paid seats are priced in the trip currency. Free seats have no price. ### Integration selection Select seats through the [API](/api/select-ancillaries), Builder MCP `trip` with `select_ancillaries`, or [CLI `jinko select-ancillaries`](/cli/select-ancillaries). To select a seat, send the seat offer's `offer_id`, its one `segment_ref_ids` entry, a `seat_number` whose `available` is `true`, and the traveler's `traveler_ref` from the trip response. For example, a selection can identify traveler `pax_1`, segment `["seg_1"]`, and seat `12A`. Choose one seat per traveler per segment. Send every ancillary that should remain selected: `select_ancillaries` replaces the item's previous selections. This illustrative trip response shows selected fields. The paid seat costs EUR 15.00; free seats omit the price. ```json theme={null} { "seat_map_url": "https://app.gojinko.com/checkout/seats?t=example-token", "items": [ { "available_ancillaries": [ { "offer_id": "anc_3f9a1c27e4b8d051", "type": "seat", "scope": "PER_PAX_PER_SEGMENT", "segment_ref_ids": ["seg_1"], "seat_map_status": "ready", "seat_map": { "flight_number": "UA57", "seats": [ { "seat_number": "12A", "available": true, "characteristics": ["WINDOW"], "price_money": { "value": 1500, "currency": "EUR", "decimal_places": 2, "display": "EUR 15.00" } } ] } } ] } ] } ``` **Example questions** 1. "Can we sit together, with one window seat?" 2. "Which seats have extra legroom?" 3. "Change my seat and keep the checked bag I selected." ## Check out Include the traveler's current seats in the payment flow. Review the seat choices and prices before creating checkout. See [Trips and checkout](/guides/trips-and-checkout) for the payment flow. > [!WARNING] > > After choosing or changing seats, check out again. Pay with the **latest checkout link or agent payment parameters**, so payment includes the current selections. **Example questions** 1. "How much do these seats add to my trip?" 2. "Does this payment include the seats I just chose?" ## Manage after booking Track each seat separately from the flight confirmation. Read `booked_ancillaries` for each seat's `status`, assigned `seat_number`, and any `failure_reason`. Flight confirmation does not guarantee that every selected seat is confirmed. ### Confirmation and charges Jinko sends the [`booking.completed` event](/guides/webhooks#choose-events) and booking confirmation email once the flight is ticketed, even if a seat is still pending. Check each seat's outcome in `booked_ancillaries`. `not_charged: true` means this seat is not charged to the traveler. `failure_reason` explains why the seat is pending or failed. If a failed seat had already been charged, it is refunded. **Example questions** 1. "My flight is confirmed. Is my seat confirmed too?" 2. "Why could the airline not confirm my seat?" 3. "What does this seat's status mean?" ### Cancel and refund If a booking with a charged seat is canceled, the seat is refunded once the airline refunds Jinko. Until then, its `refund.status` reads `pending_airline_refund`. Show that refund as pending, rather than already returned. **Example questions** 1. "Was my paid seat refunded too?" 2. "Is my seat refund still waiting for the airline?" ## Related guides 1. [Flight booking](/guides/flight-booking) 2. [Bags](/concepts/ancillaries/bags) 3. [Ancillaries](/concepts/ancillaries) 4. [Trips and checkout](/guides/trips-and-checkout) 5. [Flight refunds and cancellations](/tools/flight-refund) # Errors & troubleshooting Source: https://docs.gojinko.com/concepts/errors The closed error-code enum, the failure envelope, and the remedy for every code the platform can send. Request failures use the envelope below; branch on `error.code`. Typed payment submissions also return known payment outcomes, including declines, through `PaymentAttemptOutcome`; see [Payment outcome codes](#payment-outcome-codes). ```json theme={null} { "error": { "code": "TRIP_EXPIRED", "message": "This trip lapsed on 2027-09-03T09:12:44Z and no longer accepts changes.", "doc_url": "https://docs.gojinko.com/concepts/errors" }, "status": "expired" } ``` The `error` object always carries `code` and `message`; `doc_url` is optional. Some codes include additional machine-readable data, at the locations listed in the reference table. Most extra keys sit at the top level, as siblings of `error`: above, `status` describes the state that refused the operation. **`HOTEL_NAME_LOW_CONFIDENCE` and `DESTINATION_LOW_CONFIDENCE` carry their recovery data inside `error`**, at `error.top_candidates` and, when available, `error.suggested_retry`. Read those nested fields to choose or confirm a candidate before retrying. Continue branching on `error.code`, and tolerate additional fields at either level. > [!NOTE] > > **`error.code` is a closed enum.** The reference table below is the complete set of `error.code` values: the platform sends no `error.code` that is missing from it, and every code on it has a producer. It is published as the `code` enum on `ErrorResponse` in the [OpenAPI document](/api-reference/introduction), and this page is kept in step with that enum. Some refusals also carry a sibling `code` beside `error.code` with a finer reason; those values are listed under [Sibling codes](#sibling-codes). > > New codes are added in a minor version and never change meaning. See [Versioning & deprecation](/concepts/versioning) for what that entitles you to. The SDK converts every one of these to `ApiError` with `statusCode`, see [SDK error handling](/connect/sdk#error-handling). ## Error code reference | Code | Status | Extra keys (location) | What it means, and what to do | | - | - | - | - | | `AUTH_REQUIRED` | 401 | | The key is missing, malformed, expired, or not valid for this environment. Send a valid key in the header for the surface you are calling: `X-API-Key` on REST, `Authorization: Bearer` on MCP. See [Which header to send](/authentication/api-keys#which-header-to-send). A sandbox key does not work against production. | | `PAYMENT_REQUIRED` | 402 | | Your organization's balance cannot cover this call. [Top up](https://dashboard.gojinko.com/developers/billing/topup); retrying never fills an empty wallet, and the key itself is fine. Set up [Auto top-up](/guides/auto-top-up) to replenish credit automatically. | | `RATE_LIMITED` | 429 | | A rate limit or quota was exceeded. Back off and retry the same request, honouring `Retry-After` when present. See [Limits & credits](/concepts/rate-limits). | | `BAD_REQUEST` | 400, 422 | | The request was malformed or failed validation. Fix it as `message` describes; retrying it unchanged cannot succeed. | | `HOTEL_NAME_LOW_CONFIDENCE` | 422 | Inside `error`: `top_candidates`, `suggested_retry` | No exact hotel-name match and no clear best candidate. Read `error.top_candidates`; retry with a matching `hotel_id`, or ask the user to choose. | | `DESTINATION_LOW_CONFIDENCE` | 422 | Inside `error`: `top_candidates`, `suggested_retry` | No exact catalog city and no clear best candidate. Confirm the city, then retry with `error.suggested_retry.destination` when available. | | `FORBIDDEN` | 403 | | The credential is valid, and this request is refused anyway: the key lacks the scope or role this route needs. Do not rotate the key, it is working. Check its scopes in the dashboard, and check you are calling the environment it belongs to. | | `NOT_FOUND` | 404 | | No resource with that identifier is visible to this caller. Check the identifier and use a credential authorized for the booking's owner or tenant. On guest lookups, "not found" is deliberately indistinguishable from "wrong last name". See [booking lookup and hotel cancellation](#booking-lookup-and-hotel-cancellation). | | `CONFLICT` | 409 | | The resource's current state refuses the operation, for a reason with no more specific code. Re-read the resource and act on what it says, never retry blindly. | | `GONE` | 410 | | The resource this request names existed and no longer does. Re-acquire it — search again, or check out again to re-quote — then retry with the new identifier. Repeating this request with the same one cannot succeed. | | `QUOTE_EXPIRED` | 410 | `expires_at`, `quote_id`, `reason`; on a typed payment also `payment_error`, `recovery` | The quote can no longer be paid: it passed its `expires_at`, or the trip's travelers changed after it was priced (`reason: travelers_changed`), or it could not price every item of the trip (`reason: partial_quote`), or an item was added to the trip or removed from it after it was priced (`reason: items_changed`). Payment was refused before any payment object was created. For `partial_quote`, first remove or replace the items with `quote_status: failed`, unless their `failure_reason` is `provider_error` (see [When an item cannot be priced](/guides/trips-and-checkout#when-an-item-cannot-be-priced)). Call `POST /v1/checkout` again on the same trip, which re-quotes, then mint a new payment token against the new `agent_spt_params` and submit it against the new `quote_id`. For `items_changed`, the new quote prices the items the trip holds now: get the traveler's approval of the new total before paying. Nothing was charged. [Detail below](#after-a-quote-expires). | | `QUOTE_PENDING` | 503 | `retry_after_seconds`, `quote_id` | The trip's quote is still being priced. Checkout waits about 55 seconds for it, then answers this instead of holding the request. Call `POST /v1/checkout` again after the interval in `Retry-After`: the call picks up the same quote and answers with the checkout once it is priced. | | `TRIP_EXPIRED` | 409 | `status` | The trip lapsed (24 hours with no activity) and no longer accepts writes. Start a new trip and add the items again; a lapsed trip cannot be revived. [Detail below](#a-trip-that-refuses-to-change). | | `TRIP_STATE_CONFLICT` | 409 | `status` | The trip is in a state that refuses this operation: payment already started (`fulfilling`, `fulfilled`, `partially_fulfilled`), or it is `cancelled` or `failed`. Read `status` and act on it. Nothing was written. [Detail below](#a-trip-that-refuses-to-change). | | `OFFER_EXPIRED` | 410 | | The search offer is no longer usable: its token expired, or the supplier rejected it as expired or missing during pricing. No payable quote was established. Search again, replace the unavailable item using the latest search result, and check out promptly. Show that the flight offer is no longer available; do not describe this as an established quote expiring (`QUOTE_EXPIRED`). | | `OFFER_UNAVAILABLE` | 409 | | The provider can no longer quote this offer. Emitted today when the hotel supplier has no rate for your occupancy at quote time. Search again for the occupancy you intend to book and pick a rate that covers it; this one cannot be quoted at any price. | | `MISSING_CUSTOMER_DETAILS` | 422 | `missing_fields`, `missing_by_domain` | The trip has no travelers, or no contact carrying both an email and a phone, or a traveler lacks a passenger document the carrier requires (see `required_attributes` in [Required traveler attributes](/concepts/required-attributes)). Send `upsert_travelers` with the travelers, a contact and the fields named in `missing_fields`, then check out again. | | `INVALID_PHONE_NUMBER` | 422 | | A phone number is not in international format: it has no leading `+` and country code, is not a possible number, or carries an extension. Nothing was written. Resend the number with a leading `+` and country code, for example `+12025550147`. Spaces, hyphens, dots and parentheses are accepted and removed. | | `CURRENCY_UNSUPPORTED` | 400 | | The requested currency is not supported for this operation. Agent SPT payment supports USD and EUR, whichever Stripe account the partner is bound to. | | `INVALID_SEGMENTS_TO_EXCHANGE` | 400 | | An exchange selection is malformed, or does not match a booked leg. For a leg the booking does not have, `message` lists the booked legs: name each leg to change by its first departure and final arrival airport, as `get_booking` lists it, not by a connection airport. | | `PARTIAL_EXCHANGE_UNSUPPORTED` | 400 | | The supplier cannot keep the unselected legs unchanged for this booking. Name every booked leg in `segments_to_exchange` to reshop the whole itinerary. When the supplier refused, `message` is fixed: "This exchange cannot be processed as requested. Change the selected flights or contact Jinko support." | | `LEG_ALREADY_DEPARTED` | 400 | | A leg named in `segments_to_exchange` has already departed, and a departed leg cannot be changed. `message` lists the booked legs. Keep it out of `segments_to_exchange`; a departed leg that is not named stays as booked. | | `DEPARTURE_DATE_IN_PAST` | 400 | | A new departure date is before today at the leg's departure airport. `message` lists the booked legs. Choose a date from today on. | | `LEG_DATES_OUT_OF_ORDER` | 400 | | The new dates would put the legs out of order: a changed leg would leave before the previous leg arrives, or after the next leg leaves. `message` lists the booked legs; change the dates, or change the other leg too. | | `INVALID_EXCHANGE_REQUEST` | 400 | | The supplier refused the exchange request itself. `message` is fixed: "This exchange cannot be processed as requested. Change the selected flights or contact Jinko support." Change the selected flights, or contact Jinko support; repeating the request unchanged cannot succeed. | | `NOT_EXCHANGEABLE` | 409 | | The booking cannot be exchanged as it stands: no ticket or flight is left to change, or the fare does not permit the change. `message` is fixed: "This booking cannot be exchanged online. Contact Jinko support." Retrying cannot succeed. On `exchange_shop` it is `error.code`; on `exchange_price` and `exchange_commit` the refusal is `error.code: "CONFLICT"` with the sibling `code: "not_exchangeable"`. | | `CREDENTIAL_FORMAT_INVALID` | 400 | `payment_error`, `recovery` | The typed payment body or `Idempotency-Key` has an invalid format, or the key is missing. Correct the named field and resubmit with a valid `Idempotency-Key`. | | `PAYMENT_TYPE_NOT_ENABLED` | 403 | `payment_error`, `recovery` | This payment type is not enabled for the caller. Choose a type listed in `accepted_payment_types`, or contact support. | | `PAYMENT_CREDENTIAL_INVALID` | 400 | `payment_error`, `recovery` | The payment credential is invalid. Follow `recovery.action` and supply a replacement credential when it asks for one. | | `TRIP_OWNED_BY_OTHER_PAYMENT` | 409 | `payment_error`, `recovery` | Another payment attempt owns this trip. Read the existing attempt and follow its recovery action before paying again. | | `IDEMPOTENCY_KEY_REUSED` | 409 | `payment_error`, `recovery` | The `Idempotency-Key` was already used for a different submission. Resend the original request with this key, or use a new key for a new submission. | | `ATTEMPT_IN_PROGRESS` | 409 | `payment_error`, `recovery` | A payment attempt is already in progress. Poll it and follow `recovery.action`. | | `ATTEMPT_TERMINAL` | 409 | `payment_error`, `recovery` | This payment attempt has reached a terminal state. Read its outcome and follow `recovery.action` before starting another attempt. | | `TEMPORARILY_UNAVAILABLE` | 503 | `payment_error`, `recovery`, when present | Payment submission is temporarily unavailable. Send the same request again with the same `Idempotency-Key`, after `Retry-After` when present. The answer can come with no `Retry-After`, no `payment_error` and no `recovery`; wait a few seconds, then send it again. | | `UPSTREAM_REJECTED` | 502 | | A travel supplier read the request and declined it. Try another offer, or change the request; repeating it unchanged cannot succeed. | | `UPSTREAM_UNAVAILABLE` | 503 | | No supplier can serve the request right now, for a reason that is not your request. Retry unchanged after the interval in `Retry-After`. | | `UPSTREAM_TIMEOUT` | 504 | | A travel provider, or the platform behind this API, did not answer in time; the API stops waiting after 58 seconds rather than hold the request. Retry a read unchanged. Before repeating a request that changes something, read the resource's state: the operation may still have completed. | | `UPSTREAM_ERROR` | 502 | | An upstream call failed for a technical reason, with no verdict that the request itself was invalid: a technical pricing failure, an unreadable body, or a status we do not map. Retry once. If checkout pricing still fails, choose another flight or contact support; for any other repeated failure, contact support. | | `INTERNAL` | 500 | | The platform failed. Retry; if it persists, [report it](#reporting-issues) with the request id. | > [!WARNING] > > **Retryable and non-retryable failures share status codes, so branch on the code.** A 409 `OFFER_UNAVAILABLE` requires a different offer, while a 409 `TRIP_STATE_CONFLICT` means payment already started on the trip, or it was cancelled or failed. Handle each cause before retrying. An SPT currency refusal (`CURRENCY_UNSUPPORTED`) means the trip is quoted in a currency other than USD or EUR. Pay through hosted checkout with the `checkout_url` from your earlier `checkout` response, or search again in USD or EUR. ### Messages on supplier failures These codes always carry the same message, and it never includes text from a supplier; `details` carries none either. A 503 stays 503 `UPSTREAM_UNAVAILABLE` (with `Retry-After`) and a 504 stays 504 `UPSTREAM_TIMEOUT`; neither is folded into a 502. Branch on `error.code`, not on the message. | Code | Status | `error.message` | | - | - | - | | `UPSTREAM_REJECTED` | 502 | The request was declined for this offer. Try another offer. | | `UPSTREAM_UNAVAILABLE` | 503 | The service is temporarily unavailable. Retry after the Retry-After delay. | | `UPSTREAM_TIMEOUT` | 504 | The request timed out before a result was available. Retry the request. | | `UPSTREAM_ERROR` | 502 | The request could not be completed. | | `RATE_LIMITED` | 429 | Too many requests. Retry after the Retry-After delay. | | `OFFER_UNAVAILABLE` | 409 | This offer is no longer available. Search again. | | `OFFER_EXPIRED` | 410 | This offer has expired. Search again. | A supplier's refusal of a request that Jinko itself accepted keeps its status and code, with a fixed message instead of the supplier's words: | When | Status | `message` | | - | - | - | | A supplier refused the request's inputs (search, pricing, booking, hotel search) | 400 | The request was declined for these inputs. Check the dates, places and travellers, then retry. | | A car rental operation was refused | 422 | The rental request was declined. Try another vehicle, location or time. | | `INVALID_EXCHANGE_REQUEST`, or `PARTIAL_EXCHANGE_UNSUPPORTED` when the supplier refused | 400 | This exchange cannot be processed as requested. Change the selected flights or contact Jinko support. | | `NOT_EXCHANGEABLE`, or the sibling `code: "not_exchangeable"` | 409 | This booking cannot be exchanged online. Contact Jinko support. | | `not_cancellable` (the sibling `code` on a refund or cancellation refusal) | 409 | This booking cannot be cancelled online. Contact Jinko support. | | A successful servicing answer whose reason field would otherwise hold the supplier's words, such as `manual_reason` | 200 | This request needs manual handling by Jinko support. | A message Jinko writes from its own checks, such as a missing field or a leg selection that does not match the booking, keeps its own text. ### Payment outcome codes Typed payment submissions report payment outcomes in `payment_error.code` (or `null` when there is no payment error), with exactly one `recovery.action`. These codes are uppercase and share their names with `error.code`: a refusal before the attempt is accepted carries the same code in both. A 200 can contain a decline; a 202 means pending. Follow the returned recovery action, not the HTTP status alone. The legacy flat SPT body does not use them. See [Card payments](/guides/partner-card-payments) for card discovery, submission, authentication and the card failure table, and [Payment outcomes and retries](/guides/payment-outcomes) for polling and recovery actions. * `CREDENTIAL_FORMAT_INVALID`: 400; fix the request and replay the same key if that key was valid (a rejected `Idempotency-Key` needs a valid key instead). * `PAYMENT_TYPE_NOT_ENABLED`: 403; stop. * `PAYMENT_CREDENTIAL_INVALID`: credential unusable; correct before acceptance, replacement + new key after cleanup. * `TRIP_OWNED_BY_OTHER_PAYMENT`: 409; stop. * `IDEMPOTENCY_KEY_REUSED`: 409; stop, read the original attempt. * `ATTEMPT_IN_PROGRESS`: poll; competing attempts get 409. * `CARD_ALIAS_EXPIRED`: an accepted card attempt whose submitted card details can no longer be used; not a refusal. Follow `recovery.action`: `retry_new_key` (submit the card again with a new key), `poll` while it reads `cancelling`, or `recheckout` once the quote expired. * `CARD_DECLINED`: the card was declined; follow `recovery.action`. * `PAYMENT_CREDENTIAL_REJECTED`: SPT or other non-card rejection; replacement + new key on a valid quote once quiescent. * `AUTHENTICATION_REQUIRED`: SPT: send the traveler to `authentication.url` with `#hv=` and the token's `next_action.use_stripe_sdk.value` appended ([Shared Payment Token](/guides/shared-payment-token#customer-authentication)); Jinko-collected customer card: follow `authentication.url`; Jinko-collected VCC: no handoff, replace the credential once allowed. * `AUTHENTICATION_FAILED`: poll cleanup, then replacement or recheckout. * `AUTHENTICATION_ABANDONED`: poll, then recheckout. * `QUOTE_EXPIRED`: 410 before acceptance; recheckout. * `ATTEMPT_TERMINAL`: 409 before acceptance (`recovery.action: stop`). After acceptance it arrives in the normal payment outcome: follow `recovery.action` (`poll` during cleanup, then `retry_new_key` on a valid quote or `recheckout` if it expired). * `PAYMENT_OUTCOME_UNKNOWN`: poll until `recovery.action` changes; a new key only when it returns `retry_new_key`, or `recheckout` if the quote expired. * `FULFILLMENT_DISPATCH_DELAYED`: poll; no second payment. * `RECONCILIATION_REQUIRED`: contact support. * `TEMPORARILY_UNAVAILABLE`: 503 before acceptance: send the same request again with the same key, even when the answer carries no `recovery`; after: poll. ### Sibling codes A few refusals answer with a general `error.code` and put the finer reason in a sibling `code` field beside `error`. Branch on `error.code` first, then on `code`: | Where | `error.code` | Sibling `code` values | | - | - | - | | Refund and cancellation preview or commit (flight, hotel, rental car) | `CONFLICT` | `quote_drift`, `QUOTE_EXPIRED`, `active_operation_exists`, `not_cancellable`, `funds_unavailable`; flight and hotel also `superseded`; flight and rental car also `manual_required`; flight also `penalty_exceeds_sell`, `multi_currency_basis` | | `exchange_price`, `exchange_commit` | `CONFLICT` | `not_exchangeable`, `funds_unavailable`, `multi_currency_basis`, `manual_required`; `exchange_commit` also `exchange_in_progress` | | Webhook delivery replay | `CONFLICT` | `delivery_in_progress`, `payload_purged` | Sibling codes keep the spelling shown here, mostly lowercase; only `QUOTE_EXPIRED` is uppercase, because it is also an `error.code`. Compare them exactly as listed. On a `quote_drift` refusal whose quote is still valid, `retry_quote_id` names the quote to commit again. ## Booking lookup and hotel cancellation [Get Booking](/tools/get-booking) and [Hotel Cancel](/tools/hotel-cancel) support two ways to identify a booking: * **Guest verification:** provide `booking_ref` and `last_name` together. * **Authenticated owner:** provide `booking_ref` with a credential authorized for that booking. `last_name` is optional in this mode; omitting it does not bypass the ownership check. A tenant key needs the `post_booking` scope and access to the booking's tenant. For hotel cancellation, select the item's `booked_item_id` from `get_booking` and use it throughout preview, commit and status. It may be omitted only when the booking has exactly one hotel item. The public REST API distinguishes invalid input from a booking the caller cannot access: | Request | Result | | - | - | | `last_name` without a booking reference or another supported identifier | `BAD_REQUEST` (400 or 422): the request is incomplete. | | Well-formed `booking_ref` without `last_name`, with an authorized credential, but no matching accessible booking | `NOT_FOUND` (404): reference-only lookup is valid authenticated input. | | `booking_ref` and `last_name`, but the reference does not exist or the name does not match | `NOT_FOUND` (404): both cases deliberately have the same refusal. | The authenticated not-found rule also applies to hotel cancellation preview and the legacy one-shot cancellation. A refused preview returns no quote handle. Builder MCP reports an unknown or inaccessible booking as `structuredContent.status: "not_found"`; its error envelope differs from the REST envelope above. Do not retry a 404 with guessed surnames or identifiers. Confirm the booking reference and the caller's access. Do not treat a missing `last_name` alone as a validation failure for an authenticated owner. ## Duplicate operations are not an error Trip edits and checkout handle repeats as follows: * **Creating a trip is never idempotent.** Two calls to `POST /v1/trip` with no `trip_id` make two trips. That is the contract, not a race you lost. Hold the `trip_id` from the first response. * **`add_item` and `upsert_travelers` are idempotent by identity.** Adding the same offer twice leaves one item; upserting travelers twice leaves one set. You get a 200 and the current state, not a conflict. * **Calling `checkout` twice is not an error either.** A repeat call on the same trip returns 200 with the same `session_id` and `checkout_url` while the quote is still valid. For trip creation, read the trip you already have before retrying. For typed payment submission, the first accepted request wins: replay it with the same idempotency key. Changing a compared safe field (trip, quote, payment type, card kind, amount, currency) with the same key returns 409 `IDEMPOTENCY_KEY_REUSED`; changing only the payment credential (the token or the card details) replays the first accepted attempt (send a new key for a new credential). Follow the payment outcome recovery action before attempting another payment. ## The price moved: what happens This is the single most commonly misunderstood behaviour in the API, so read it before you write your checkout path. **By default, `checkout` proceeds at the new price.** It does not fail, and there is no tolerance threshold. Live pricing is a moment in time, and by the time the customer reaches checkout the airline or hotel may quote something different. Jinko takes the provider's current price and tells you it changed. Two fields on the affected `items[]` entry carry the signal: | Field | Meaning | | - | - | | `price_changed` | `true` when this item's price moved since it was quoted. Absent otherwise. | | `original_price_money` | What it used to cost. `price_money` holds the new, live figure. | ```json theme={null} { "item_id": "prod_f5pyznimu4", "kind": "flight", "price_money": { "value": 21420, "currency": "USD", "decimal_places": 2, "display": "USD 214.20" }, "original_price_money": { "value": 18865, "currency": "USD", "decimal_places": 2, "display": "USD 188.65" }, "price_changed": true, "price_change": { "original_money": { "value": 18865, "currency": "USD", "decimal_places": 2, "display": "USD 188.65" }, "current_money": { "value": 21420, "currency": "USD", "decimal_places": 2, "display": "USD 214.20" }, "delta_money": { "value": 2555, "currency": "USD", "decimal_places": 2, "display": "USD 25.55" } } } ``` **Check `price_changed` on every checkout response.** If you ignore it, you will charge a customer a price they never agreed to. Checkout returns the current price with `price_changed: true` and `price_change` (`original_money`, `current_money`, and `delta_money`, whose `value` is signed) on each affected item. The deprecated `price`, `original_price` and `price_change.original` / `.current` / `.delta` carry the same figures in major units. Ask the customer to accept the updated price before taking payment. The former `fail_on_price_change` option is no longer supported. ## When a search offer cannot be priced `POST /v1/trip` creates or edits the trip; it does not start pricing. `POST /v1/checkout` (`/v1/book` is deprecated) starts pricing and waits for success or failure. A supplier can reject the offer during this step even when Jinko still holds its token. That returns `410 OFFER_EXPIRED` before any valid quote exists. Display “This flight offer is no longer available; please search again.” `GET /v1/trip/{id}` can then show `quote.status: "failed"`. A failed quote has no payable price, even if an older response also carries `expires_at`. The quote can include `failure_reason` (`"offer_expired"` or `"offer_unavailable"`) and a safe `failure_message`; `expires_at` is absent on failed quotes. Polling the trip does not start or retry pricing. Search again, replace the unavailable item from the latest result, and call checkout. In a trip with several items, when some are priced and others are not, checkout answers 200 with `status: "partial"` instead of an error. The trip cannot be paid until a new checkout prices every item: remove or replace the items with `quote_status: "failed"`, or, after `failure_reason: "provider_error"`, call checkout again on the unchanged trip. See [When an item cannot be priced](/guides/trips-and-checkout#when-an-item-cannot-be-priced). Complete checkout promptly and search again after a delay. Suppliers can withdraw offers before Jinko's token retention ends; there is no universal safe maximum offer age. See [offer freshness](/guides/flight-booking#offer-freshness) for the optional freshness timestamps and how to handle missing values. ## After a quote expires Read the actual payment deadline from `quote.expires_at` on a successfully priced `get_trip` response or `expires_at` on checkout. Do not calculate it from a fixed duration. Past that instant the price is stale, and the platform will not spend your customer's money on it. > [!WARNING] > > **A payment attempted after `expires_at` is refused, not re-priced.** `POST /v1/agent_payment/submit` answers **410 `QUOTE_EXPIRED`** and creates no payment object, so nothing is authorized, nothing is captured, and the trip and its quote are left exactly as they were. ```json theme={null} { "error": { "code": "QUOTE_EXPIRED", "message": "The quote behind this checkout expired at 2027-09-04T12:39:56Z.", "doc_url": "https://docs.gojinko.com/concepts/errors" }, "expires_at": "2027-09-04T12:39:56Z", "quote_id": "2097152" } ``` **The remedy is two calls.** Call `POST /v1/checkout` again on the same trip: an expired quote is never reused, so this re-quotes and returns a fresh `expires_at`, a fresh total, and fresh `agent_spt_params`. Then mint a new payment token against those new params and submit it. Check `price_changed` on the new response before you do, because a re-quote is exactly when a price moves. Two clocks are in play here, and they are not the same clock: | Clock | Lifetime | What runs out | | - | - | - | | `expires_at` on the checkout response | Use the returned deadline | The **quoted price**. The same instant as `quote.expires_at` on `get_trip`. | | The `checkout_url` signed token | 4 hours | The **link**. After that the page does not open at all. | For hosted payment, call checkout again and send the customer the fresh link and updated price. The hosted page cannot re-quote on its own. The link lifetime is not a field you can read, and an openable link does not make an expired quote payable. Offers and trips expire on their own clocks. [Lifetimes and expiry](/concepts/overview#lifetimes-and-expiry) lists every lifetime in one table. > [!NOTE] > > Fulfillment has its own terminal state for this, `expired_quote`, which means the quote ran out after the customer paid but before the booking was placed. That is a different moment from the 410 above, which happens before any money moves. See the [flight booking guide](/guides/flight-booking) for the full fulfillment table. ## A trip that refuses to change A trip accepts writes while it is `draft`. In any other state, `add_item`, `remove_item` and `upsert_travelers` are refused before anything is written, and so is `POST /v1/checkout`. Two codes tell you which kind of refusal you hit, and both carry the trip's `status` beside the envelope: * **`TRIP_EXPIRED`** means the trip lapsed after 24 hours with no activity. `status` is `expired`. It is not recoverable: build a new trip from fresh offers. * **`TRIP_STATE_CONFLICT`** means the trip is past the point of change. `status` names which: `fulfilling`, `fulfilled` or `partially_fulfilled` because payment already started, or `cancelled` / `failed`. ```json theme={null} { "error": { "code": "TRIP_STATE_CONFLICT", "message": "This trip is fulfilled and no longer accepts changes.", "doc_url": "https://docs.gojinko.com/concepts/errors" }, "status": "fulfilled" } ``` The distinction matters because the remedies differ. "You already paid for this" is something you reconcile by reading the trip and finding the booking; a lapsed, cancelled or failed trip means starting a new one. > [!NOTE] > > **Lapsing is lazy: a read applies it, a write does not.** The 24 hours elapsing changes nothing on its own. The lapse is applied on the next **read** of the trip, and `GET /v1/trip/{id}` returns `expired` on that same call rather than one call later. > > Until that read happens the trip still sits at its old status, so **a write to a trip nobody has read since it lapsed may still succeed**. If you are resuming a trip you have not touched in a while, call `GET /v1/trip/{id}` first and reconcile on what it tells you, rather than relying on the next write to refuse you. ## A search with no matches is not an error A live `POST /v1/flight_search` in search mode where no offer matches the filters returns **HTTP 200** with an empty `offers` list. It is a success: there is no `error` envelope. The body carries `result: "no_matches"` and an `instruction` to relay. When the request sent a filter that narrows the results, the instruction asks the user which filter to relax; otherwise it asks whether to try other dates or airports. ```json theme={null} { "offers": [], "result": "no_matches", "instruction": "Search completed successfully, but no offers satisfied every filter sent: the filter combination is too restrictive for this route and dates. Ask the user which filter to relax before searching again." } ``` That instruction is the one sent when the request carried a filter that narrows the results. Every such filter is applied exactly as sent, so `no_matches` then means the filter combination was too restrictive for this route and dates. When the request carried no narrowing filter, `instruction` reads "Search completed successfully, but no flights were found for this route and dates. Ask the user whether to try other dates or airports before searching again." Both outcomes are also sent in the `X-Jinko-Result` and `X-Jinko-Instruction` response headers. They are deprecated: read the body. See [Filters are always applied](/guides/flight-booking#filters-are-always-applied). A search answers `no_matches` whenever at least one airline source answered, even if another could not be searched. When some sources fail and others return offers, the response is a normal 200 with those offers; it does not say which sources failed. A search that could not be completed because every source failed is an error, never an empty list: `UPSTREAM_REJECTED`, `UPSTREAM_ERROR`, `UPSTREAM_UNAVAILABLE` or `UPSTREAM_TIMEOUT`, with the fixed message listed under [Messages on supplier failures](#messages-on-supplier-failures). Follow the remedy for that code; retry a 503 or 504 later with the same filters. A search that set `max_wait_seconds` and found no offer before that wait ended is not an error either. It returns **HTTP 200** with an empty `offers` list, `result: "timed_out"` and an `instruction`: ```json theme={null} { "offers": [], "result": "timed_out", "instruction": "The search stopped at max_wait_seconds before any offer arrived, so it does not show whether flights exist. Search again with a higher max_wait_seconds, or without it to wait for every result." } ``` The search had not finished when it answered, so `timed_out` does not show whether flights exist: do not present it as `no_matches`. Search again with a higher `max_wait_seconds`, or without it. See [A search with a wait limit](/api/flight-search#a-search-with-a-wait-limit). These outcomes apply to live search mode only. The CLI exits with code 0 for `no_matches`, and MCP returns its `status: "empty"`, `reason: "no_matches"` envelope. See [flight_search](/api/flight-search#a-successful-search-with-no-matches). ## Status code reference Statuses are a coarser signal than codes, but this is the shape of the space: | Status | When | What to do | | - | - | - | | 400 | Request shape or values rejected before any business logic | Read `error.message` and fix the request | | 401 | Auth header missing, malformed, or revoked | Verify credentials. If you are on MCP with a CLI OAuth token, see [OAuth](/authentication/oauth) | | 402 | Your organization is out of credit | [Top up](https://dashboard.gojinko.com/developers/billing/topup). Do not retry, and do not rotate the key | | 403 | Authenticated but not allowed (`FORBIDDEN`) | Check the key's scopes in the dashboard. Do not rotate it, the credential is fine | | 404 | Resource does not exist, or credentials do not match it | Verify the identifier | | 409 | State refuses the operation | Branch on `error.code`: several codes in the table above use this status and require different remedies; for typed payments, follow the payment outcome and recovery action | | 410 | The thing you named is gone: an expired quote or a stale offer | Re-quote or re-search, then retry with what you get back | | 422 | The request contradicts itself, or a precondition is unmet | Read `error.message`, it names the offending field | | 429 | Rate limit | Back off, honour `Retry-After`. Email [dev@gojinko.com](mailto:dev@gojinko.com) to raise the ceiling | | 500 | The platform failed | Record the error and any available request ID, then [report it](#reporting-issues) | | 502 | A supplier declined the request (`UPSTREAM_REJECTED`) or an upstream call failed (`UPSTREAM_ERROR`) | Try another offer after a rejection; retry once after an upstream error | | 503 | No supplier can serve the request right now (`UPSTREAM_UNAVAILABLE`), or the quote is still being priced (`QUOTE_PENDING`) | Retry after the `Retry-After` delay | | 504 | A supplier or the platform did not answer in time (`UPSTREAM_TIMEOUT`) | Retry a read; before repeating a write, read the resource's state | ## Reporting issues Responses do not always include `X-Request-ID`. Keep the request ID your client sends, and capture a response request ID when present. Include it, the UTC time, endpoint, HTTP status, and error code in a bug report. ```bash theme={null} curl -i ... | grep -i x-request-id ``` ```typescript theme={null} import { ApiError } from '@gojinko/api-client' try { await client.flightCalendar({ origins: ['JFK'], destinations: ['CDG'], trip_type: 'oneway', departure_dates: ['2027-06-15'], }) } catch (err) { if (err instanceof ApiError) { console.error({ code: err.code, statusCode: err.statusCode, docUrl: err.docUrl, details: err.details }) } } ``` Email: [dev@gojinko.com](mailto:dev@gojinko.com). ## Common gotchas ### "All my prices are 100x too high" A \$159.77 fare rendering as \$15,977. Money fields carry `value` in **minor units**: `{ "value": 15977, "currency": "USD", "decimal_places": 2, "display": "USD 159.77" }`. Divide by `10 ** decimal_places` before displaying, or show `display`. If you still read the deprecated trip and checkout `total_amount` (`{ amount, currency }`), that one is in major units; do not divide it. See [Money & prices](/concepts/money). The mirror symptom, prices 100x too *small*, is usually a hardcoded `/ 100` applied to a zero-decimal currency such as JPY or KRW. ### "My key says Active in the dashboard but every call is failing" If the calls come back 402 `PAYMENT_REQUIRED`, the key is fine and the organization is out of credit. Key status and credit are independent: a key stays active while its organization's balance is empty, because nothing is wrong with the credential. [Top up](https://dashboard.gojinko.com/developers/billing/topup) and the same key resumes immediately. Do not rotate it, and do not retry the 402 in a loop; no number of retries adds credit. See [Limits & credits](/concepts/rate-limits). ### "I get 401 on the MCP endpoint with a token that worked yesterday" If you are using a token saved by the retired CLI OAuth flow, it may fail the MCP issuer check. MCP expects an API key or a token from its own OAuth flow. The CLI now uses API keys: run `jinko auth login --key jnk_t_...`, or set `JINKO_API_KEY`. ### "Trip says 'fulfilled' but I never got a confirmation" If the user's email is correct on the trip's `contact` and `booking_state` is `completed`, check spam. If `booking_state` remains `processing`, the provider has not finished confirming the booking; contact support if it persists. Note that `fulfilling` is a value of the trip's **top-level `status`**, not of `fulfillment.status`. The fields have different vocabularies; read `booking_state` for the booking's progress. [Trip status and booking state](/concepts/overview#trip-status-and-booking-state) explains how they relate. See the [flight booking guide](/guides/flight-booking) for the full fulfillment table. ### "My offer token is rejected as expired" Offer availability has no universal safe maximum age. A supplier can withdraw an offer before its token expires; an unavailable offer can produce 410 `OFFER_EXPIRED` when priced. If the user takes a long time on traveler entry, re-run live pricing (`flight_search` / `hotel_search`) before adding to a trip. # LLM-friendly docs Source: https://docs.gojinko.com/concepts/llms-txt Read Jinko documentation as Markdown, OpenAPI, or through the public documentation MCP. Jinko documentation is available in these formats: * [llms.txt](https://docs.gojinko.com/llms.txt): the canonical documentation index with links to individual pages. * [llms-full.txt](https://docs.gojinko.com/llms-full.txt): documentation content in one text file. * **Individual Markdown pages:** append `.md` to a page URL, for example [introduction.md](https://docs.gojinko.com/introduction.md), or request the page with `Accept: text/markdown`. * **OpenAPI:** the [docs-hosted YAML](https://docs.gojinko.com/api-reference/public-api.yaml) describes the reference published on this site. The [production API’s served contract](https://api.gojinko.com/doc) describes what production serves; the two can differ during a rollout. * **Public documentation MCP:** connect an MCP client to `https://docs.gojinko.com/mcp` to search and retrieve public documentation. This is separate from the [travel MCP](/connect/mcp) used to search and book travel. ```bash theme={null} curl -H 'Accept: text/markdown' https://docs.gojinko.com/introduction ``` # Booking Life Cycle Source: https://docs.gojinko.com/concepts/overview How Jinko moves from search to a confirmed booking. Jinko turns a travel request into a confirmed booking. A **trip** brings the selected products, travelers, and options together until payment and fulfillment. ## The booking flow ```mermaid theme={null} flowchart LR A["Search"] --> B["Build trip"] B --> C["Checkout"] C --> D["Payment"] D --> E["Fulfillment"] classDef step fill:#FFF8ED,stroke:#FF4F00,color:#171717,stroke-width:1.5px; class A,B,C,D,E step; ``` 1. **Search** finds an available flight, hotel, or rental car. 2. **Build trip** brings the selected products, travelers, and ancillaries into one place. 3. **Checkout** verifies the trip and returns the available payment options. 4. **Payment** can be completed by the traveler or programmatically. 5. **Fulfillment** books each item and returns its confirmation. ## The trip A trip holds one travel request. It can contain flights, hotels, rental cars, and their ancillaries. It also holds the traveler and contact information needed to book them. All items in the trip go through one checkout and one payment. You do not need to rebuild the trip between steps. See [Trips and checkout](/guides/trips-and-checkout) for the complete model. ### Trip and quote 1. **Trip** holds the items, travelers, and contact for one request, identified by `trip_id`. 2. **Quote** is the priced snapshot created at checkout, identified by `quote_id`. It has an expiry time, but it is not a price hold. A supplier can still change the price or remove availability. Running checkout again creates a new quote. ## Checkout and payment Checkout verifies the trip, prices it, and returns the information needed to pay. The traveler can complete payment on a hosted page, or an agent can submit an authorized programmatic payment. Your system does not need to collect or store card details. See [Payments](/guides/payments) for the supported payment paths. ## Fulfillment Fulfillment starts after payment. Jinko books each item in the trip and updates its status as confirmations arrive. Some bookings confirm immediately. Others can take longer because they depend on the supplier. Jinko emails the traveler when the booking is confirmed. ## Trip status and booking state A trip has three status fields with different roles: 1. **`status`** shows the lifecycle of the whole trip. 2. **`booking_state`** summarizes the booking after payment starts. It is absent before payment. 3. **`fulfillment.status`** gives the detailed booking status behind `booking_state`. It is also absent before payment. | Trip `status` | Meaning | `booking_state` | | - | - | - | | `draft` | The trip is still being built or priced. | Absent, or `awaiting_payment` once payment starts | | `fulfilling` | Payment was submitted and booking is in progress. | `awaiting_payment` or `processing` | | `fulfilled` | Every item was booked. | `completed` | | `partially_fulfilled` | Some items were booked and others failed. | `partial` | | `failed` | Nothing was booked. | `failed` | | `cancelled` | The trip was replaced during a re-shop. | Absent | | `expired` | The trip expired before booking. | Absent | The booking values of `status` (`fulfilling`, `fulfilled`, `partially_fulfilled`, `failed`) are deprecated in favour of `booking_state` and still sent. `booking_state` can also read `cancelled`, or `needs_review` while a person at Jinko resolves the booking; `needs_review` is not final. `quoting`, `quoted` and `fulfillment_prepared` are reserved and not currently set: quote progress is in `quote.status`. ## Essential identifiers | Identifier | What it identifies | | - | - | | `offer_token` | A cached flight found during exploration. It cannot be added to a trip: price-check it with `flight_search`, which returns a `trip_item_token`. | | `trip_item_token` | A live-priced flight fare, hotel rate, or rental car offer that can be added to a trip. | | `trip_id` | The trip throughout checkout, payment, and fulfillment. | | `item_id` | An item in the trip, before it is booked. | | `quote_id` | The priced quote checkout created. Pass it to pay exactly that quote. | | `booking_ref` | The customer-facing booking reference created after payment starts. Its presence does not mean fulfillment is complete. | | `booked_item_id` | A booked item, for refunds, cancellations, and exchanges. | | `supplier_references` | The supplier confirmations for a booked item: the airline's record locator for each airline, the hotel's confirmation number, or the rental reservation number. Empty when none is known. | These identifiers have different scopes. Use the identifier returned for the current step instead of storing an earlier search result indefinitely. Treat every identifier as an opaque string and do not parse it. A `quote_id` is accepted only on the trip whose checkout created it; any other trip refuses it. Payment attempt answers write `trip_id` with a `trip_` prefix (`trip_1048576`), while the other answers write the same trip as `1048576`: strip the prefix to compare them. ## Lifetimes and expiry Offers, trips, quotes, and checkout links expire on separate timelines: | Object | What to do when it expires | | - | - | | Offer | Search again and replace the item in the trip. | | Trip | Start a new trip with fresh offers. | | Quote | Run checkout again to refresh the price and payment terms. | | Checkout link | Run checkout again to create a new link. | Always use a returned `expires_at` value when one is available. A valid checkout link does not mean its quote is still valid, and a valid quote does not guarantee that the supplier will keep the offer available. See [Errors and troubleshooting](/concepts/errors) for recovery steps. # Limits & credits Source: https://docs.gojinko.com/concepts/rate-limits What gates an API call: prepaid credit in US dollars, and a per-second request ceiling. Two independent things gate an API call, and they fail differently: | | What it caps | What you get when you hit it | | - | - | - | | **Credit** | How much you can spend | `402 PAYMENT_REQUIRED` | | **Rate limit** | How fast you can call | `429 RATE_LIMITED` | > [!NOTE] > > **There is no monthly request quota.** Earlier versions of these docs described > a "1,000 requests per 30 days" allowance per key. That model has been retired. > Usage is metered in **US dollars** against your organization's credit balance, > and a cheap call and an expensive one no longer count the same. > > One exception: a **legacy person-bound key** — an older bare `jnk_` key (no `_t_`) still accepted and tied to a > user account rather than to a tenant — is still counted against a per-user > allowance of 1,000 requests per 30 days, on top of the credit above. Every > production tenant key is metered in dollars only. New keys from the dashboard > or platform MCP `get_api_key` are tenant keys: `jnk_t_` in production and > `jnk_sandbox_t_` in sandbox. Sandbox calls are not billed. ## Credit Credit belongs to the **organization**, not to a key. Every tenant and every API key under the organization draws on one balance, so spreading work across several keys does not give you more to spend. Calls are priced individually — a live provider search costs more than a cache read — so your balance moves by the value of what you actually called, not by a request count. The per-call price and this cycle's usage are itemised on the [Billing page](https://dashboard.gojinko.com/developers/billing). ### Keeping live-search spend down A live `flight_search` goes to the supplier on every call, in search mode and in price-check mode, and costs more than a cache read. Cached discovery (`flight_calendar`, `find_destination`, `find_dates`, `lowest_fare`) reads Jinko's fare cache and costs less. * **Explore with the cache.** While the user is still choosing dates or comparing routes, use the discovery endpoints. Their prices can be 5-30 minutes stale, which is fine for browsing. * **Go live once the choice is made.** Call `flight_search` when the route and dates are fixed, or price-check the one itinerary the user picked by passing its `id` as `offer_token`. Do not price-check every calendar result. * **Narrow before you go live.** Apply the cabin, stop, time-of-day, airline and price-ceiling filters the cached call accepts first, so the live call confirms a shortlist instead of building one. * **Reuse a live result.** A fare stays usable until its `expires_at` (at most 75 minutes from the search). Keep the response and serve repeat views, sorting and pagination from it instead of sending the same search again. * **Search again only when you must:** the fare's `expires_at` has passed, the user changed the route, dates or travelers, or checkout answered `OFFER_EXPIRED`. The current price of each call is listed on the [Billing page](https://dashboard.gojinko.com/developers/billing). See [Lifetimes and expiry](/concepts/overview#lifetimes-and-expiry) for how long each result stays usable. ### Included usage Every plan includes an amount of usage each billing cycle. On the **Free** plan that is **\$5.00 per month**, with no fee and no card required. > [!WARNING] > > **Included usage does not roll over.** The grant covers one billing cycle and > expires when that cycle ends. An unused \$5 does not become \$10 next month — > every cycle starts at the plan's amount, whatever you did or did not spend > before it. The dashboard shows your balance and the date the cycle resets. ### Topping up You can buy extra credit from the dashboard at any time, on any plan. Purchased credit is separate from the monthly grant and is **not** cleared at the cycle boundary. Included usage is always spent **before** purchased credit, so topping up mid-cycle never burns the free allowance you still had. To replenish credit automatically, set up [Auto top-up](/guides/auto-top-up). ### Running out When a call costs more than the organization's remaining balance, it is refused with **`402 Payment Required`**: ```json theme={null} { "error": { "code": "PAYMENT_REQUIRED", "message": "Insufficient balance — this call costs $0.0150 and your organization has $0.0000 available. Top up at https://dashboard.gojinko.com/developers/billing/topup" } } ``` The message names what the call cost, what you had, and where to top up. > [!WARNING] > > **Do not retry a 402.** It is deliberately *not* a `429`. Retrying never fills > a wallet, and an agent that treats this as backpressure will back off and spin > quietly instead of telling you to add credit. Surface it to a human, or top up. Your key stays **active** through all of this — a 402 is a billing state, not a credential problem. Nothing needs rotating, and the same key resumes working the moment the balance covers the next call. ## Rate limits Rate limiting is a **separate axis** from credit. Credit caps total consumption, not burst rate, so an organization with plenty of credit can still be throttled for calling too fast. The ceiling is a sustained **requests-per-second** rate with a short **burst** allowance. Whether a ceiling applies, and its number, is set for your organization as part of its plan or contract. It is applied **per organization**, so all of your tenants draw from one bucket. Credit works the same way: both are one shared organization allowance, so splitting work across tenants buys you neither more to spend nor more throughput. Over the ceiling, you get `429` and should back off: ```json theme={null} { "error": { "code": "RATE_LIMITED", "message": "Rate limit or quota exceeded." } } ``` Honour the `Retry-After` header when one is present; otherwise retry with exponential backoff. Unlike a 402, a 429 *is* worth retrying. > [!NOTE] > > Throughput ceilings are set per organization and per contract, so they are not > printed here — a number in a docs page would drift out of date. To find the > ceiling on your organization, or to change it, email > [dev@gojinko.com](mailto:dev@gojinko.com). ## See also * [Errors & troubleshooting](/concepts/errors) — the full status-code reference * [API keys](/authentication/api-keys) — getting, using and rotating keys # Versioning & deprecation Source: https://docs.gojinko.com/concepts/versioning How the public contract changes, what counts as breaking, and how much warning you get. The Jinko public API is versioned on the **published contract**, as `..`. Every change, including a removal, moves the minor or patch number; the major number does not move. The number lives in `info.version` of the [OpenAPI document](/api-reference/introduction), and it is the one signal that the contract moved. ```bash theme={null} curl -s https://api.gojinko.com/doc | jq -r '.info.version' # .. ``` Read it from the environment you are actually calling. A sandbox and production can be serving different contract versions during a rollout, and the served document is the truth about which. ## The rules **1. Additive changes bump the minor version, with no notice** A new optional field, a new endpoint, a new event type, a new error code, a new enum value on a field you send us: all of these ship in a minor bump with no advance notice. Your integration keeps working through them, which is why they need none. **2. A removal is announced at least 180 days ahead** Removing a field or an input, making an optional input required, or narrowing a type is a breaking change. Before it ships, the field or input is deprecated for **at least 180 days**: it keeps working and it is listed on this page with its removal date. Where the [OpenAPI document](/api-reference/introduction) declares it (for example `direct_only` on `flight_search`, or `adults`, `star_rating` and `offset` on `hotel_search`), the document marks it `deprecated: true` and names its replacement. The old names and values of the `0.74.0` renames, and the inputs accepted again after a removal, are not declared there, so this page is where they are listed. A deprecated input is also announced on every response to a request that uses it (see [Deprecation headers](#deprecation-headers)). The removal then ships as a new minor contract version on the same `/v1` path, listed under [Contract changes](#contract-changes) and in the [changelog](/changelog). Read that list for every new version before you upgrade. This applies to every removal from contract `0.76.0` (2026-10-18) on. Earlier versions removed some fields and inputs without notice; each is listed in the changelog, and the inputs the platform still serves are accepted again since `0.76.0` and `0.77.0`. **3. A change of meaning ships on a new path** We do not repurpose a field or change what an existing request does under `/v1`. A change that alters the meaning of existing requests or responses goes to a new path (`/v2`), and the two run side by side for **at least 180 days** so you can move at your own pace. **4. Deprecations are announced on the wire, where you cannot miss them** A route on its way out keeps answering, and every one of its responses carries headers that name its replacement and, once it is set, its removal date. A request that still sends a deprecated input name or value is answered with a `Deprecation` header too. You do not have to be reading announcements to find out: your own logs tell you, well before anything stops working. ## What counts as breaking | Change | Breaking? | How it ships | | - | - | - | | New optional response field | no | Minor bump. Ignore fields you do not know. | | New optional request field | no | Minor bump. It defaults to today's behaviour. | | New endpoint | no | Minor bump. | | New value in a response enum | no | Minor bump. Treat response enums as open and handle the unknown case. | | New `error.code` | no | Minor bump. Have a default branch, see [Errors](/concepts/errors). | | New webhook event type | no | Minor bump. Ignore events you do not handle. | | Removing or renaming a response field | **yes** | Deprecated for at least 180 days, then removed in a minor version on `/v1`, listed under [Contract changes](#contract-changes) with the change named. | | Removing a request field or query parameter | **yes** | Deprecated for at least 180 days, then removed in a minor version on `/v1`, listed under [Contract changes](#contract-changes) with the change named. | | Making an optional request field required | **yes** | Announced on this page at least 180 days ahead, then a minor version on `/v1`, listed under [Contract changes](#contract-changes) with the change named. | | Narrowing a type | **yes** | Announced on this page at least 180 days ahead, then a minor version on `/v1`, listed under [Contract changes](#contract-changes) with the change named. | | Changing what a field or an existing request means | **yes** | New path, with overlap. | | Removing an endpoint | **yes** | Deprecation headers first, a `Sunset` date at least 180 days ahead, then removal in a new minor version. | | An `error.code` that stops being sent | no | Minor bump, named under [Contract changes](#contract-changes). A branch you wrote for it goes unreached rather than wrong. | > [!WARNING] > > **"Ignore what you do not recognise" is load-bearing.** A client that rejects an unknown response field, an unknown enum value, an unknown error code, or an unknown webhook event turns every additive release into an outage for itself. Nothing in the additive column above is announced ahead of time, because a correct client does not need the warning. ## Deprecation headers ### On a deprecated route While a route is deprecated but still answering, every response it sends carries these headers: | Header | Value | What it tells you | | - | - | - | | `Deprecation` | `true` | This route is on its way out. | | `Link` | `; rel="successor-version"` | The route that replaces it. | | `Sunset` | An HTTP-date, e.g. `Fri, 30 Apr 2027 23:59:59 GMT` | The instant after which it stops answering. Sent once a removal date is set, at least 180 days ahead. | They are set before anything else runs, so a 401 carries them just as a 200 does. That is deliberate: a caller whose credentials are stale is exactly the caller most likely to be running old code. **`POST /v1/book`** is superseded by [`POST /v1/checkout`](/api/checkout) and stops answering at its `Sunset`: ```bash theme={null} curl -is -X POST https://api.gojinko.com/v1/book \ -H "X-API-Key: $JINKO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "trip_id": "trip_1048576" }' | grep -iE '^(deprecation|sunset|link):' # deprecation: true # sunset: Fri, 30 Apr 2027 23:59:59 GMT # link: ; rel="successor-version" ``` If you are calling `/v1/book`, switch to `/v1/checkout`. It is the same operation under the name the rest of the platform uses, and it is where new behaviour lands. These routes are deprecated with no removal date set yet, so they send `Deprecation` and `Link` but no `Sunset`: | Deprecated route | Replaced by | | - | - | | `POST /v1/refund_check` | `POST /v1/flight_refund_preview` | | `POST /v1/refund_commit` | `POST /v1/flight_refund_commit` | | `POST /v1/refund_status` | `POST /v1/flight_refund_status` | | `POST /v1/hotel_cancel` | `POST /v1/hotel_cancel_preview`, then `POST /v1/hotel_cancel_commit` | ### On a request that uses a deprecated input A request that names an input by a deprecated name, or sends a deprecated value, is still served. Its response carries: | Header | Value | What it tells you | | - | - | - | | `Deprecation` | `true` | The request used something on its way out. | | `Link` | `; rel="deprecation"` | Where the deprecated inputs and their replacements are listed. | | `Sunset` | An HTTP-date | Sent once a removal date is set for an input the request used, at least 180 days ahead. | The response is otherwise unchanged. A request refused because it names one value under both the old and the new name carries the headers too. ```bash theme={null} curl -is -X POST https://api.gojinko.com/v1/flight_search \ -H "X-API-Key: $JINKO_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "origin": "JFK", "destination": "CDG", "departure_date": "2026-12-01", "max_price": 800 }' \ | grep -iE '^(deprecation|link):' # deprecation: true # link: ; rel="deprecation" ``` > [!TIP] > > **Log the `Deprecation` header, do not just read it.** One line in your client that warns when a response carries `Deprecation: true` costs nothing and turns every future sunset into something you find out about on the day it is announced rather than the day it takes effect. ## Deprecated fields A response field can be deprecated while its route stays, and keeps being sent with the same meaning. A renamed field has its replacement sent beside it, and the [OpenAPI document](/api-reference/introduction) marks the old field `deprecated: true` with a description that names the replacement ("Deprecated: use `` instead."). A field deprecated with no replacement (for example `stripe_reference` and `stripe_refund_id`) is marked `deprecated: true` the same way, with nothing sent beside it: stop reading it. A response cannot tell which fields you read, so a deprecated response field sends no header; the OpenAPI document and this page are where it is announced. Removing a deprecated field is a breaking change and follows the rules above: its removal date is announced here at least 180 days ahead. Until then, reading the old field keeps working; move to the replacement, or stop reading a field that has none, when you next change that code. ### With a removal date | Deprecated field | Read instead | On | Sent until | | - | - | - | - | | `hotel_ref` | `hotel_id` (search), `id` (details, reviews) | `POST /v1/hotel_search` hotels and nearby alternatives, `GET /v1/hotel_details/{hotel_id}` and `GET /v1/hotel_reviews/{hotel_id}` `hotel` | 2027-04-30 | ### Without a removal date yet A field in this table has left the OpenAPI document but not the code: a client generated from an earlier document keeps working, and the field is removed from the code in a later version, announced here with a date. | Deprecated field | Read instead | On | | - | - | - | | `amount` on `price_per_person` | `value` with `decimal_places`, or `display` | `POST /v1/flight_search` fares (`offers[].fares[]`); left the document in `0.80.0`, and was never set on this figure | ## Deprecated inputs These request inputs are deprecated and still accepted. A request that uses one is answered with the `Deprecation` header, and with `Sunset` when the input has a removal date. ### With a removal date The inputs removed without notice since 2026-08-29 that the platform still serves are accepted again until **2027-04-30**, each answered as it was before it was removed. The booking handles keep the rules they had before `0.57.0`: sending one beside `booking_ref` is refused with 422. | Deprecated input | Send instead | On | Accepted until | | - | - | - | - | | `order_id` | `booking_ref` and `booked_item_id` | `refund_check`, `refund_commit`, `refund_status`, `exchange_shop`, `exchange_price`, `exchange_commit`, `exchange_status` | 2027-04-30 | | `provider_reference` | `booking_ref`, `last_name` and `booked_item_id` | `flight_refund_preview`, `flight_refund_commit`, `flight_refund_status`, `hotel_cancel_preview`, `hotel_cancel_commit`, `hotel_cancel_status` | 2027-04-30 | | `provider_booking_id` | `booking_ref`, `last_name` and `booked_item_id` | `hotel_cancel` | 2027-04-30 | | `provider` | nothing: omit it | the flight refund and exchange routes, `hotel_cancel` | 2027-04-30 | | the two `enable_*` query parameters that turned a hotel supplier on or off, removed in `0.57.0` | nothing: omit them; the platform chooses which hotel inventory to search, and ignores both | `POST /v1/hotel_search` | 2027-04-30 | | `date_flexibility_days` | nothing: omit it; the search runs on the exact dates, and the field is ignored | `POST /v1/flight_search` | 2027-04-30 | | `origin`, `destination` in a `segments_to_exchange` entry | `origin_location`, `destination_location` with `type: airport` | `POST /v1/exchange_shop` | 2027-04-30 | | an empty `segments_to_exchange` | omit the field | `POST /v1/exchange_shop` | 2027-04-30 | ### Without a removal date yet | Deprecated input | Send instead | On | | - | - | - | | `quoted_cart_id` | `quote_id` | `POST /v1/agent_payment/submit` (typed payment) | | `quote` | `quote_id` | `POST /v1/flight_refund_commit`, `POST /v1/hotel_cancel_commit` | | `cancellation_id` | `quote_id` | `POST /v1/car_cancel_commit` | | `session_reference` | `quote_id` | `POST /v1/exchange_commit` | | integer `item_id` | `booked_item_id` | refund, exchange and cancellation requests | | `max_price` | `max_total` | `POST /v1/flight_search`, `POST /v1/price_monitoring` | | `passenger_type` (uppercase) | `traveler_type` (lowercase) | `POST /v1/trip` (`upsert_travelers`) | | `pax_ref_id` | `traveler_ref` | `POST /v1/select_ancillaries` | | `offer_id` | `trip_item_token` | `POST /v1/best_price_guarantee` | | `trip_type` `One-Way`, `Round-Trip` | `oneway`, `roundtrip` | travel demand routes | | `direct_only` | `max_stops: 0` for `direct_only: true`; for `direct_only: false`, omit it (or send the `max_stops` you want) | `POST /v1/flight_search`, `POST /v1/flight_calendar`, `POST /v1/find_dates`, `POST /v1/lowest_fare`, `POST /v1/price_monitoring` | | `adults`, `children`, `rooms` | `occupancies` | `POST /v1/hotel_search` | | `star_rating` | `min_star_rating` and `max_star_rating` | `POST /v1/hotel_search` | | `offset` | `next_handle` | `POST /v1/hotel_search` | | `offset` | `page_token` (the previous response's `next_page_token`) | `POST /v1/flight_calendar` | | `adults`, `children`, `infants_in_lap`, `infants_in_seat`, `youth`, `student`, `ages`, `residency_country` | nothing: omit them; every cached fare is one adult's (`priced_for: one_adult`), so none of them changes an answer. Price the party with `POST /v1/flight_search` | `POST /v1/flight_calendar`, `POST /v1/find_dates`, `POST /v1/lowest_fare`, `POST /v1/find_destination` | | `adults`, `children`, `infants` | nothing: omit them, for the same reason | `POST /v1/price_monitoring` | | `sort_by` `recommendation` | `lowest`, or omit the field; the cache answers cheapest first whatever is sent | `POST /v1/flight_calendar`, `POST /v1/find_dates`, `POST /v1/lowest_fare`, `POST /v1/find_destination` | ## Contract changes Each contract version that deprecates, removes or changes something is described here, oldest first. A version that removes something lists every field and input it removes. ### Changes in `0.26.0` Contract `0.26.0` gives each concept one field name and every money figure one shape. Nothing is removed and no removal date is set. * **Money.** Every figure is available in the [money shape](/concepts/money) `{ value, currency, decimal_places, display }`, with `value` in minor units: in a `*_money` field beside the older field (`total_amount_money`, `price_money`, `max_amount_money`, …), as `value` inside objects that carried the same integer as `amount`, or as `amount_money` inside objects that hold money beside other members (a cancellation preview's `refund`, a hotel tax line). The older fields, including a `currency` or `*_display` sibling that only described them, are deprecated. Hotel cancellation steps add `percent` and `nights` for steps that are not a sum. [Money & prices](/concepts/money#field-by-field-migration) maps every field. * **`get_booking` `booking.total_paid`.** Now sent: the gross amount captured for the booking, refunds not subtracted. Absent when nothing was captured or when the booking was charged in more than one currency. * **Cancellation and refund commits.** `acknowledged` can be copied from the preview's `refund.amount_money`. The older inline figure is still accepted. * **Webhooks.** `booking.partial` adds `captured_amount_money` and `captured_total_money` (the major-unit `captured_amount` and `captured_total` are deprecated). `servicing.completed` is documented, with `refund` and `penalty` in the money shape. See [Webhooks](/guides/webhooks). * **`POST /v1/trip` items.** `kind` is added beside `type`, which is deprecated. `kind` is the name `GET /v1/trip/{trip_id}` and checkout already use. * **Hotel rooms.** `room_capacity` is added beside `max_occupancy` on `hotel_search` and `hotel_details` rooms; `max_occupancy` is deprecated. On `hotel_search` it repeated the requested occupancy and never was the room's capacity. * **A live flight search with no matches** answers 200 with `offers: []`, `result: "no_matches"` and an `instruction`. The `X-Jinko-Result` and `X-Jinko-Instruction` headers are still sent and are deprecated. ### Changes in `0.33.0` * **A live flight search with provider failures and no offers** answers 200 with `result: "provider_error"` and an instruction to retry without changing filters; `provider_statuses` error rows can carry an optional `reason: { code, message }`, even when other sources return offers. ### Changes in `0.39.0` Contract `0.39.0` states a flight exchange in the customer's own figures. Nothing is removed and no removal date is set. * **`POST /v1/exchange_price` `customer_amounts`.** Added: `original_fare` (what the customer paid for the ticket), `new_fare` (the new ticket's value), `penalty_amount` (the airline's change fee, absent when there is none) and `total_due` or `total_refund` (exactly what is charged or refunded), each in the [money shape](/concepts/money). They add up: `original_fare + total_due − total_refund = new_fare + penalty_amount`. `customer_amounts` is absent when the platform cannot state the customer's figures. * **`POST /v1/exchange_price` `fare_difference`, `original_fare`, `new_fare` and `penalty_amount`.** Deprecated: use `customer_amounts.*` instead. They are the supplier's figures and do not add up to what is charged or refunded. They keep their values. * **`total_due`, `total_refund` and `payment_outcome`** keep their meaning: what the customer pays or gets back. On a booking whose supplier adds its own service fees, they now leave those fees out, since the customer is not charged them, and `payment_outcome` follows what the customer pays or gets back. * **`POST /v1/exchange_shop` `estimated_amount`** follows the same rule. It now leaves out the supplier's own service fees, so the estimate states what the customer would pay. `/v1/exchange_price` stays the binding figure. * **Exchange price and flight cancellation** can now answer `manual_required`: an operator completes them when the supplier's figures cannot be stated safely. This covers components that cannot be classified or do not add up, an airline change fee charged outside the exchange total, inconsistent supplier totals, or a cancellation whose supplier booking fee cannot be established or that follows a completed exchange. ### Changes in `0.57.0` Contract `0.57.0` is a minor version on the same `/v1` paths that removes fields and inputs: responses, identifiers and error messages no longer say which supplier an offer, a booking or an error came from. The removals are breaking changes; read the list below before you upgrade. Removed: * **Supplier fields on responses.** `provider` and `provider_name` on flight offers; `provider_statuses` on `flight_search`, in success and error bodies; `provider` on hotels, on `search_scope` and its `providers[]`, and on `hotel_details`, `hotel_cancel` and `flight_refund_preview`. The raw supplier status word is gone too: `provider_status` on `bookings[]` entries and on refund status, and inside the `provider` object of `hotel_cancel_status` and `flight_refund_status`, which keeps `state`, `references` and `documents`. * **`result: "provider_error"` on `flight_search`.** A search that completes without a match answers `result: "no_matches"` as before. A search that could not be completed at all answers an error (`UPSTREAM_REJECTED`, `UPSTREAM_ERROR`, `UPSTREAM_UNAVAILABLE` or `UPSTREAM_TIMEOUT`). Offers that were found are returned even when part of the search failed. * **Servicing inputs that named the supplier or its references.** `provider` on the flight refund and exchange requests and on `hotel_cancel`, `order_id`, `provider_reference` and `provider_booking_id`. A request carrying one is refused with 422 `BAD_REQUEST` naming the field; name the booking with `booking_ref` (now required) and `item_id` from `get_booking`. This removal shipped without notice; `0.76.0` accepts them again as deprecated inputs until 2027-04-30. * **The two `hotel_search` query switches that turned individual hotel suppliers on or off.** A request carrying either is refused with 422 naming the parameter. Changed: * **`payment_types` on a hotel rate** is a closed enum: `pay_now`, `pay_at_property`, `deposit`. * **`hotel_ref` and an ancillary `offer_id` are opaque.** Pass them back exactly as received; their format is not part of the contract. `hotel_details` takes a `hotel_ref` as received, or a plain `hotel_id`. * **Fixed messages for the supplier-facing error codes.** `UPSTREAM_REJECTED`, `UPSTREAM_UNAVAILABLE`, `UPSTREAM_TIMEOUT`, `UPSTREAM_ERROR`, `RATE_LIMITED`, `OFFER_UNAVAILABLE` and `OFFER_EXPIRED` always carry the same message and never upstream text; see [Messages on supplier failures](/concepts/errors#messages-on-supplier-failures). A 429 documents `Retry-After`. * **Upstream statuses follow the error categories.** A 503 from the platform is answered 503 `UPSTREAM_UNAVAILABLE` with its `Retry-After`, and a 504 is answered 504 `UPSTREAM_TIMEOUT`; both used to be answered as 502 `UPSTREAM_ERROR`. A 429 carries the platform's `Retry-After`. A hotel refusal is 502 `UPSTREAM_REJECTED`, as a flight refusal already was. * **Refusals that used to quote the supplier carry fixed sentences.** 409 `not_cancellable`, 409 `not_exchangeable`, 400 `invalid_exchange_request` and `partial_exchange_unsupported` from the supplier, and `manual_reason` where it would be the supplier's own words, each carry one fixed sentence; see [Messages on supplier failures](/concepts/errors#messages-on-supplier-failures). * **`flight_price_advice` answers a refusal of its inputs as 400 or 422 `BAD_REQUEST`** with the platform's sentence. It used to answer 502 `UPSTREAM_REJECTED`; price advice reaches no supplier, so the refusal is the caller's to fix. ### Changes in `0.74.0` Contract `0.74.0` gives every concept one public name across REST, MCP and the CLI. Nothing is removed and no removal date is set. A renamed response field is sent beside its replacement with the same value and marked `deprecated: true`. A renamed request field is still accepted under its old name, but only the new name is documented; sending both names with different values is refused with 422 `BAD_REQUEST` (400 `CREDENTIAL_FORMAT_INVALID` on a typed payment body, which answers every format refusal that way). A value whose spelling changed is changed in place on responses, and requests still accept the old spelling. Values changed in place: * **`error.code` is uppercase everywhere.** `attempt_in_progress`, `attempt_terminal`, `credential_format_invalid`, `departure_date_in_past`, `idempotency_key_reused`, `invalid_exchange_request`, `invalid_segments_to_exchange`, `leg_already_departed`, `leg_dates_out_of_order`, `not_exchangeable`, `partial_exchange_unsupported`, `payment_credential_invalid`, `payment_type_not_enabled`, `temporarily_unavailable` and `trip_owned_by_other_payment` are now uppercase; `quote_expired` is `QUOTE_EXPIRED`. * **`payment_error.code` is uppercase**, the same codes as `error.code`. * **Refund and cancellation conflicts:** the sibling `code` `quote_expired` is `QUOTE_EXPIRED`. The other conflict codes are unchanged. * **Exchange and ancillary `status` are lowercase:** exchange commit and status (`confirmed`, `pending`, `partial_failure`, `failed`); selected and booked ancillaries (`pending`, `confirmed`, `failed`). * **`failure_reason` says `offer_unavailable`**, not `offer_not_available`, on `booking.failed` and wherever a booking failure is published. * **Travel demand `trip_type` is `oneway` / `roundtrip`.** Renamed (the old name stays, deprecated): | New name | Replaces | | - | - | | `quote_id` | `quoted_cart_id`; the servicing preview handles `quote` (refund, hotel cancellation), `cancellation_id` (rental car) and `session_reference` (exchange) | | `retry_quote_id` | `requote` on refund and cancellation conflicts | | `booking_ref` | `booking_reference` where it held the Jinko reference, and `fulfillment_cart_id` | | `booked_item_id` | the integer `item_id` on booked items, the integer `item` on servicing webhooks, and `item` on refund and cancel previews (already the same `itm_` value) | | `item_id` on the `select_ancillaries` answer | `quoted_item_id` | | `supplier_references[]` | `pnr`, `airline_locators`, `hotel_confirmation_number`, `confirmation.confirmation_number`, `bookings[].booking_reference`, `bookings[].pnr`, the `booking.partial` item's `booking_reference`; the single `airline_locator` on exchange answers | | `trip_item_token` | `offer_id` on hotel, rental car and Best Price Guarantee offers, and on trip items | | `offer_token` | `id` on cached itineraries | | `traveler_ref`, `traveler_type` | `pax_ref_id`, `passenger_type` (`traveler_type` is lowercase) | | `max_total` | `max_price` on `flight_search` and `price_monitoring` | | `failure_reason` in booking failure email content | `reason_code` | | `checkout_url` on `exchange_commit` | `stripe_checkout_session_url` | Added: **`booking_state`** on `GET /v1/trip/{trip_id}` and on `get_booking`, the summary of the booking's progress after payment. `POST /v1/agent_payment/submit` declares 404 `NOT_FOUND` for a trip, or a `quote_id`, it cannot find. Deprecated: `refund_check`, `refund_commit`, `refund_status` and the one-step `hotel_cancel`, in favour of the preview, commit and status routes; the webhook envelope's `status` (branch on `event`); the booking values of the trip `status` (`fulfilling`, `fulfilled`, `partially_fulfilled`, `failed`), in favour of `booking_state`; `stripe_reference` and `stripe_refund_id`. ### Changes in `0.76.0` Contract `0.76.0` announces deprecations on the response and gives the inputs `0.57.0` removed the notice they did not get. Added: a request that uses a deprecated input is answered with `Deprecation: true` and a `Link` to [Deprecated inputs](#deprecated-inputs), and with `Sunset` when the input has a removal date. `refund_check`, `refund_commit`, `refund_status` and the one-step `hotel_cancel`, deprecated in `0.74.0`, answer with `Deprecation` and a `Link` to the route that replaces each. Restored: `order_id`, `provider_reference`, `provider_booking_id` and `provider` are accepted again where they were before `0.57.0`, deprecated until 2027-04-30; see [Deprecated inputs](#deprecated-inputs). `booking_ref` is optional on those routes again and required when no handle names the booking. ### Changes in `0.77.0` Contract `0.77.0` gives the other inputs and the response field removed without notice since 2026-08-29, that the platform still serves, the notice they did not get. Restored: the two `enable_*` query parameters on `hotel_search` that turned a hotel supplier on or off, `date_flexibility_days` on `flight_search`, the flat `origin` / `destination` codes and an empty list in `segments_to_exchange` on `exchange_shop`, each accepted again until 2027-04-30; see [Deprecated inputs](#deprecated-inputs). `hotel_ref` is sent again on the hotel answers until 2027-04-30; see [Deprecated fields](#deprecated-fields). Unchanged: `ticket_numbers` on the refund and exchange routes, `place_id` on `hotel_search` and a child age outside 0 to 17 stay refused. ### Changes in `0.79.0` Contract `0.79.0` takes the passenger fields out of the cache-backed flight requests, whose fares are one adult's whatever party is sent. Deprecated: `adults`, `children`, `infants_in_lap`, `infants_in_seat`, `youth`, `student`, `ages` and `residency_country` on `POST /v1/flight_calendar`, `/v1/find_dates`, `/v1/lowest_fare` and `/v1/find_destination`, and `adults`, `children` and `infants` on `POST /v1/price_monitoring`. They are no longer in the OpenAPI document; a request that sends one is accepted and answered as before, with `Deprecation: true` and a `Link` to [Deprecated inputs](#deprecated-inputs). No removal date is set. `priced_for: one_adult` on every answer says whose fare a cached total is; price a party with `POST /v1/flight_search`, which is unchanged. ### Changes in `0.80.0` Contract `0.80.0` takes the deprecated `amount` member out of the per-person fare of a `POST /v1/flight_search` offer. Deprecated: `amount` on `offers[].fares[].price_per_person`, a `Money` member the platform never set on this figure, is no longer in the OpenAPI document; the fare is published as `MoneyWithoutAmount` (`value`, `currency`, `decimal_places` and `display`, unchanged). A client generated from an earlier document keeps working: the member stays in the code, and no response changes. See [Deprecated fields](#deprecated-fields). `total_price` on the same fare is unchanged. ### Changes in `0.81.0` Contract `0.81.0` makes the document of the five cache-backed flight routes say what the cache sends. Removed: `aircraft` on the segments of a cached itinerary (`POST /v1/flight_calendar`, `/v1/find_dates`, `/v1/lowest_fare`, `/v1/find_destination`). The cache carries no equipment, so the field was never sent on those routes; it leaves the document without a deprecation period because no response changes. The cached legs are published as `CachedFlightLeg` / `CachedSegment`, with the same fields and types as `FlightLeg` / `Segment`, which `flight_search` and the booking reads keep unchanged. Corrected: the datetime, `operating_carrier` and `limit` descriptions on those routes, and `status`, the `*_local` datetimes and `inbound_stops` on `POST /v1/price_monitoring`; the [changelog](/changelog) names each. ### Changes in `0.89.0` Contract `0.89.0` narrows one input to the single value the platform serves. Nothing is removed and no removal date is set. * **`sort_by` on `POST /v1/flight_calendar`, `/v1/find_dates`, `/v1/lowest_fare` and `/v1/find_destination`** is published as `lowest` alone: cheapest first by the cached one-adult total, and on `find_destination` destinations by their cheapest itinerary. `recommendation` leaves the document; no such order was ever implemented, and a request that asked for it was answered cheapest first. A request that still sends it is accepted, read as `lowest` and answered as before, with `Deprecation: true` and the deprecated-inputs `Link`. It is listed under [Deprecated inputs](#deprecated-inputs). ### Changes in `0.113.0` Contract `0.113.0` adds filters to the cached flight routes and deprecates one input they replace. Nothing is removed and no removal date is set. * **`direct_only` on `POST /v1/flight_calendar`, `/v1/find_dates`, `/v1/lowest_fare` and `/v1/price_monitoring`** is deprecated: send `max_stops: 0`, which those routes now take, as `POST /v1/flight_search` does. It stays in the OpenAPI document marked `deprecated`. A request that still sends it is accepted and answered as before, with `Deprecation: true` and the deprecated-inputs `Link`; beside a non-zero `max_stops` it is refused with 422. It is listed under [Deprecated inputs](#deprecated-inputs). `POST /v1/find_destination` takes no `max_stops`, so `direct_only` is not deprecated there. * **`limit` on `POST /v1/lowest_fare`** is applied (1 to 100, default 10). Before, the route returned at most ten itineraries whatever `limit` said. A request without `limit` is answered as before. The added filters are listed in the [changelog](/changelog). ### Changes in `0.114.0` Contract `0.114.0` adds token paging to `POST /v1/flight_calendar` and deprecates the input it replaces there. Nothing is removed and no removal date is set. * **`offset` on `POST /v1/flight_calendar`** is deprecated: page with `page_token`, the previous response's `next_page_token`. It stays in the OpenAPI document marked `deprecated`. A request that still sends it is accepted and answered as before, with `Deprecation: true` and the deprecated-inputs `Link`; a non-zero `offset` beside `page_token` is refused with 422. It is listed under [Deprecated inputs](#deprecated-inputs). `find_dates` and `lowest_fare` do not page; `find_destination` keeps `offset`. ### Changes in `0.124.0` Contract `0.124.0` changes what a flight exchange to a cheaper ticket answers: an exchange does not pay a price difference back. Nothing is removed and no removal date is set. * **`payment_outcome` on `POST /v1/exchange_price`** is no longer `REFUND`. An exchange to a cheaper ticket is `EVEN`, or `ADD_COLLECT` when an airline change fee is due, and the new `customer_amounts.non_refundable_difference` states the difference. `total_refund`, on the top level and in `customer_amounts`, is never above 0. The `REFUND` value and `total_refund` stay in the schema. * **`estimated_payment_outcome` on `POST /v1/exchange_shop` offers** is no longer `REFUND`. An offer whose new ticket is expected to cost less, by more than any airline change fee, carries no `estimated_payment_outcome` and no `estimated_amount`: the customer then pays that change fee, which is known only once the offer is priced. An estimate can be lower than the price by the change fee when the new ticket costs less. * **The 409 on `POST /v1/exchange_price`** no longer answers `funds_unavailable`, and its message no longer promises a refund. It can carry `customer_amounts`, what the customer would owe. `funds_unavailable` stays in the schema. * **`payment_outcome` `REFUND` and the 409 code `funds_unavailable` on `POST /v1/exchange_commit`, and `refund_due` and `refunded` on `items[].servicing.exchange` of `POST /v1/get_booking`**, appear only on an exchange quoted before this change. The added members are listed in the [changelog](/changelog). [Flight exchanges](/guides/flight-exchanges#when-the-new-ticket-costs-less) describes what to show the traveler. ## The error-code enum is closed `error.code` is a fixed set, published as an enum in the spec. The platform sends no code outside it, and every code in it has a producer. The spec and the [errors page](/concepts/errors) are kept in step with the platform's own table, so the list you read is the list you can receive. Adding a code is additive and lands in a minor bump, so keep a default branch for a code you do not recognise. A code can also stop being sent: it leaves the set in a minor version, named under [Contract changes](#contract-changes), and a branch you wrote for it goes unreached rather than wrong. ## What we deliberately do not do * **No dated versions in a request header.** There is no `Jinko-Version` header to pin. The contract version is a property of the document you read, not of the call you make. * **No silent behaviour changes inside a version.** If the answer to the same request changes in a way you can observe, the minor version moves, so `info.version` is enough to tell you something did. * **No route removals without the sunset window.** A route that carries no `Sunset` header is not going anywhere. * **No removal without notice.** A field or an input is removed only after it has been deprecated for at least 180 days, in a version listed on this page and in the [changelog](/changelog), with the removal named. ## Where to look * **The served contract**: `info.version` in the [OpenAPI document](/api-reference/introduction). It is the version of the environment you fetched it from. * **What changed**: the contract version itself is the signal. Compare `info.version` against the one you last integrated against, and read a deprecated route's `Deprecation` and `Sunset` headers straight off your own responses. Deprecated fields are marked in the OpenAPI document. Deprecations, removals and other changes are listed by version under [Contract changes](#contract-changes), and every contract version since 0.57.0 is in the [changelog](/changelog). Log the `Deprecation` header in your client: it names the requests that still use something on its way out. * **What a code means**: [Errors & troubleshooting](/concepts/errors) carries the full enum with a remedy for each entry. # CLI Source: https://docs.gojinko.com/connect/cli Install the Jinko CLI and run the booking flow from your shell. The CLI mirrors the booking workflow exposed through MCP and is ideal for shell agents and scripts. ## Install ```bash theme={null} npm install -g @gojinko/cli ``` ## Authenticate Use an [API key](/authentication/api-keys). OAuth login is deprecated. Save a key for the selected environment: ```bash theme={null} jinko auth login --key jnk_t_your_key ``` Or supply a key through your shell environment: ```bash theme={null} export JINKO_API_KEY=jnk_t_your_key ``` `JINKO_API_KEY` takes precedence over saved keys, even when you switch environments with `--env`. Use a key for the selected environment, or unset the variable to use saved profiles. ## First request ```bash theme={null} jinko find-destination --origins JFK jinko flight-calendar --origins JFK --destinations CDG --month 2027-06 jinko flight-search --origin JFK --destination CDG --departure-date 2027-06-15 ``` ## Prices in output CLI output is the raw API response, and no conversion is applied. Read money from the `*_money` fields (and `value` on objects that carry it): `value` is an integer in **minor units**, so divide by `10 ** decimal_places` to display it (`{ "value": 15977, "decimal_places": 2 }` is 159.77, not 15,977), or show `display`. The older fields beside them, such as trip and checkout `total_amount` and hotel `total_amount`, are deprecated and hold major units. Full rules: [Money & prices](/concepts/money). ## Environments The CLI targets **production** by default. Use `--env sandbox` to run the full flow against the sandbox environment (isolated data, **separate API keys**) before going live: Use Jinko Airline (`ZZ`) for sandbox flight tests: `flight-search --include-carriers ZZ` on JFK–LHR from tomorrow (UTC) onwards, and flight ZZ101 for the normal flow. It is a fake airline that exists only in sandbox and always behaves the same way; each other flight number triggers one documented behaviour, including failures. With `--include-carriers ZZ` the results are Jinko Airline only. An empty result means no Jinko Airline itinerary matched the route, date and other filters you sent (times, cabin, stops, price): read the `instruction` and adjust one filter. See [Testing in sandbox](/guides/testing-in-sandbox) for routes, prices and scenarios, and [sandbox flight coverage](/guides/sandbox-walkthrough#flight-coverage-and-empty-results) for real airlines. Use live `flight-search` for Jinko Airline. Cached commands such as `find-destination` and `flight-calendar` never return it. The example below uses Python 3 to choose a departure date 60 days from today in UTC. ```bash theme={null} # use saved profiles instead of a key exported in this shell unset JINKO_API_KEY # store your sandbox key under the sandbox profile jinko auth login --env sandbox --key jnk_sandbox_t_your_key # make sandbox the default for this machine… jinko config set environment sandbox DEPARTURE_DATE=$(python3 -c 'from datetime import datetime, timedelta, timezone; print((datetime.now(timezone.utc) + timedelta(days=60)).date())') jinko flight-search --origin JFK --destination LHR \ --departure-date "$DEPARTURE_DATE" --include-carriers ZZ \ --adults 1 --currency USD # → sandbox, Jinko Airline # …or override per-command jinko --env prod find-destination --origins JFK # → production ``` | Environment | API base | Flag | | - | - | - | | Production (default) | `https://api.gojinko.com` | `--env prod` | | Sandbox | `https://api.sandbox.gojinko.com` | `--env sandbox` | > [!NOTE] > > Prod and sandbox keys are stored separately in `~/.jinko/config.yaml`, so you keep both and switch with `--env`. `JINKO_ENV=sandbox` and the raw `JINKO_API_BASE` override also work. # MCP Source: https://docs.gojinko.com/connect/mcp Connect an MCP client to Jinko and read tool results correctly. Connect the Jinko Builder MCP with OAuth in production or an API key in sandbox. ## Endpoint ``` https://mcp.builders.gojinko.com/mcp ``` ## Sandbox Use the sandbox endpoint to test with isolated data before going to production: ``` https://mcp.builders.sandbox.gojinko.com/mcp ``` > [!NOTE] > > Sandbox MCP uses a sandbox API key, not OAuth. Production and sandbox keys are separate. See [Sandbox keys](/authentication/api-keys#sandbox-keys) to create the key and choose the correct endpoint. ## API key mode Production uses OAuth by default. If the client does not support OAuth, send the API key as an `Authorization: Bearer jnk_t_your_key` header. The MCP endpoint does not read `X-API-Key`. That header is for the REST API. See [Which header to send](/authentication/api-keys#which-header-to-send). ## Guide the model with Jinko Travel The MCP server gives the model access to Jinko tools. The [Jinko Travel skill](/connect/skills) is an optional complement that helps the model choose the right tool, follow the booking flow, and apply the right rules for payment and post-booking changes. The skill does not replace the MCP connection. Use both when your client supports skills or reusable instruction files. ## Tool results A Builder MCP tool result can contain two channels: | Channel | What it carries | Who should read it | | - | - | - | | `structuredContent` | Complete machine-readable data | Your integration | | `content[].text` | A concise answer written for the model | The model | The MCP host decides which channel the model sees. Your integration should always read `structuredContent` when it needs result data. > [!WARNING] > > Do not parse `content[].text` as JSON. Its wording can change. Use `structuredContent` for stable result data. # TypeScript SDK Source: https://docs.gojinko.com/connect/sdk @gojinko/api-client, typed wrapper around the Jinko REST API. `@gojinko/api-client` is the typed Node.js SDK for the Jinko Public API. It provides typed convenience methods for travel operations and a raw client for additional endpoints. Use an API key for new integrations; existing OAuth configuration is also supported. ## Install ```bash theme={null} npm install @gojinko/api-client ``` Works with Node.js ≥ 20. ESM-only. ## Quick start ```typescript theme={null} import { createJinkoClient } from '@gojinko/api-client' const client = await createJinkoClient({ apiKey: 'jnk_t_...' }) const { itineraries } = await client.flightCalendar({ origins: ['JFK'], destinations: ['CDG'], origin_type: 'airport', destination_type: 'airport', trip_type: 'oneway', departure_dates: ['2027-06-15'], }) ``` ## Authentication `createJinkoClient()` resolves auth in this order: **1. Explicit apiKey option** ```typescript theme={null} createJinkoClient({ apiKey: 'jnk_t_...' }) ``` **2. JINKO_API_KEY env var** ```bash theme={null} export JINKO_API_KEY=jnk_t_... ``` ```typescript theme={null} createJinkoClient() // picks up env ``` **3. \~/.jinko/config.yaml (CLI-shared)** The same config file the [CLI](/connect/cli) uses. Run `jinko auth login --key jnk_t_...` to populate it; your scripts pick it up automatically. If none of those yield credentials, `createJinkoClient()` throws `AuthError`. ### Existing OAuth tokens CLI OAuth login is deprecated. Use an API key for new CLI and SDK setups. If your config already has OAuth tokens, the SDK checks expiry before each request and calls the auth refresh endpoint transparently. Refreshed tokens are written back to `~/.jinko/config.yaml` so long-running scripts don't lose session. > [!NOTE] > > You cannot paste an OAuth token directly into `apiKey`, different issuers. Use an API key (`jnk_t_...`) for programmatic access when you don't want to maintain OAuth state. ## Environments Pass `environment` to target the sandbox (isolated data, **separate API keys**) before going to production: ```typescript theme={null} const client = await createJinkoClient({ environment: 'sandbox', apiKey: 'jnk_sandbox_t_your_key', }) ``` | `environment` | Base URL | | - | - | | `'prod'` (default) | `https://api.gojinko.com` | | `'sandbox'` | `https://api.sandbox.gojinko.com` | Resolution precedence: the `environment` option → `JINKO_ENV` → the active environment in `~/.jinko/config.yaml` (shared with the [CLI](/connect/cli) via `jinko config set environment sandbox`) → `prod`. For a custom endpoint (such as dev/staging), set `JINKO_API_BASE` and use a key for that endpoint. This env var overrides the base URL even when you pass `environment` explicitly. Unset `JINKO_API_BASE` to use the environment URLs above. **Sandbox flight tests: use Jinko Airline (`ZZ`).** It is a fake airline that exists only in sandbox: search with `include_carriers: ["ZZ"]` on a route such as JFK–LHR from tomorrow onwards, and book flight ZZ101 for the normal flow. Every other flight number triggers one documented behaviour, such as a price change, a sold-out booking or a failed ticket, so you can test failure paths on demand. See [Testing in sandbox](/guides/testing-in-sandbox). ## The returned client ```typescript theme={null} interface JinkoClient extends JinkoTools { readonly raw: JinkoRawClient // openapi-fetch client for escape-hatch requests readonly auth: ResolvedAuth // method + token info // ...plus every method in JinkoTools (see Method reference) } ``` * `client.raw`, the underlying [`openapi-fetch`](https://openapi-ts.dev/openapi-fetch/) client, typed against the full OpenAPI spec. Use this when you need an endpoint not yet exposed via a convenience method. * `client.auth`, resolved credentials (method: `'api_key' | 'oauth'`, plus token info). ## Error handling HTTP failures throw `ApiError`; inspect `statusCode` to distinguish them. `AuthError` reports missing credentials during client setup, not an HTTP 401 response. ```typescript theme={null} import { ApiError } from '@gojinko/api-client' try { await client.flightCalendar({ /* ... */ }) } catch (err) { if (err instanceof ApiError) { if (err.statusCode === 401) { // The server rejected the credentials. } else if (err.statusCode === 422) { // Inspect err.code and err.details for validation failures. } else { // Handle other HTTP failures by statusCode and code. } } } ``` See [Errors & troubleshooting](/concepts/errors) for a full status code reference. ## Observability Every request the SDK emits carries: * `X-Session-ID`, stable per process/CLI session (from `~/.jinko/session.yaml`) * `X-Request-ID`, fresh UUID per request; include it when you report a failure to Jinko * `X-User-ID`, only set on OAuth, from the JWT `sub` claim The SDK sends `X-Request-ID` but does not log it automatically. After creating `client`, add this middleware before making requests to record the ID in your application logs: ```typescript theme={null} client.raw.use({ onRequest({ request }) { console.info('Jinko request ID:', request.headers.get('X-Request-ID')) }, }) ``` Include the request ID when reporting a problem so we can trace it server-side. Log only the ID, not the full request headers or body. ## Method reference Convenience methods map to REST endpoints. Use the [API reference](/api-reference/introduction) for request and response schemas, and the booking guides for SDK examples. Endpoints without a convenience method are available through `client.raw`. Quick map: | SDK method | Purpose | | - | - | | `client.findDestination(req)` | Discover destinations from origin airports | | `client.flightCalendar(req)` | Cached price calendar by route + flexible dates (canonical discovery method) | | `client.flightSearch(req)` | Live pricing: search OR price-check an offer | | `client.hotelSearch(req)` | Live hotel inventory + rates | | `client.carSearch(req)` | Live rental car offers; see the [car guide](/guides/car-rental-booking) | | `client.trip(req)` | Create / update trip, items, travelers, ancillaries | | `client.getAncillaries(tripId)` | List available ancillaries without a checkout URL | | `client.selectAncillaries(req)` | Pre-select bags / seats / meals | | `client.getTrip(tripId)` | Inspect trip / quote / fulfillment / bookings | | `client.checkout(tripId)` | Price the trip and wait for the quote: returns `quote_id`, the Jinko checkout page (`checkout_url`) and `agent_spt_params`; when some items could not be priced it returns `status: "partial"` without the last two | | `client.submitPayment({ tripId, quoteId, payment }, { idempotencyKey })` | Agentic pay: submit a Shared Payment Token against the `quote_id` the traveler approved, with an idempotency key for retries | | `client.submitAgentPayment(tripId, token)` | Deprecated: the older form, which pays the trip's latest valid quote | | `client.getBooking(req)` | Guest lookup by booking_ref + last_name | | `client.hotelCancelPreview(req)` / `hotelCancelCommit(req)` / `hotelCancelStatus(req)` | Preview, commit and follow a hotel cancellation | | `client.hotelCancelBooking(req)` | Deprecated: one-step hotel cancellation | | `client.carCancelPreview(req)` / `carCancelCommit(req)` | Preview and commit a car cancellation; see the [car guide](/guides/car-rental-booking#7-cancel-a-rental) | | `client.flightRefundPreview(req)` / `flightRefundCommit(req)` / `flightRefundStatus(req)` | Preview, commit and follow a flight refund | | `client.refundCheck(req)` / `refundCommit(req)` / `refundStatus(req)` | Deprecated: the older refund flow | | `client.exchangeShop(req)` / `exchangePrice(req)` / `exchangeCommit(req)` / `exchangeStatus(req)` | Exchange flow | | `client.demandDestination(req)` / `demandMarket(req)` / `demandAudience(req)` | Travel demand rankings by share: top destinations, source markets, traveler audiences | | `client.demandDestinationTrend(req)` / `demandMarketTrend(req)` / `demandAudienceTrend(req)` / `demandTrend(req)` | Travel demand time series: destination, market, and audience trends, plus explicit origin and destination pairs (`trend`) | | `client.raw` | Escape hatch, typed `openapi-fetch` client for anything not yet wrapped | Click through any [API endpoint](/api-reference/introduction) for request and response schemas. See the booking guides for SDK and CLI examples. ## Next steps > [card] [Booking guide](/guides/flight-booking) > > End-to-end booking flow in TypeScript, CLI, and MCP. > [card] [API reference](/api-reference/introduction) > > Per-endpoint request and response schemas. > [card] [Authentication](/authentication/api-keys) > > API keys, OAuth flows, and when to use each. > [card] [Errors](/concepts/errors) > > Status codes, error envelope, and debugging. # Skills Source: https://docs.gojinko.com/connect/skills Guide a model through Jinko's travel tools and workflows. A skill gives a model reusable instructions for working with Jinko. It helps the model choose the right tool, follow the booking flow, and apply the right rules at each step. ## Available skill | Skill | What it covers | Source | | - | - | - | | **Jinko Travel** (`jinko-travel`) | Search, booking, payment, and servicing for flights, hotels, and rental cars | [View the skill](https://github.com/jinkoso/jinko-agent-plugins/blob/main/plugins/jinko/skills/jinko-travel/SKILL.md) | ## What Jinko Travel covers 1. Choosing the right tool for each travel request 2. Moving from cached flight discovery to live pricing 3. Building a multi-product trip and checking out once 4. Supporting human and programmatic payment 5. Managing refunds, exchanges, and cancellations after booking 6. Applying operating rules, including using real traveler data, previewing changes before confirmation, and avoiding retry loops ## Use it with MCP The MCP server gives the model access to Jinko tools. Jinko Travel complements that connection with guidance on how to use those tools together. The skill does not replace the MCP connection or the API documentation. Use it when your agent platform supports skills or reusable instruction files. # Auto top-up Source: https://docs.gojinko.com/guides/auto-top-up Automatically add prepaid credit when your API balance runs low. Auto top-up charges your saved card and adds prepaid credit when your API balance falls below a threshold you choose. The feature is off by default. An organization admin can open **Developers**, select **Billing**, then manage it from **Auto top-up**. ## How it works 1. Save a card from the billing page and make it your default payment method. 2. Turn on **Enable Auto top-up**. 3. Enter a **balance threshold**: the balance below which a top-up can run. 4. Choose a **top-up amount**: \$10, \$25, \$50, \$100, or a custom amount from \$10 to \$5,000. The threshold must be lower than this amount. 5. Check the **monthly limit**. It starts at three times the top-up amount, capped at \$10,000. You can change it, but it must cover at least one top-up. 6. Select **Save Auto top-up** to authorize automatic charges to your saved card. Auto top-up is available for prepaid accounts. It always uses your organization's billing card, including when you are viewing Sandbox in the dashboard. ## Monthly spending and limits **This month** shows the amount charged automatically against your monthly limit. The limit resets each UTC calendar month. A top-up that would exceed it is not charged. Manual top-ups do not count toward this limit. Balance checks run periodically, so a top-up is not instant. If your credit runs out before the top-up arrives, or after you reach the monthly limit, API requests stop until credit is available again. You can add credit manually from the billing page. ## Emails you receive Every active organization admin receives these notifications: 1. **Top-up receipt:** amount, updated balance when available, card details, monthly total, and monthly limit 2. **Monthly limit reached:** sent once per organization each month when another top-up would exceed the limit 3. **Auto top-up paused:** explains what to do when the card is declined, requires authentication, or cannot be used Stripe also emails a payment receipt for the card charge. ## Pause and resume A card problem pauses Auto top-up. The panel shows **Paused** and explains why. Nothing retries while paused. Update or replace the saved card, then save the settings again with Auto top-up enabled. ## Turn it off Turn off **Enable Auto top-up**, then select **Save Auto top-up**. Jinko keeps the saved settings for later. Turning it off does not refund earlier top-ups. # Car rentals Source: https://docs.gojinko.com/guides/car-rental-booking Search, compare, book, and manage car rentals with Jinko. Give travelers one conversation for the entire rental journey, from live search to cancellation. ## Booking flow ```mermaid theme={null} flowchart LR A["Live search"] --> B["Build trip"] B --> C["Payment"] C --> D["Manage
cancel and refund"] classDef jinko fill:#FFF4F4,stroke:#FF6363,color:#1A1A1A,stroke-width:2px; class A,B,C,D,E jinko; ``` ## Capabilities > [card] [Live search](#live-search) > > Find live rentals by airport, station, city, or nearby location. > [card] [Compare](#compare-rentals) > > Compare vehicles, rental companies, prices, deposits, and cancellation terms. > [card] [Book](#book) > > Add the driver, contact details, checkout, and payment. > [card] [Manage](#manage-after-booking) > > Preview cancellation fees, confirm the request, and track the refund. ## Build the flow 1. **Live search:** return priced rentals for the location, dates, and driver. 2. **[Build trip](/guides/trips-and-checkout):** add the selected rate, driver, and contact details. 3. **Payment:** create checkout, collect payment, and follow fulfillment. 4. **Manage:** retrieve the booking, preview cancellation, and track the refund. ## Live search Return live, bookable offers from rental suppliers. Jinko searches airports, stations, city branches, free-text locations, or an area around known coordinates. It supports round trips to the same branch and one-way rentals with a different return location. ### Search details 1. Pick-up location, date, and local time 2. Return location, date, and local time 3. Round trip or one-way rental 4. Driver's age at pick-up 5. Driver's country of residence 6. Preferred currency and language The driver's age and country of residence can change both the price and which suppliers will accept the rental. Jinko asks for them before searching instead of guessing. If a place name matches several branches, Jinko shows the possible locations and lets the traveler choose. It never assumes whether a city name means the airport, station, or downtown branch. **Example questions** 1. "Find a rental car at Lyon airport from Friday morning to Monday evening." 2. "I want to pick up a car at Lyon Part-Dieu and return it at Geneva airport." 3. "Show me rental locations near my hotel for a three-day round trip." 4. "I am 23 and live in France. Which rentals can I book?" ## Compare rentals Show the full cost and collection terms before the traveler chooses. ### Vehicle and supplier Each offer identifies the vehicle, rental company, rate package, and pick-up and return branches. A model marked "or similar" is not guaranteed, while a guaranteed model is the exact vehicle promised by the supplier. ### Price breakdown Jinko separates the amount paid now, charges due at the rental desk, and the security deposit held on the driver's card. The estimated total combines known rental charges, but the deposit remains a hold rather than a purchase. ### Branch and rate terms Show the branch address, local time zone, opening details, cancellation fee schedule, and whether the supplier must confirm the rental manually. If the supplier publishes no cancellation schedule, say the fee is unknown rather than calling the rental free to cancel. **Example questions** 1. "Which option has the lowest amount due at the desk?" 2. "Compare the deposit and cancellation terms for these two cars." 3. "Is this exact model guaranteed, or could I receive a similar car?" 4. "Which rental company and desk will I collect the car from?" 5. "Will this booking be confirmed immediately?" ## Book Build the rental around the actual driver and selected offer. ### Driver and contact details Add the driver's legal name and date of birth exactly as shown on their driving licence. The booking contact needs a title, email, and international phone number. ### Checkout and confirmation Jinko presents the vehicle, rental company, branches, dates, amount paid now, amount due at the desk, deposit, and cancellation terms before payment. After payment, Jinko follows fulfillment and returns the Jinko booking reference and supplier confirmation when available. Some offers need manual confirmation from the rental company. Jinko keeps these bookings pending until the supplier accepts or rejects them, instead of presenting them as confirmed too early. **Example questions** 1. "Book this car for the named driver." 2. "Confirm how much I pay now and how much is due at the desk." 3. "What card hold should I expect at pick-up?" 4. "Has the rental company confirmed my car yet?" ## Manage after booking Let travelers cancel a rental without guessing the fee or refund. Jinko starts by retrieving the booking and checking whether the selected car item can be canceled. A guest can access the flow with the Jinko booking reference and the driver's last name. > [!WARNING] > > If you need to cancel a car rental booking, please submit the cancellation through Jinko. If the traveler cancels directly with the rental company, Jinko is not notified and the refund may not be issued. ### Changes Changing the dates, vehicle, or extras is not available. The traveler can keep the rental or preview a cancellation, then book a new car after canceling. ### Preview the cancellation Before canceling anything, Jinko shows the current supplier fee and the refund left after that fee. The preview does not change the booking. If the fee is unknown, Jinko says it needs confirmation instead of presenting it as zero. ### Confirm and track Jinko submits the cancellation only after the traveler accepts the quoted fee and refund. It then tracks the supplier response and refund until the operation succeeds, fails, or requires Jinko support. **Example questions** 1. "Can I cancel this rental, and what fee would I pay?" 2. "How much will I get back if I cancel now?" 3. "I need a different car. What are my options?" 4. "Has the rental company confirmed my cancellation?" 5. "What is the status of my refund?" ## Related guides 1. [Car rental cancellation](/tools/car-cancel) 2. [Flight booking](/guides/flight-booking) 3. [Hotel booking](/guides/hotel-booking) 4. [Flight and hotel booking](/guides/flight-hotel-booking) # Checkout link Source: https://docs.gojinko.com/guides/checkout-link Send the traveler to a page Jinko hosts to review the trip and pay. Use a checkout link when a person should review the trip and enter the payment details themselves. Jinko hosts the payment page. The traveler sees the trip and its combined total, then completes the payment in the browser. Your system never collects or handles payment details. ## How it works 1. The agent builds the trip and receives its `trip_id`. 2. The agent calls `checkout` (or `POST /v1/checkout`) with that `trip_id`. 3. Checkout returns a `checkout_url`. When checkout answers `status: "partial"` instead, some items could not be priced and there is no link yet: see [When an item cannot be priced](/guides/trips-and-checkout#when-an-item-cannot-be-priced). 4. The agent sends or opens the link for the traveler. 5. The traveler reviews the trip and pays on the hosted page. Checkout books nothing and charges nothing. Until the traveler pays, the trip has no booking and no `booking_ref`. ## After the traveler pays Jinko starts the booking as soon as the payment succeeds. You do not call anything to confirm the payment. Read the trip (`get_trip`, or `GET /v1/trip/{trip_id}`) to follow `booking_state` and to get the Jinko booking reference `booking_ref` once it exists. ## Keep the link current Send the traveler the `checkout_url` from the latest checkout. If the travelers or the selected ancillaries change, call checkout again: it prices a new quote and returns a new `checkout_url` for it. # Flights Source: https://docs.gojinko.com/guides/flight-booking Discover, search, book, and manage flights with Jinko. Give travelers one conversation for the entire flight journey, from inspiration to post-booking support. ## Booking flow ```mermaid theme={null} flowchart LR A["AI search"] --> B["Live search"] B --> C["Build trip"] C --> D["Payment"] D --> E["Manage
change, cancel"] classDef jinko fill:#FFF4F4,stroke:#FF6363,color:#1A1A1A,stroke-width:2px; class A,B,C,D,E jinko; ``` ## Capabilities > [card] [AI search](#ai-search) > > Find destinations, better dates, and the right time to book. > [card] [Live search](#live-search) > > Confirm accurate live prices for the traveler's exact request. > [card] [Book](#book) > > Add travelers, preferences, extras, loyalty details, and payment. > [card] [Manage](#manage-after-booking) > > Support voluntary changes, cancellations, and refunds. ## Build the flow 1. **AI search:** help the traveler choose a destination, find dates, or decide when to book. 2. **Live search:** confirm accurate live prices for the traveler's exact request. 3. **[Build trip](/guides/trips-and-checkout):** add the selected fare, travelers, contact details, preferences, and extras. 4. **Payment:** create checkout, collect payment, and follow ticketing. 5. **Manage:** retrieve the booking and handle changes and cancellations. ## Test flights in sandbox Use Jinko Airline (`ZZ`) to test the complete flight flow in sandbox. It is the only sandbox airline designed to support search, booking, ticketing, extra bags, refunds, voids, and exchanges end to end. It sells no seat selection: test seats on a real airline (see [Seats](#seats)). Jinko Airline behaves predictably and each flight number triggers a documented success or failure scenario. Use flight ZZ101 for the normal flow. Search one of its supported routes, such as JFK to LHR, from tomorrow onwards and filter on carrier `ZZ`. Real airlines can also appear in sandbox, but their test inventory is limited and can change without notice. Keep automated end-to-end tests on Jinko Airline, then use production to validate real airline content. See [MCP sandbox setup](/connect/mcp#sandbox) and [Testing in sandbox](/guides/testing-in-sandbox) for routes and scenarios. ## AI search Jinko provides a set of AI search tools that help the agent reason through and answer complex questions from its customers. Destination and date tools use cached fare data to explore many options quickly, before the traveler has chosen an exact flight. ### Find a destination `find_destination` answers open-ended questions about where to go. It starts from one or more departure airports, then compares destinations by price within the traveler's dates, trip length, cabin, stop preference, and budget. **Example questions** 1. "Where can I go from Paris for a long weekend under €250?" 2. "Find a warm destination from London in March, direct flights only." 3. "What are the cheapest business-class destinations from New York next month?" ### Find the best dates `find_dates` is for travelers who know the route but can move their dates. It returns a varied shortlist of the cheapest date combinations across their travel window, instead of clustering every result around the same few days. **Example questions** 1. "When is the cheapest time to fly from Paris to New York in June?" 2. "Find the best weekends for a four-day trip from London to Lisbon." 3. "Show me a few affordable dates for one week in Tokyo." ### Know when to book `flight_price_advice` compares the current fare with typical prices for similar flights. It forecasts the price one day and three days ahead, estimates the probability of an increase, decrease, or no change, and recommends whether to buy now or wait. **Example questions** 1. "Is this a good price for this flight?" 2. "Should I book now or wait?" 3. "How likely is this fare to increase over the next three days?" > [!NOTE] > > Price advice is available when the request has enough statistical coverage. Initial numeric coverage focuses on one adult, nonstop flights, and USD fares. > [!NOTE] > > Use AI search results to compare possibilities, answer the traveler's questions, and build a shortlist. Because destination and date results use cached data, confirm the selected option with `flight_search` before showing a final, bookable price. ## Live search Turn the traveler's exact request into live flight options. `flight_search` uses live supplier pricing rather than the AI search cache. It returns accurate prices and availability for the exact search at that moment, ready to continue into booking. Jinko can combine route, dates, passengers, cabin, budget, airline, airport, schedule, baggage, fare conditions, and connection preferences in one search. The result is a set of live, bookable fares that respect those constraints. ### Search preferences 1. Exact dates, one-way trips, round trips, adults, children, and lap infants 2. Economy, premium economy, business, or first class 3. Direct flights or a maximum number of stops 4. Preferred or excluded airlines 5. Departure and arrival time windows for each direction 6. Minimum and maximum connection times 7. Preferred or excluded connection airports 8. Same-airline itineraries and no cross-city airport changes 9. Maximum journey time and total trip budget 10. Refundable or changeable fares 11. Fares that include checked baggage 12. Nearby or alternate airports **Example questions** 1. "Find two seats from Paris to New York next Friday, returning Sunday evening, direct only." 2. "I need a refundable business-class flight that arrives before 3 PM." 3. "Show me flights with one checked bag, no Heathrow connection, and no layover longer than two hours." 4. "Compare the cheapest option with the best schedule and explain the tradeoff." Jinko returns the itinerary, total price, fare options, baggage allowance, and known change or refund conditions. If nothing matches, Jinko explains which constraint blocked the search and asks what the traveler wants to relax. ## Book Build the booking around the traveler, not just the flight. ### Travelers and contact details Add the passenger information required for ticketing and one contact for booking updates. Jinko supports adults, children, and infants traveling on an adult's lap. ### Fare and baggage Let the traveler compare fare families and understand what each one includes. Before payment, Jinko can show cabin and checked baggage allowances and add extra bags when the airline offers them. See [Bags](/concepts/ancillaries/bags) for included allowances, selection, and booking outcomes. ### Seats Show available seats by traveler and flight segment. The traveler can choose a seat number based on the listed characteristics, such as window, aisle, or extra legroom. The seat map can load after the trip is priced: a seat offer with `seat_map_status: "pending"` has no seats yet, so read the trip again until it is `"ready"`. In sandbox, test seats on a real airline: Jinko Airline sells no seat selection. See [Testing in sandbox](/guides/testing-in-sandbox#seats). See [Seats](/concepts/ancillaries/seats) for the seat map page, selection flow, confirmation, charges, and refunds. ### Other services Other services, such as special assistance, sports equipment, priority boarding, lounge access, and insurance, are not in the catalog and cannot be added to a Jinko booking. ### Loyalty program Loyalty is a traveler detail, not an extra: it never appears in the ancillary catalog. Send each traveler's membership as `frequent_flyer: {airline, number}` on the traveler when you add travelers to the trip (`upsert_travelers`), before checkout. `airline` is the IATA code of the program issuer, such as `LH` for Lufthansa Miles & More, which can differ from the operating carrier. The trip returns it on the traveler. **Example questions** 1. "Book this fare for two adults and one child." 2. "Does this ticket include a checked bag? Add one if it does not." 3. "Can we sit together, with one window seat?" 4. "Add a second checked bag for the child." 5. "Use my Air France loyalty number for this booking." ### Checkout and confirmation Jinko presents the final itinerary, fare conditions, extras, and total before payment. After payment, Jinko follows fulfillment through ticketing and returns the Jinko booking reference and airline reference when available. ## Manage after booking Keep supporting the traveler after the ticket is issued. Jinko starts by retrieving the booking and checking what each flight item allows. A guest can access the flow with the Jinko booking reference and the lead traveler's last name. ### Voluntary exchange When the traveler wants to change a flight, Jinko can search alternatives for one leg or the full journey, price the selected option, and show the new itinerary, fare conditions, airline fee, and exact amount to pay or receive. The change is only submitted after the traveler confirms. **Example questions** 1. "Move my return flight to Sunday evening." 2. "What would it cost to fly one day earlier?" 3. "Change only the outbound flight and keep my return as booked." ### Voluntary cancellation Before canceling, Jinko previews whether the ticket can be voided or refunded. It shows the penalty, the amount returned to the traveler, and any extras handled separately. Nothing is canceled until the traveler confirms the quoted amount. **Example questions** 1. "Can I cancel this ticket, and how much will I get back?" 2. "Cancel my flight and track the refund." 3. "Was my paid seat refunded too?" ### Changes made by the airline Jinko does not detect a schedule change or a cancellation the airline makes after ticketing. No webhook reports one, and `get_booking` returns the itinerary as it was booked. See [Webhooks](/guides/webhooks#choose-events). ### Track every outcome Changes and cancellations expose a clear status until they succeed or fail. Jinko can report pending payments, ticket updates, refunds, and cases that need support without asking the traveler to restart the process. ## Related guides 1. [Flight exchanges](/guides/flight-exchanges) 2. [Flight refunds and cancellations](/tools/flight-refund) 3. [Flight and hotel booking](/guides/flight-hotel-booking) 4. [Hotel booking](/guides/hotel-booking) 5. [Car rental booking](/guides/car-rental-booking) # Hotels Source: https://docs.gojinko.com/guides/hotel-booking Search, compare, book, and manage hotel stays with Jinko. Give travelers one conversation for the entire hotel journey, from search to cancellation. ## Booking flow ```mermaid theme={null} flowchart LR A["Search by intent"] --> B["Build trip"] B --> C["Payment"] C --> D["Manage
cancel and refund"] classDef jinko fill:#FFF4F4,stroke:#FF6363,color:#1A1A1A,stroke-width:2px; class A,B,C,D,E jinko; ``` ## Capabilities > [card] [Search by intent](#search-by-intent) > > Match hotels to the traveler's intent, reviews, amenities, location, and budget. > [card] [Compare](#compare-hotels) > > Compare properties, rooms, prices, taxes, meals, and cancellation terms. > [card] [Book](#book) > > Add guests, contact details, special requests, and payment. > [card] [Manage](#manage-after-booking) > > Preview cancellation costs, confirm the request, and track the refund. ## Build the flow 1. **Search by intent:** match live hotels and rates to the traveler's full request. 2. **[Build trip](/guides/trips-and-checkout):** add the selected rate, guests, contact details, and special requests. 3. **Payment:** create checkout, collect payment, and follow fulfillment. 4. **Manage:** retrieve the booking, preview cancellation, and track the refund. ## Search by intent Find the hotels that best match what the traveler actually wants. Jinko understands the traveler's request, searches live inventory, and ranks the results by relevance. It can match a hotel on location, reviews, amenities, property style, room setup, and budget instead of returning a list based only on destination and dates. For example, a quiet, highly rated hotel with a gym near Times Square can rank above a cheaper property that only matches the dates. ### Matching criteria 1. Natural-language intent, such as quiet, romantic, family-friendly, or close to nightlife 2. Guest rating and minimum number of reviews 3. Pool, spa, gym, parking, Wi-Fi, restaurant, accessibility, and other amenities 4. Exact location or maximum distance from a point of interest 5. Hotel, apartment, resort, hostel, villa, ryokan, and other property types 6. Hotel chains, brands, and star rating 7. Total budget or maximum price per night 8. Check-in, check-out, room count, and guests in each room 9. Guest nationality and preferred currency **Example questions** 1. "Find a quiet four-star hotel near Times Square with a gym." 2. "I need two rooms in Barcelona, one for two adults and one for an adult with two children." 3. "Show me hotels in Paris with free cancellation and a pool under €250 per night." 4. "Does the Hotel Calimala have rooms for my dates, and what are the nearby alternatives?" ## Compare hotels Give travelers enough detail to choose a property, room, and rate with confidence. ### Property details Open the full hotel profile to show its photo gallery, address, star rating, guest rating, facilities, policies, and room descriptions. ### Rooms and rates Each rate includes the total stay price, room name, room capacity, meal plan, refundability, cancellation schedule, and known taxes. Jinko distinguishes taxes included in the price from charges due at the property. A traveler who found the same stay cheaper on another site can ask Jinko for that price: see [Best Price Guarantee](/guides/best-price-guarantee). ### Cancellation terms Show the free-cancellation deadline when the provider supplies one, then explain each penalty that applies after it. If a deadline or tax is unavailable, say that the provider did not return it instead of treating it as free or zero. **Example questions** 1. "Which of these hotels has the best pool and the strongest guest rating?" 2. "Compare the refundable room with the cheaper non-refundable rate." 3. "Does this price include breakfast and city tax?" 4. "Show me the room photos and tell me whether it has a balcony." 5. "Until when can I cancel for free?" ## Book Build the reservation around the actual guests and their stay. ### Guests and contact details Add each guest's legal name and one booking contact with email and phone. Keep the room split used during search, because hotel pricing and occupancy rules depend on who stays in each room. ### Special requests Send property requests such as late arrival, a quiet room, a high floor, a baby cot, or a non-smoking room. These are requests, not guarantees, so tell the traveler the hotel must still confirm them. ### Checkout and confirmation Jinko presents the property, room, dates, cancellation terms, taxes, special requests, and final total before payment. After payment, Jinko follows fulfillment and returns the Jinko booking reference and hotel confirmation when available. **Example questions** 1. "Book the refundable double room for these guests." 2. "Add a cot and ask for a quiet room away from the elevator." 3. "Use my partner as the booking contact." 4. "Confirm the final total and what I will pay at the property." ## Manage after booking Let travelers cancel a stay without guessing the cost or refund. Jinko starts by retrieving the booking and checking whether the selected hotel item can be canceled. A guest can access the flow with the Jinko booking reference and the lead traveler's last name. ### Preview the cancellation Before canceling anything, Jinko shows the supplier's policy, the current penalty, and the exact refund offered to the traveler. The preview does not change the booking. ### Confirm and track Jinko submits the cancellation only after the traveler accepts the quoted refund. It then tracks the supplier response and refund until the operation succeeds or fails. The same flow can remove a hotel from a trip that also contains a flight or car. **Example questions** 1. "Can I cancel this hotel, and how much will I get back?" 2. "Cancel only the hotel and keep the rest of my trip." 3. "Has the hotel confirmed my cancellation?" 4. "What is the status of my refund?" ## Related guides 1. [Hotel cancellation](/tools/hotel-cancel) 2. [Flight and hotel booking](/guides/flight-hotel-booking) 3. [Flight booking](/guides/flight-booking) 4. [Car rental booking](/guides/car-rental-booking) # Card payments Source: https://docs.gojinko.com/guides/partner-card-payments Submit a customer card or a virtual credit card (VCC) from your backend, and handle the outcomes specific to cards. ## When to use Use this guide to integrate raw customer cards or virtual credit cards (VCCs) through the REST API, using the typed payment submission. Start with a trip containing the selected items and travelers; see [Flight booking](/guides/flight-booking). Checkout discovery → submit to the returned pay URL → read the outcome → follow its recovery action. > [!NOTE] > > Card payments require PCI DSS compliance (see [Activation](#activation)) and are available to partners Jinko has enabled, in production and in sandbox: email [dev@gojinko.com](mailto:dev@gojinko.com) to enable yours. [Test in sandbox](#test-in-sandbox) gives the sandbox pay URL and the test card numbers. ## Discover what the tenant may use Call checkout with your tenant-bound booking key. The examples use placeholders only. ```bash theme={null} curl --request POST 'https://api.gojinko.com/v1/checkout' \ --header 'X-API-Key: ' \ --header 'Content-Type: application/json' \ --data '{"trip_id":""}' ``` An illustrative response excerpt for a tenant enabled for VCC payments: ```json theme={null} { "quote_id": "", "expires_at": "", "accepted_payment_types": [ { "type": "card", "card_kinds": ["vcc"], "collector": "jinko", "submit_url": "https://pay.gojinko.com/v1/agent_payment/submit", "requires": { "headers": ["Idempotency-Key"], "fields": ["trip_id", "quote_id", "payment.card_kind", "payment.number", "payment.exp_month", "payment.exp_year", "payment.cvc"] }, "authentication": "unavailable" } ] } ``` `accepted_payment_types` lists only presently usable combinations. A card entry has `type: "card"`, `card_kinds` (`customer_card` or `vcc`), required headers and fields, and `authentication` (`customer_handoff` or `unavailable`). A customer-card entry can advertise `customer_handoff`, and a Jinko-collected VCC has no handoff. A supplier-collected entry (`collector: "supplier"`) can also read `customer_handoff`, for any card kind, but no customer authentication is available for supplier-collected cards yet: see [Customer authentication handoff](#customer-authentication-handoff). A card entry always carries `submit_url`; `collector` is present only where channel mode exists (absent means Jinko collects). Use that `submit_url` for the submission instead of hard-coding a hostname. Checkout lists one `card` entry per card kind. A tenant enabled for both kinds gets two entries, one with `card_kinds: ["vcc"]` and one with `card_kinds: ["customer_card"]`, each with its own `authentication`: read the entry whose `card_kinds` contains the kind you will send. A tenant that is not enabled for cards gets no `card` entry at all. Use the quote ID and deadline that checkout returns. Never send card data speculatively: submit a card only when checkout lists `card` with the card kind you intend to use. ## Submit a card payment Raw customer cards and VCCs go to the **pay URL that checkout discovery returns** (`submit_url` on the card entry): `https://pay.gojinko.com/v1/agent_payment/submit` in production and `https://pay.sandbox.gojinko.com/v1/agent_payment/submit` in sandbox. The URL differs by environment: always use the one checkout returns and never hard-code a hostname. Never send raw cards to `api.gojinko.com`. Its own `POST /v1/agent_payment/submit` accepts shared payment tokens only and refuses `type: "card"` with 400 `CREDENTIAL_FORMAT_INVALID`. The pay URL uses the same headers, typed JSON body shape, response envelope and payment status codes as `api.gojinko.com`. Authenticate with a tenant-bound booking key (`jnk_…`), sent as `X-API-Key` or as `Authorization: Bearer`; OAuth/JWT bearer tokens are refused for typed bodies. `Idempotency-Key` is required. This curl template sends the body through standard input. Keep real card data out of shell history and command arguments; production requests belong in your secure backend. ```bash theme={null} curl --request POST '' \ --header 'X-API-Key: ' \ --header 'Idempotency-Key: ' \ --header 'Content-Type: application/json' \ --data-binary @- <<'JSON' { "trip_id": "", "quote_id": "", "payment": { "type": "card", "card_kind": "vcc", "number": "", "exp_month": , "exp_year": , "cvc": "" } } JSON ``` Replace the URL and quote placeholders with checkout's `submit_url` and `quote_id`. Replace `` and `` with JSON integers for the credential's expiration before sending; this placeholder template is not valid JSON until then. Use `card_kind: "customer_card"` for a customer card. `billing_details` is optional for a Jinko-collected card. When `collector` is `supplier`, also send `brand` and `billing_details.name`: see [Card brand](#card-brand) and [Cardholder name](#cardholder-name). ### Request fields The body carries `trip_id`, `quote_id` and `payment`. An unknown field, a `null` value and each value the Rule column marks as refused are answered with 400 `CREDENTIAL_FORMAT_INVALID`, before any payment attempt exists. | Field | Type | Required | Rule | | - | - | - | - | | `trip_id` | string | yes | The trip, written `"123"` or `"trip_123"`. | | `quote_id` | string | yes | The `quote_id` checkout returned. | | `payment.type` | string | yes | `"card"`. | | `payment.card_kind` | string | yes | `"customer_card"` or `"vcc"`: a kind the checkout card entry lists. | | `payment.number` | string | yes | The card number. Send digits only, without spaces or dashes. | | `payment.exp_month` | integer | yes | 1 to 12. A string such as `"09"` is refused. | | `payment.exp_year` | integer | yes | Four digits, for example `2030`; a two-digit year is refused. A card whose expiration date has passed is refused. | | `payment.cvc` | string | yes | 3 or 4 digits. | | `payment.brand` | string | when `collector` is `supplier` | See [Card brand](#card-brand). | | `payment.billing_details` | object | `name`, when `collector` is `supplier` | `name`, `email`, `phone` and `address`. When `collector` is `supplier`, `name` is required (see [Cardholder name](#cardholder-name)); otherwise each is optional. `address` takes `line1`, `line2`, `city`, `state`, `postal_code` and `country`, a two-letter ISO 3166-1 code such as `US`; a three-letter code is refused. | The checkout card entry names the fields this trip requires in `requires.fields`: send every field it lists. ### Card brand `payment.brand` is optional: `visa`, `mastercard`, `amex`, `discover`, `diners`, `jcb` or `unionpay`. Send the known brand, especially for channel mode, where the supplier needs it. If omitted, a Jinko-collected attempt proceeds without it, while a supplier-collected attempt is refused, so always send the brand when `collector` is `supplier`. A supplier-collected attempt accepts `visa`, `mastercard`, `amex`, `discover` and `diners` only; `jcb` and `unionpay` are refused before acceptance. ### Cardholder name When `collector` is `supplier`, checkout lists `payment.billing_details.name` in `requires.fields`: send it. Write the cardholder's name as it appears on the card, given name or names first, then a space and the surname, for example `Jane Doe`. A supplier-collected attempt can refuse a name without both parts with 400 `CREDENTIAL_FORMAT_INVALID`, before acceptance. For a Jinko-collected card, the name stays optional. ### Card data and resubmission Send the card number and CVC with every new submission, over HTTPS from your backend. Submitted card details can be used for a short time only. When an accepted attempt can no longer use them, it returns `payment_error.code: "CARD_ALIAS_EXPIRED"`. Follow `recovery.action`: `retry_new_key` (submit the card again to the pay URL with a new `Idempotency-Key`), `poll` while the attempt reads `cancelling` (resubmit only once the action changes), or `recheckout` once the quote has expired. Every new card submission needs a new `Idempotency-Key`: the same key replays the same attempt, and a different card sent under it is not tried. See [Retries never charge twice](/guides/payment-outcomes#retries-never-charge-twice) for the full rules. ### When the submission answers 503 A 503 `TEMPORARILY_UNAVAILABLE` answer carries no `payment_attempt_id`, so it does not tell you whether an attempt was created. Send the same request again, with the same card and the same `Idempotency-Key`. Wait for `Retry-After` when the answer carries it. The answer can also come with no `Retry-After`, no `payment_error` and no `recovery`; wait a few seconds, then send it again. Do not switch to a new key: if the first request did create an attempt, the same key returns that attempt's outcome instead of charging again. ## Who charges the card Read `collector` on the card entry in checkout discovery and on each trip item returned by `GET /v1/trip/{trip_id}` (the payment attempt does not carry it). | `collector` | Charge and refund responsibility | | - | - | | `jinko` | Jinko authorises and captures through its acquirer. Refunds come from Jinko. | | `supplier` | Channel mode: the airline or hotel supplier charges the card itself. There is no Jinko authorisation or capture, so a successful attempt ends `authorized`, never `captured` (see [Supplier-collected outcomes](#supplier-collected-outcomes)); refunds follow the supplier's rules. | Channel mode is configured per partner and supplier, subject to supplier support. An order cannot mix collectors. Split items into separate trips if they need different collectors; checkout does not advertise `card` for a trip with mixed collectors, and card submission is refused with `PAYMENT_TYPE_NOT_ENABLED`. ## Read the outcome The card submission answers with the same `PaymentAttemptOutcome` as every typed payment. Read it, poll the attempt while its `recovery.action` is `poll`, and follow its action as described in [Payment outcomes and retries](/guides/payment-outcomes). The sections below cover how card outcomes are handled. ### Supplier-collected outcomes When `collector` is `supplier`, Jinko takes no money: the attempt never reads `captured`, and it carries no `money` block. | You read | It means | | - | - | | `payment_status: "authorized"`, `recovery.action: "poll"` | The airline is being asked to issue the ticket. Keep polling. | | `payment_status: "authorized"`, `booking_status: "completed"`, `recovery.action: "stop"` | Ticketed: the airline has charged the card. This is the final state of a successful attempt. | **A refusal waits for Jinko operations.** When the airline refuses the card at ticketing, or its answer does not say whether the ticket was issued, the attempt can keep reading `authorized`, with `booking_status: "processing"` and `recovery.action: "poll"`, until Jinko operations close the booking. No failure email or `booking.failed` webhook is sent while it waits. Once Jinko closes it as failed, the booking reads `failed`, `booking.failed` fires and the traveler receives the failure email. While the booking reads `processing`, you cannot tell whether the card was charged: keep polling, never submit a second payment, and contact support with the trip, quote and payment attempt identifiers if you need an answer sooner. ## Customer authentication handoff For Jinko-collected cards, `authentication` is returned only for `customer_card` attempts in `requires_authentication`, with `recovery.action: "authenticate"`. Send the customer to the returned `authentication.url` unchanged before `authentication.expires_at`. Never parse or reconstruct it. Keep polling `GET /v1/trip/{trip_id}/payment_attempts/{payment_attempt_id}` while the customer authenticates. The handoff completes 3-D Secure (3DS) on the existing attempt. A Jinko-collected VCC never receives an authentication handoff. After the customer returns, read the attempt. A browser return is not proof of authorization. Closing the browser before the deadline does not itself prove failure; poll. A verified authentication failure requires cleanup. Authentication still incomplete at the deadline becomes abandoned; poll cleanup, then recheckout when instructed. > [!NOTE] > > **Not available yet for supplier-collected cards.** A supplier-collected card entry (`collector: "supplier"`) can read `authentication: "customer_handoff"`, but no customer authentication runs for these cards yet: Jinko hands the customer no 3DS challenge, and passes no 3DS result to the airline. Use cards that do not need a challenge. ## VCC policy A Jinko-collected VCC has no customer authentication handoff. If such a VCC needs authentication, do not open a hosted payment flow or ask a traveler to authenticate it. Obtain a replacement credential that can complete without a handoff. Wait until the attempt permits replacement and cleanup is complete; then use a new key on a valid quote, or recheckout as directed. Fulfillment never falls back to hosted payment for a VCC. ## Card outcome codes These codes need card-specific handling. Every code, and the action it asks for, is listed under [Payment outcome codes](/concepts/errors#payment-outcome-codes). Always obey the returned `recovery.action`. | Code | Meaning and caller action | | - | - | | `CARD_ALIAS_EXPIRED` | Accepted attempt, not a refusal. Follow `recovery.action`: `retry_new_key` (resubmit to the pay URL with a new key), `poll` while it reads `cancelling`, or `recheckout` once the quote expired | | `CARD_DECLINED` | Replace the card and use a new key on a valid quote once quiescent | | `AUTHENTICATION_REQUIRED` | Jinko-collected customer card: follow `authentication.url`; Jinko-collected VCC: no handoff, replace the credential once allowed | | `AUTHENTICATION_FAILED` | Poll cleanup, then replace the card or recheckout | | `AUTHENTICATION_ABANDONED` | Follow the returned action; for Jinko-collected authentication, poll cleanup, then recheckout | Quiescent means the earlier attempt has finished cleanup and the returned recovery action permits another attempt. ## Failure table Statuses can change during cleanup. Read the latest outcome and its recovery action before acting. | Failure | Status / code | What the partner may do | What fulfillment does | | - | - | - | - | | Decline | `declined` / `CARD_DECLINED` | Replace the credential and use a new key on a valid quote once quiescent. | Never books on a decline. | | Submitted card details expired | `declined` or `cancelling` / `CARD_ALIAS_EXPIRED` | Follow `recovery.action`: poll while it reads `cancelling`, then resubmit with a new key, or recheckout if the quote expired. | Does not use expired card details; another submission while the attempt reads `cancelling` is refused. | | Customer 3DS needed | `requires_authentication` / `AUTHENTICATION_REQUIRED` | Follow `authentication.url`, then poll. | Waits for verified authentication; no booking merely because the browser returned. | | Jinko-collected VCC needs authentication | `declined` / `AUTHENTICATION_REQUIRED`; cleanup may be pending | Poll cleanup; replace the credential only when allowed. | Never falls back to hosted payment for a Jinko-collected VCC. | | Verified 3DS failure | `AUTHENTICATION_FAILED`; cleanup may be pending | Poll cleanup, then replace the credential or recheckout as directed. | Cleans up the failed attempt; does not book it. | | Browser closed before deadline | `requires_authentication` / `AUTHENTICATION_REQUIRED` while still awaiting authentication | Poll; the browser closing is not a terminal result. | Waits for verified authentication or the deadline. | | Jinko-collected authentication incomplete at deadline | `AUTHENTICATION_ABANDONED`; cleanup may be pending | Poll cleanup, then recheckout. | Cancels the incomplete attempt; does not book it. | | Authorization not admitted before expiry | `expired` / `QUOTE_EXPIRED` after cleanup | Poll any cleanup, then recheckout when instructed. | Does not book against an expired quote; releases any authorization requiring cleanup. | | Provider response lost | `pending` / `PAYMENT_OUTCOME_UNKNOWN` | Poll the same attempt until its recovery action permits another submission. | Resolves the provider outcome before deciding whether booking may proceed. | | Quote expired before attempt | 410 `QUOTE_EXPIRED`, refused before an attempt exists | Recheckout. | No payment is accepted and no booking starts. | | Quote did not price every item | 410 `QUOTE_EXPIRED` with `reason: partial_quote`, refused before an attempt exists | Remove or replace the items with `quote_status: failed` (after `provider_error`, no change is needed), then recheckout. | No payment is accepted and no booking starts. | | Processing delayed | `FULFILLMENT_DISPATCH_DELAYED` | Poll; do not send a second payment. | Continues the existing payment and booking. | | Reconciliation failure | `RECONCILIATION_REQUIRED` | Contact support with the attempt identifier. | Jinko resolves it; no duplicate payment or booking. | | Airline refusal or unclear ticketing answer (`collector: "supplier"`) | `authorized` / `poll`, booking `processing` | Keep polling; never submit a second payment. Contact support for an answer sooner. | Does not send the card again; Jinko operations close the booking. See [Supplier-collected outcomes](#supplier-collected-outcomes). | ## Money outcomes after booking For `collector: "supplier"`, the supplier handles the charge and refund under its rules; do not expect Jinko authorisation, capture or refund amounts. The attempt stays `authorized` and carries no `money` block. For `collector: "jinko"`, read `money` as described in [Money outcomes after booking](/guides/payment-outcomes#money-outcomes-after-booking). ## Test in sandbox Once your sandbox tenant is enabled (see [Activation](#activation)), the flow is the same as in production: call checkout on `https://api.sandbox.gojinko.com` with a sandbox key, then submit the card to the `submit_url` it returns, `https://pay.sandbox.gojinko.com/v1/agent_payment/submit`. [Testing in sandbox](/guides/testing-in-sandbox) describes the test flights to put in the trip. Use the card numbers below, with any expiration date in the future and any three-digit CVC. Never send a real card number in sandbox. | Card number | `card_kind` | Outcome of the submission | | - | - | - | | `4242 4242 4242 4242` | `customer_card` or `vcc` | The payment is authorized without authentication: `authorized`, then `captured` once the trip is booked. | | `4000 0027 6000 3184` | `customer_card` | The card needs 3DS: `requires_authentication` with `AUTHENTICATION_REQUIRED`, `recovery.action: "authenticate"` and `authentication.url`. The test challenge can be completed on that page. | | `4000 0027 6000 3184` | `vcc` | The card needs 3DS and a Jinko-collected VCC has no handoff: `declined` with `AUTHENTICATION_REQUIRED` and `recovery.action: "retry_new_key"`. | | `4000 0000 0000 0002` | `customer_card` or `vcc` | The card is declined: `declined` with `CARD_DECLINED` and `recovery.action: "retry_new_key"`. | The spaces are for reading only: send each number as digits. ## Security and data handling Send credentials only from your secure backend over HTTPS. Raw card data must never pass through prompts, MCP, CLI arguments, logs, traces, analytics, support tickets, or stored request bodies. The examples contain placeholders, not usable card credentials. Jinko never returns the card number or CVC in a response. Keep attempt, trip, quote, and request identifiers for recovery and support: the pay URL returns `X-Jinko-Request-ID` on every answer; quote it when you contact support. The `X-Request-ID` on the answer can differ from the one you sent, so identify a submission by `X-Jinko-Request-ID`. Never include the card data when reporting an issue. ## Activation Card payments require your organization to be PCI DSS compliant. Your backend receives and sends card numbers and CVCs, so the systems that handle them are in scope for PCI DSS. Card kinds are disabled per tenant by default. Email [dev@gojinko.com](mailto:dev@gojinko.com) to arrange enablement, then confirm that checkout lists `card` with the card kind you need. Production and sandbox are enabled separately: say which one you need. MCP and CLI remain SPT-only. Use the typed REST contract for raw customer cards and VCCs. # Payment outcomes and retries Source: https://docs.gojinko.com/guides/payment-outcomes Pay the quote the traveler approved, retry without paying twice, and follow the recovery action of every payment you submit. These rules apply to every payment you submit to Jinko: a Shared Payment Token, and any other payment type checkout lists in `accepted_payment_types`. A [checkout link](/guides/checkout-link) payment happens on the hosted page and needs none of them. ## Pay the quote the traveler approved Pass the `quote_id` from the checkout the traveler approved. The payment is then taken against that quote only: * A `quote_id` that is not one of the trip's quotes is refused with `NOT_FOUND`, and nothing is charged. * A quote that cannot be paid, because it passed its `expires_at`, the travelers changed after it was priced, an item was added to the trip or removed from it after it was priced (`reason: "items_changed"`), or it could not price every item (`reason: "partial_quote"`), is refused with `QUOTE_EXPIRED`, and nothing is charged. Run checkout again, show the new total, and pay the new `quote_id`. For `partial_quote`, first remove or replace the items with `quote_status: "failed"`, unless their `failure_reason` is `provider_error`; see [When an item cannot be priced](/guides/trips-and-checkout#when-an-item-cannot-be-priced). * Running checkout again returns the same `quote_id` while that quote is still valid and the trip has not changed. A partial quote is never reused: checkout prices the trip again and returns a new `quote_id`. After an item is added to the trip or removed from it, checkout also prices the trip again, and the earlier quote can no longer be paid. When checkout returns a new `quote_id`, a payment that names the earlier one is still charged the earlier total while that quote is valid, never a price the traveler did not see. A typed submission must include `quote_id`: without it the request is refused with 400 `CREDENTIAL_FORMAT_INVALID`. ## Retries never charge twice A typed submission to `POST /v1/agent_payment/submit` carries an `Idempotency-Key` header. The header is required: without it the request is refused with 400 `CREDENTIAL_FORMAT_INVALID`. Use 1 to 255 printable ASCII characters and one key per intended payment. * **The first accepted request wins.** Sending it again with the same key returns that attempt's outcome instead of charging again. * The key is compared on the trip, the quote, the payment type, the card kind (`customer_card` or `vcc`, for a card), the amount and the currency, not on the credential itself. The same key with the same trip and quote replays the first outcome even when the credential differs: the new credential is never tried. To pay with another credential, use a new key, and only when the outcome allows another attempt. * The same key with a different trip, quote, payment type, card kind, amount or currency is refused with 409 `IDEMPOTENCY_KEY_REUSED`. * A request refused before acceptance with 400 `CREDENTIAL_FORMAT_INVALID` does not use up its key: correct it and send it again with the same key, unless the `Idempotency-Key` itself was refused. * A timeout is not permission to create a new attempt. Send the same request with the same key, or read the attempt, and follow `recovery.action`. * A 503 `TEMPORARILY_UNAVAILABLE` answer carries no `payment_attempt_id`, so it does not tell you whether an attempt was created. Send the same request again with the same key, after `Retry-After` when the answer carries it. The answer can come with no `Retry-After`, no `payment_error` and no `recovery`; wait a few seconds, then send it again. ## Read the outcome A typed submission answers with a `PaymentAttemptOutcome`: | Field | What to read | | - | - | | `payment_attempt_id` | Save this identifier to read the same attempt again. | | `payment_status` | One of `pending`, `requires_authentication`, `authorized`, `captured`, `declined`, `cancelling`, `cancelled`, `expired`, `failed`. | | `booking_status`, `booking_ref` | Booking progress and the booking reference when available. Authorization alone does not mean booked. | | `payment_error` | `{code, message}` or `null`. Branch on the code, not the message. | | `recovery` | Exactly one `action`, plus `replacement_credential_required`. | | `recovery_status` | `automatic` or `manual_review`. | | `quote_expires_at` | The quote deadline, when returned: the same time checkout and the trip's `quote` give as `expires_at`. | | `retry_after_seconds` | When to poll again, when returned. | | `authentication` | Customer authentication `url` and `expires_at`, when returned. | | `money` | Amounts and resolution details described below, when available. | **200 means a known outcome, including a decline.** It does not mean the payment or booking succeeded. **202 means the attempt is still in progress** (`pending` or `cancelling`). Wait for the `Retry-After` interval, then poll the attempt: ```bash theme={null} curl 'https://api.gojinko.com/v1/trip//payment_attempts/' \ --header 'X-API-Key: ' ``` The `{trip_id}` in this path accepts either `trip_` or `` (for example, `trip_123` or `123`). A `trip_id` that is not the attempt's trip returns 404 `NOT_FOUND`. Over MCP, read the same attempt as `payment_attempt` on `get_trip`. Honor the returned polling interval (`Retry-After` / `retry_after_seconds`). Keep reading the same attempt while its action is `poll`, including during cancellation or an unknown provider outcome. Do not submit a second payment to resolve a pending booking. When Jinko collects the payment, an attempt that succeeds reads `authorized` with `recovery.action: "poll"`, then `captured` with `recovery.action: "stop"`. Stop polling on the action, not on `booking_status`: an `authorized` attempt can still read `poll` after `booking_status` has become `completed`. When the supplier charges the card (`collector: "supplier"`, see [Supplier-collected outcomes](/guides/partner-card-payments#supplier-collected-outcomes)), a successful attempt stays `authorized` and ends with `recovery.action: "stop"` once `booking_status` is `completed`. It never becomes `captured`, because Jinko takes no money. ## Recovery actions Always obey the returned recovery action. A code alone does not establish that cleanup has finished or that the quote is still usable. | `recovery.action` | Caller action | | - | - | | `poll` | Wait and read the existing attempt. | | `authenticate` | Send the customer to the returned `authentication.url`. | | `retry_same_key` | Retry with the same key; correct pre-acceptance validation errors first. | | `retry_new_key` | Start the permitted new attempt; replace the credential if `replacement_credential_required` is true. | | `recheckout` | Call checkout again and use its fresh quote and payment options. | | `contact_support` | Give Jinko the attempt and request identifiers for reconciliation. | | `stop` | The attempt is final: do not retry this operation. When Jinko collects the payment, a payment that succeeded ends here, with `payment_status: "captured"`; when the supplier charges the card, with `payment_status: "authorized"`. | Each `payment_error.code` and the action it asks for is listed under [Payment outcome codes](/concepts/errors#payment-outcome-codes). ## Money outcomes after booking When Jinko collects the payment, `money` reports `authorized`, `captured`, `released`, `refunded`, and `externally_reimbursed` as Money objects with `display`. Use `display` for presentation. Read `resolution_status` (`pending`, `resolved`, `manual_review`, `external_reimbursement_pending`, or `externally_reimbursed`) and `refund_reference` when available; missing amounts are not evidence of zero money movement. * **Definitive booking failure before capture:** the authorization is voided and released; the payment becomes `cancelled` after cleanup. * **Definitive booking failure after capture:** the captured amount is refunded; read `refunded` and `resolution_status: "resolved"`. * **Partial delivery:** exactly the booked items are captured, with the remainder released; `booking_status` is `partial`. * **Result cannot be verified:** `RECONCILIATION_REQUIRED` / `manual_review`; contact support. Jinko does not guess whether money moved or a booking succeeded. # Payments Source: https://docs.gojinko.com/guides/payments How checkout lists the ways to pay for a trip, and which one to use. Every payment starts from checkout. The `trip` tool builds the trip and returns a `trip_id`. The agent passes that ID to `checkout`, which prices the full trip, returns the priced quote's `quote_id` and `expires_at`, and lists the ways this trip can be paid. ```mermaid theme={null} flowchart LR T["trip
returns trip_id"] --> C["checkout
prices the trip"] C --> P["Pay with one method
checkout offers"] P --> F["Booking starts"] classDef jinko fill:#FFF4F4,stroke:#FF6363,color:#1A1A1A,stroke-width:2px; class T,C,P,F jinko; ``` Checkout books nothing and charges nothing. The booking starts only once the trip is paid. ## Choose a payment method * **[Checkout link](/guides/checkout-link):** use it when a person should review the trip and pay on a page Jinko hosts. Checkout returns it as `checkout_url`. * **[Shared Payment Token](/guides/shared-payment-token):** use it when your agent platform pays programmatically, without sending the traveler to a payment page. Checkout returns `agent_spt_params` to mint the token. * **[Card](/guides/partner-card-payments):** use it when your secure backend holds a customer card or a virtual credit card (VCC) and submits it through the REST API. A checkout that answers `status: "partial"` offers no payment method: some items could not be priced, and the trip cannot be paid until a new checkout prices every item. See [When an item cannot be priced](/guides/trips-and-checkout#when-an-item-cannot-be-priced). ## What checkout offers for this trip On the REST API, checkout's `accepted_payment_types` lists the payment types you can submit for this trip, with the headers and fields each one requires. Submit only a type it lists. Pay with the `quote_id` from the checkout whose total the traveler approved, so the traveler is charged the amount they saw. Running checkout again returns the same `quote_id` while that quote is still valid and the trip has not changed; otherwise it prices the trip again and returns a new `quote_id`. [Payment outcomes and retries](/guides/payment-outcomes) explains what happens when that quote has expired. ## After payment Read the trip (`get_trip`, or `GET /v1/trip/{trip_id}`) for `booking_state` and the Jinko booking reference `booking_ref`. A submitted payment answers with a payment outcome and a recovery action; [Payment outcomes and retries](/guides/payment-outcomes) explains how to read it and how to retry without paying twice. # Send your own customer emails Source: https://docs.gojinko.com/guides/send-your-own-emails Use Jinko webhook data to send booking emails in your own brand. Jinko webhook events can include the subject, recipient, content, and calendar files for each traveler email. Use this data to send booking and servicing emails in your own brand. ## How it works 1. Subscribe to the booking and servicing events you need. 2. Read each entry in `data.customer_emails`. 3. Render the content with your own templates and branding. 4. Send the email to the address in `customer_emails[].to`. You can send your emails alongside Jinko's or ask Jinko to stop its own emails for your tenant. ## Before you start Create a webhook subscription for your tenant on the [Webhooks page in the dashboard](https://dashboard.gojinko.com/developers/webhooks). The [Webhooks guide](/guides/webhooks) explains endpoint registration, signature verification, retries, and replay. This page covers the email data carried by those events. ## Events and the emails they carry | Event | `status` (deprecated) | When it fires | Jinko's emails at that moment | Fallback | | - | - | - | - | - | | `booking.processing` | `processing` | Payment is authorized and the booking is being confirmed with the suppliers. No supplier reference exists yet. | `booking-confirmation` | no | | `booking.completed` | `confirmed` | Every item of the booking is confirmed. A seat can still be pending (see below). | `flight-ticketing-confirmation`, `hotel-booking-confirmation`, `booking-confirmation` (one for ground items, one for car items) | yes | | `booking.failed` | `failed` | The booking could not be confirmed. The payment hold is released and nothing is charged. | `booking-failed` | yes | | `servicing.completed` | `servicing.completed` | A cancellation of one booked item is complete and its money is settled. A cancellation can refund nothing, for example on a non-refundable item: `data.refund` is then `null`. | `flight-cancellation`, `hotel-cancellation`, `car-cancellation` | yes | | `servicing.exchange_confirmed` | `servicing.exchange_confirmed` | The supplier confirmed an exchange of one booked item. For a flight, the new e-ticket number can follow in `servicing.ticket_issued`. | `flight-exchange` | yes | | `servicing.ticket_issued` | `servicing.ticket_issued` | The new e-ticket number of an exchanged flight is available. | `flight-exchange-ticket-number` | yes | | `servicing.failed` | `servicing.failed` | An exchange or a refund could not be completed. The original booking is unchanged unless the payload says otherwise. | `exchange-failed`, `refund-failed` | yes | **Seat confirmation:** Jinko sends `booking.completed` and the flight booking confirmation email once the flight is ticketed, even if a seat is still pending. Read `booked_ancillaries` for each seat's outcome. Keep the seat pending in your confirmation email until its outcome is known. See [Webhooks](/guides/webhooks#choose-events) and [Seat maps](/concepts/ancillaries/seats). 1. One event can carry several emails. A trip with a flight and a hotel can produce two entries in one `booking.completed` event. 2. When Jinko emails are on, Jinko sends its email before the event. 3. `booking.partial` carries no `customer_emails` because Jinko sends no email at that moment. 4. Treat `event_id` as an opaque value. Retries of the same event reuse it. 5. The **Fallback** column shows whether Jinko sends its email when your endpoint does not receive the event. The webhook form in the dashboard lists every event. With a legacy person-bound key, pass the event names in `events` on `POST /v1/webhooks`. ## What an event carries Each event keeps the six envelope fields and any `data` it already had (see [Webhooks](/guides/webhooks)). Its `data` gains one `customer_emails` entry per email and, when the email carries it, the manage-booking link: ```json theme={null} { "event": "booking.completed", "booking_ref": "JNK-8F3D21", "status": "confirmed", "occurred_at": "2027-06-02T08:00:00Z", "event_id": "evt_e5a09b3c7d12", "livemode": true, "data": { "manage_booking_url": "https://app.gojinko.com/bookings/JNK-8F3D21?ln=Martin", "customer_emails": [ { "template": "flight-ticketing-confirmation", "to": "jane.martin@example.com", "subject": "Your tickets are confirmed: JNK-8F3D21", "content": { "pnr": "JNK-8F3D21", "airline_pnr": "XM9L7Q", "destination_city_name": "Paris", "passengers": [ { "first_name": "Jane", "last_name": "Martin", "type": "Adult", "ticket_number": "0167654321098" } ] } }, { "template": "hotel-booking-confirmation", "to": "jane.martin@example.com", "subject": "Your stay at Hôtel Marais is confirmed", "content": { "pnr": "JNK-8F3D21", "supplier_booking_id": "4412983", "hotel": { "name": "Hôtel Marais" }, "stay": { "duration_label": "3 nights" }, "guests": [{ "first_name": "Jane", "last_name": "Martin" }] }, "calendar": { "files": [ { "method": "REQUEST", "filename": "jinko-JNK-8F3D21.ics", "content_type": "text/calendar; charset=utf-8; method=REQUEST", "content": "BEGIN:VCALENDAR\r\n…" } ] } } ] } } ``` | Field | Notes | | - | - | | `data.manage_booking_url` | The manage-booking link Jinko's emails carry. It includes the traveler's last name. Absent on `booking.failed`, `servicing.ticket_issued` and `servicing.failed`. | | `data.customer_emails[]` | One entry per email Jinko sends, or would send, at that moment, in sending order. The entries are the same whether Jinko's own emails are on or off. | | `customer_emails[].template` | Which email this is. It tells you the shape of `content`. | | `customer_emails[].to` | The address Jinko's email goes to: the booking contact. Absent when the booking has none. | | `customer_emails[].subject` | The subject line of Jinko's email. | | `customer_emails[].content` | The values the email shows, under snake_case keys. Dates, times and amounts are display strings, formatted as the email shows them. Empty values are left out; numbers and booleans are always sent. Styling (brand, colors, header copy) is not included. | | `customer_emails[].calendar` | The calendar files the email attaches, in the `{ files: [{ method, filename, content_type, content }] }` shape of the booking read. Present only when the email attaches one. | The example shows only some fields of each `content`. The `content` shape of each template is a schema named after the template: for example `FlightTicketingConfirmationEmailContent` or `HotelCancellationEmailContent`. They are in the [OpenAPI contract](https://api.gojinko.com/doc), and in the API reference under the delivery `payload` of [`GET /v1/webhooks/{id}/deliveries`](/api/webhooks/deliveries). A later version can add fields to `content` and entries to `customer_emails`, so ignore what you don't use. The three new `servicing.*` events also carry `operation_kind` (`cancel`, `void`, `exchange` or `refund`) and, when known for that operation, `booked_item_id`, `booking_ref` and `operation`. `servicing.completed` keeps every field described in [Webhooks](/guides/webhooks). `booking.failed` keeps `failure_reason` and `failure_message`. > [!WARNING] > > These payloads contain traveler data: names, email addresses, itineraries and ticket numbers. Jinko keeps the payload of each delivery for the delivery log and replay, and deletes it 30 days after the delivery's last attempt or replay. ## Use your own email delivery Jinko can turn off its customer emails for one tenant. Email [dev@gojinko.com](mailto:dev@gojinko.com) with the tenant ID and environment. 1. **Per tenant and environment:** sandbox and production are configured separately. 2. **All or nothing:** Jinko turns off every email in the table for that tenant, except fallback emails. 3. **Tenant-key bookings only:** bookings made with legacy person-bound keys keep Jinko emails. 4. **Fast activation:** the change applies within about a minute, including to bookings already in progress. 5. **No webhook change:** events and `customer_emails` stay the same. ## When Jinko still sends its email When Jinko emails are off, an event marked **yes** in the Fallback column still triggers a Jinko email if none of the tenant's subscriptions receive it: 1. No subscription includes the event. 2. Every delivery reaches its last failed attempt after 8 attempts over about 80 minutes. 3. The delivery outcome is still unknown 3 hours after the event. Jinko sends a fallback email once. When any subscription received the event, Jinko sends nothing. A replay of the event after the fallback does not withdraw the email Jinko already sent. `booking.processing` has no fallback: with emails off, Jinko does not send the payment-authorized email. ## Handle delivery issues Every delivery attempt is recorded. Use the delivery log to inspect failures and replay an event. 1. **Dashboard:** open [Webhooks in the dashboard](https://dashboard.gojinko.com/developers/webhooks), select the webhook, then open **Deliveries**. 2. **API with a legacy person-bound key:** [`GET /v1/webhooks/{id}/deliveries`](/api/webhooks/deliveries) lists deliveries. [`POST /v1/webhooks/{id}/deliveries/{delivery_id}/replay`](/api/webhooks/replay) replays one. | `status` | Meaning | | - | - | | `pending` | Not attempted yet, or a replay is queued. | | `delivered` | Your endpoint answered `2xx`. | | `failed` | The last attempt failed and another one is scheduled. Deliveries that failed before this log existed are not retried and can't be replayed. | | `exhausted` | The last of the 8 attempts failed. Jinko does not retry it. | A replay sends the same event again: same `event_id`, same payload, signed with a new `X-Jinko-Timestamp`. It starts a fresh set of attempts and adds one to the delivery's `replay_count`. Replay is accepted for a `delivered` or `exhausted` delivery. It is refused with `delivery_in_progress` while the delivery is `pending` or `failed`, and with `payload_purged` once its payload has been deleted, 30 days after the delivery's last attempt or replay. Because a replay keeps the `event_id`, a receiver that deduplicates on `X-Jinko-Event-Id` treats it as the event it already processed, if it did. # Shared Payment Token Source: https://docs.gojinko.com/guides/shared-payment-token Let your agent platform pay for the trip programmatically with a token scoped to the checkout. Use a Shared Payment Token (SPT) when the agent should pay programmatically without sending the traveler to a payment page. The token is limited to the payment details returned by checkout. The agent never receives the underlying card details. ## How it works 1. The agent calls `checkout` with the `trip_id`. 2. Checkout returns the total, its `quote_id` and `expires_at`, and `agent_spt_params` with the maximum amount, currency, and payment profile. 3. The agent platform uses those parameters to mint a Shared Payment Token. 4. The agent submits the token with the `trip_id` and the `quote_id` the traveler approved. 5. Jinko authorizes the payment and starts fulfillment. If the travelers changed since checkout, an item was added to the trip or removed from it, or the quote passed its `expires_at`, call checkout again, get the traveler's approval of the new total, and mint a new token against the new `agent_spt_params`. A stale quote is refused with `QUOTE_EXPIRED`, and nothing is charged. When checkout answers `status: "partial"`, it returns no `agent_spt_params`: some items could not be priced, and a payment of that quote is refused with `QUOTE_EXPIRED` and `reason: "partial_quote"`. See [When an item cannot be priced](/guides/trips-and-checkout#when-an-item-cannot-be-priced). ## Submit the token **MCP:** call `submit_agent_payment` with the `trip_id`, the `quote_id` and the token. On success the answer carries the Jinko booking reference `booking_ref`; `get_trip` returns the same `booking_ref` if the reply is lost. **REST:** send a typed submission to `POST /v1/agent_payment/submit` with an `Idempotency-Key` header: ```http theme={null} POST /v1/agent_payment/submit X-API-Key: jnk_t_... Idempotency-Key: trip-1444-quote-2097152-attempt-1 Content-Type: application/json { "trip_id": "1444", "quote_id": "2097152", "payment": { "type": "spt", "shared_payment_token": "spt_..." } } ``` **CLI:** `jinko agent-pay submit --trip-id --quote-id --token ` sends the same typed submission. MCP and the CLI derive the idempotency key from the `trip_id`, the `quote_id` and the token: calling again with the same three returns the first attempt's outcome instead of charging again. On REST you choose the key; see [Retries never charge twice](/guides/payment-outcomes#retries-never-charge-twice). A body with only `trip_id` and `shared_payment_token` is the older form: it pays the trip's latest valid quote and ignores `Idempotency-Key`. ## Customer authentication If the traveler's bank requires customer authentication (3-D Secure), the traveler must complete it before the payment can finish. The submission then answers `payment_status: requires_authentication` with `authentication`, a `url` and its `expires_at` (the same time as `quote_expires_at`): 1. Read your issued token's `next_action.use_stripe_sdk.value` with your Stripe secret key. 2. Send the traveler to `authentication.url` with `#hv=` and that value appended, unchanged, before `authentication.expires_at`. You can instead run `stripe.handleNextAction({ hashedValue })` on your own page. 3. Read the trip until `payment_attempt.payment_status` is no longer `requires_authentication`, `cancelling` or `pending`. 4. `authorized` or `captured` means the payment went through and fulfillment proceeds. `failed`, `declined` or `cancelled` means it did not: submit a new token before the deadline. `expired` means the quote expired with it: call checkout again, then mint and submit a new token. ## Declined token When the token is declined, the answer carries a `checkout_url` instead of a `booking_ref`. The traveler can pay there with another method, or the agent can submit a new token before the quote expires. ## Outcomes and retries The REST submission answers with a payment outcome and one recovery action. See [Payment outcomes and retries](/guides/payment-outcomes) for paying the exact quote the traveler approved, the idempotency rules, and what each recovery action asks you to do. # Trips and checkout Source: https://docs.gojinko.com/guides/trips-and-checkout Add flights, hotels, and car rentals to one trip, then check out with one payment. Build one trip with every part of the journey, then let the traveler pay once. A trip holds the selected travel items, traveler information, and ancillaries until checkout. ## How a trip works ```mermaid theme={null} flowchart LR F["Flight"] --> T["Trip
Traveler information
Ancillaries"] H["Hotel"] --> T C["Car rental"] --> T T --> O["One checkout"] O --> P["One payment"] classDef jinko fill:#FFF4F4,stroke:#FF6363,color:#1A1A1A,stroke-width:2px; class F,H,C,T,O,P jinko; ``` Add a flight, hotel, car rental, or any combination of the three. Every selected item stays in the same trip and contributes to the combined total. ## What goes in the trip 1. **Travel items:** the flight fares, hotel rates, and car rental offers selected by the traveler. 2. **Traveler information:** the passenger, guest, driver, and booking contact details required by the selected items. 3. **Ancillaries:** the seats, bags, and other supported extras attached to the relevant item. The trip keeps this information together. You do not need to create a separate trip or checkout for each travel product. ## One checkout, one payment When the trip is ready, Jinko checks out every item together. The traveler sees one combined total and pays once for the full trip. See [Payments](/guides/payments) for the available payment paths. 1. Search for live travel offers. 2. Add the selected offers to the trip. 3. Add traveler information and ancillaries. 4. Create one checkout and collect one payment. ## When the trip changes after checkout A quote prices the items the trip held when checkout ran. Adding an item to the trip or removing one afterwards leaves that quote unpayable: * `GET /v1/trip/{trip_id}` shows `quote.invalid_reason: "items_changed"`. * A payment of that quote is refused with `410 QUOTE_EXPIRED` and `reason: "items_changed"`, and nothing is charged. To continue, call checkout again. It prices the items the trip holds now and returns a new `quote_id` and a new total. Show the traveler the new total and get their approval before paying the new quote. A change of travelers after checkout is reported the same way, with `travelers_changed`. ## When an item cannot be priced Checkout prices every item in the trip. When some items are priced and others are not, checkout answers `status: "partial"` instead of `"ready"`: * Each item carries `quote_status`: `completed` when it is priced, `failed` when it could not be priced. A failed item has no price and is not in the total. When the cause is known it carries `failure_reason`: `offer_expired` or `offer_unavailable` (search again and replace the item), or `provider_error` (a technical failure; call checkout again). * The trip cannot be paid. The response carries no `checkout_url`, no `agent_spt_params`, no `accepted_payment_types` entries and no `expires_at`. A payment of that quote is refused with `410 QUOTE_EXPIRED` and `reason: "partial_quote"`, and nothing is charged. * `GET /v1/trip/{trip_id}` shows `quote.status: "partial"` and the same `quote_status` and `failure_reason` on each item. To continue, remove the failed items, or search again and add a new offer in their place, then call checkout again. After `provider_error`, calling checkout again on the unchanged trip prices the item again. When no item can be priced, checkout answers with an error instead, such as `410 OFFER_EXPIRED`. See [Errors](/concepts/errors#when-a-search-offer-cannot-be-priced). # Webhooks Source: https://docs.gojinko.com/guides/webhooks Receive signed booking and servicing events without polling. Webhooks notify your server when a booking or post-booking operation changes. Jinko sends a signed `POST` when payment starts, a booking completes or fails, or a cancellation or exchange reaches an outcome. ## How it works 1. Register a public HTTPS endpoint and choose the events you need. 2. Jinko sends a signed event when the booking changes. 3. Verify the signature and deduplicate the event. 4. Return `2xx`, then process the event in your application. When Jinko sends a traveler email at the same moment, the event also includes its content in `data.customer_emails`. See [Send your own customer emails](/guides/send-your-own-emails) to use that data with your own brand. ## Prerequisites 1. A Jinko account 2. A public HTTPS endpoint that can receive a `POST` > [!WARNING] > > The `/v1/webhooks` management endpoints do not accept tenant keys. Register the endpoint on the [Webhooks page in the dashboard](https://dashboard.gojinko.com/developers/webhooks) when you use a tenant key. The API accepts only legacy person-bound keys with the bare `jnk_` prefix. ### Tenant subscriptions A booking made with a tenant key sends events to the subscriptions registered for that tenant. The payload, headers, and signature are the same for every authentication mode. Register the endpoint in the dashboard, select the tenant, and choose the events. Subscriptions are environment-specific, so register them separately in production and sandbox. For sandbox bookings, turn on **Sandbox mode** in the dashboard before creating the subscription. ## Register an endpoint > [tab] Dashboard > > Open [Webhooks in the dashboard](https://dashboard.gojinko.com/developers/webhooks), select **Add webhook**, paste your URL, choose the events, and select **Create**. Copy the signing secret shown once. You need it to verify deliveries. > [tab] API > > ```bash theme={null} > curl -X POST https://api.gojinko.com/v1/webhooks \ > -H "X-API-Key: $JINKO_API_KEY" \ > -H "Content-Type: application/json" \ > -d '{ > "url": "https://your-app.com/webhooks/jinko", > "events": ["booking.completed", "booking.partial", "booking.failed"] > }' > ``` > > The response contains the signing `secret` **once**, so store it securely: > > ```json theme={null} > { > "id": 42, > "url": "https://your-app.com/webhooks/jinko", > "events": ["booking.completed", "booking.partial", "booking.failed"], > "secret": "whsec_3f9a…", > "status": "active", > "created_at": "2027-06-02T08:00:00Z" > } > ``` ## Choose events | Event | `status` (deprecated) | When it fires | | - | - | - | | `booking.processing` | `processing` | The payment is authorized and the booking is being confirmed with the suppliers. No supplier reference exists yet. | | `booking.completed` | `confirmed` | Every item in the trip was booked. A seat can still be pending (see below). | | `booking.partial` | `partial` | **Some items booked and some failed.** Money was captured for the items that booked. | | `booking.failed` | `failed` | No item could be booked. The payment hold is released and nothing is charged. | | `servicing.completed` | `servicing.completed` | A cancellation of one booked item is complete and its money is settled. | | `servicing.exchange_confirmed` | `servicing.exchange_confirmed` | The supplier confirmed an exchange of one booked item. For a flight, the new e-ticket number can follow in `servicing.ticket_issued`. | | `servicing.ticket_issued` | `servicing.ticket_issued` | The new e-ticket number of an exchanged flight is available. | | `servicing.failed` | `servicing.failed` | An exchange or a refund could not be completed. The original booking is unchanged unless the payload says otherwise. | **Seat confirmation:** Jinko sends `booking.completed` and the flight booking confirmation email once the flight is ticketed, even if a seat is still pending. Read `booked_ancillaries` for each seat's outcome. See [Seat maps](/concepts/ancillaries/seats). Exactly one of `booking.completed`, `booking.partial` and `booking.failed` fires per trip. They are mutually exclusive. `booking.processing` reports an earlier moment: the payment is authorized and the booking is being confirmed. The `servicing.*` events fire after the booking, once for each operation, and only if you subscribe to them. > [!WARNING] > > **`booking.partial` is not a success.** If you subscribe to it, treat it as "money moved and the trip is incomplete", and reconcile per item using the `data` object below. If you do **not** subscribe to it, a partially-fulfilled trip sends you nothing at all, and you will only find it by polling `get_trip`. > > This is why `booking.partial` is a distinct event rather than a flag on `booking.completed`: a consumer that has never heard of it cannot silently mistake a half-booked trip for a confirmed one. More event types will be added over time. Treat the `event` field as an open enum and ignore events you don't handle. No event reports a change the airline makes after ticketing, such as a schedule change or a cancellation. Jinko doesn't detect those today, and [`get_booking`](/api/get-booking) returns the itinerary as it was booked. Every event in the table is in the `WebhookEvent` enum of the [production OpenAPI contract](https://api.gojinko.com/doc). ## Read the payload Every event carries these six fields. The example leaves out `data`, described below: ```json theme={null} { "event": "booking.completed", "booking_ref": "JNK-A7B3X9", "trip_id": "8200", "status": "confirmed", "occurred_at": "2027-06-02T08:00:00Z", "event_id": "evt_8d2f41c9a07e", "livemode": true } ``` Those six fields are on **every** event and never change. `status` is deprecated: branch on `event`, which already names the outcome. The four `booking.*` events also carry `trip_id`: the `trip_id` that [`POST /v1/trip`](/api/trip) returned when you created the trip. Use it to match an event to your trip, because `booking_ref` only exists once the traveler has paid, and a `booking.failed` can arrive without one. The Builder MCP server shows the same trip as `trip_8200`: compare the digits. Servicing events, and the `booking.completed` that settles the price difference of an exchange, leave `trip_id` out; match them with `booking_ref`. Events also carry a `data` object with the facts of the booking or the operation and, when Jinko emails your traveler at that moment, that email: | Event | `data` | | - | - | | `booking.processing` | `customer_emails` and `manage_booking_url`: see [Customer emails](#customer-emails). | | `booking.completed` | Each booked item with its supplier references (see [Completed bookings](#completed-bookings)), and `customer_emails` and `manage_booking_url`. | | `booking.partial` | What happened to each item and what was captured: see [Partial bookings](#partial-bookings). No `customer_emails`: Jinko sends no email at that moment. | | `booking.failed` | `failure_reason` and `failure_message` (see [Failed bookings](#failed-bookings)), and `customer_emails`. | | `servicing.completed` | The operation and its money (see [Cancellations](#cancellations)), and `customer_emails`. | | `servicing.exchange_confirmed`, `servicing.ticket_issued`, `servicing.failed` | The operation (see [Exchanges and failed operations](#exchanges-and-failed-operations)), and `customer_emails`. | Fetch the full booking with [`get_booking`](/api/get-booking) using the `booking_ref`. ### Customer emails Every event except `booking.partial` carries `data.customer_emails`: one entry for each email Jinko sends, or would send, your traveler at that moment, with what the email shows. Use it to send the email in your own brand. [Send your own customer emails](/guides/send-your-own-emails) explains how, and how to ask Jinko to stop sending its own. ```json theme={null} { "event": "booking.completed", "booking_ref": "JNK-8F3D21", "status": "confirmed", "occurred_at": "2027-06-02T08:00:00Z", "event_id": "evt_e5a09b3c7d12", "livemode": true, "data": { "manage_booking_url": "https://app.gojinko.com/bookings/JNK-8F3D21?ln=Martin", "customer_emails": [ { "template": "flight-ticketing-confirmation", "to": "jane.martin@example.com", "subject": "Your tickets are confirmed: JNK-8F3D21", "content": { "pnr": "JNK-8F3D21", "airline_pnr": "XM9L7Q", "destination_city_name": "Paris", "passengers": [ { "first_name": "Jane", "last_name": "Martin", "type": "Adult", "ticket_number": "0167654321098" } ] } }, { "template": "hotel-booking-confirmation", "to": "jane.martin@example.com", "subject": "Your stay at Hôtel Marais is confirmed", "content": { "pnr": "JNK-8F3D21", "supplier_booking_id": "4412983", "hotel": { "name": "Hôtel Marais" }, "stay": { "duration_label": "3 nights" }, "guests": [{ "first_name": "Jane", "last_name": "Martin" }] }, "calendar": { "files": [ { "method": "REQUEST", "filename": "jinko-JNK-8F3D21.ics", "content_type": "text/calendar; charset=utf-8; method=REQUEST", "content": "BEGIN:VCALENDAR\r\n…" } ] } } ] } } ``` | Field | Notes | | - | - | | `data.manage_booking_url` | The manage-booking link, when Jinko's email at that moment carries one. It includes the traveler's last name. | | `data.customer_emails[]` | One entry per email, in sending order. A booking with a flight and a hotel gives two entries. The entries are the same whether Jinko sends its own emails or not. | | `customer_emails[].template` | Which email this is, for example `flight-ticketing-confirmation`. It sets the shape of `content`. | | `customer_emails[].to` | The address Jinko's email goes to: the booking contact. Absent when the booking has none. | | `customer_emails[].subject` | The subject line of Jinko's email. | | `customer_emails[].content` | The values the email shows, under snake_case keys. Dates, times and amounts are display strings, as the email shows them. Empty values are left out. | | `customer_emails[].calendar` | The calendar files the email attaches, in the `{ files: [{ method, filename, content_type, content }] }` shape of the booking read. Present only when the email attaches one. | The example shows only some fields of each `content`. Each template's `content` has its own schema in the [OpenAPI contract](https://api.gojinko.com/doc), named after the template: for example `FlightTicketingConfirmationEmailContent`. A later version can add fields to `content` and entries to `customer_emails`, so ignore what you don't use. > [!WARNING] > > **`customer_emails` contains traveler personal data:** names, email addresses, itineraries and ticket numbers. `manage_booking_url` contains the traveler's last name. Treat every payload that carries them as personal data, including in logs and storage. Jinko keeps each delivery payload for the [delivery log](#inspect-and-replay-deliveries) and deletes it 30 days after the delivery's last attempt or replay. ### Completed bookings `booking.completed` lists every booked item in `data.items`, so you can tell the traveler the airline or hotel reference without calling `get_booking`. ```json theme={null} { "event": "booking.completed", "booking_ref": "JNK-8F3D21", "status": "confirmed", "occurred_at": "2027-06-02T08:00:00Z", "event_id": "evt_e5a09b3c7d12", "livemode": true, "data": { "items": [ { "item_id": "prod_f5pyznimu4", "kind": "flight", "booked_item_id": "itm_4zq2c7mbx3k1a9pd", "supplier_references": [{ "issuer": "AF", "reference": "XM9L2K" }] } ], "manage_booking_url": "https://app.gojinko.com/bookings/JNK-8F3D21?ln=Martin", "customer_emails": [ … ] } } ``` | Field | Notes | | - | - | | `data.items[].item_id` | Matches `items[].item_id` on `get_trip`. | | `data.items[].kind` | `flight`, `hotel` or `car`. | | `data.items[].booked_item_id` | The item's handle: `booked_item_id` on `get_booking`, and what a refund, exchange or cancellation takes. | | `data.items[].supplier_references` | The supplier's own confirmations, each `{ issuer, reference }`: the airline's record locator per airline, the hotel's confirmation number, or the rental reservation number. `[]` when none is known. | `data.items` is absent on events sent before contract 0.75.0. ### Partial bookings `booking.partial` carries `data` describing what actually happened per item and how much was captured. ```json theme={null} { "event": "booking.partial", "booking_ref": "JNK-A7B3X9", "status": "partial", "occurred_at": "2027-09-02T08:00:00Z", "event_id": "evt_3b7e90d15fa2", "livemode": true, "data": { "items": [ { "item_id": "prod_f5pyznimu4", "kind": "flight", "status": "completed", "supplier_references": [{ "issuer": "AF", "reference": "XM9L2K" }], "captured_amount_money": { "value": 18865, "currency": "USD", "decimal_places": 2, "display": "USD 188.65" }, "captured_amount": { "amount": 188.65, "currency": "USD" } }, { "item_id": "prod_h2k9qmz013", "kind": "hotel", "status": "failed" } ], "captured_total_money": { "value": 18865, "currency": "USD", "decimal_places": 2, "display": "USD 188.65" }, "captured_total": { "amount": 188.65, "currency": "USD" } } } ``` | Field | Notes | | - | - | | `data.items[].item_id` | Matches `items[].item_id` on `get_trip`. | | `data.items[].kind` | `flight`, `hotel` or `car`. | | `data.items[].status` | `completed` or `failed`, per item. | | `data.items[].supplier_references` | The supplier confirmations on an item that booked, each `{ issuer, reference }`: the airline's record locator per airline, the hotel's confirmation number, or the rental reservation number. `[]` when none is known. Absent on a failed item. | | `data.items[].captured_amount_money` | What was charged for this item. Present only on items that booked. | | `data.captured_total_money` | What the customer was actually charged: the items that booked, not the trip total, so it will not match the original quote. | | `data.items[].captured_amount`, `data.captured_total` | Deprecated. The same figures in **major units** (`188.65`). Read the `*_money` fields instead. | The `*_money` fields use the platform's one money shape: `value` is an integer in minor units, divide it by `10 ** decimal_places`, and `display` is the same figure ready to show. See [Money & prices](/concepts/money). The deprecated `captured_amount` and `captured_total` are still sent, in major units, so do not divide those. ### Failed bookings `booking.failed` carries `failure_reason` when the failure has a classified cause: `price_changed`, `offer_unavailable`, `booking_not_created` or `booking_cancelled_at_provider`. `failure_message`, a customer-facing sentence, is sent for the first two causes only. Both are absent when the failure has no classified cause. `customer_emails` carries the `booking-failed` email. ### Cancellations `servicing.completed` reports a post-booking operation on one booked item, today a cancellation, that succeeded and whose money was settled. It is a separate event from `booking.completed` because it reports a booking being undone. Its `data` names the operation and the money, and carries the cancellation email in `customer_emails` (left out of this example): ```json theme={null} { "event": "servicing.completed", "booking_ref": "JNK-A7B3X9", "status": "servicing.completed", "occurred_at": "2027-09-20T14:12:09Z", "event_id": "evt_c41a6e2b98d0", "livemode": true, "data": { "operation": "svc_8cd41f", "operation_kind": "cancel", "booked_item_id": "itm_aaaaaaaaaaaaafhuxsdxpbzrbfz5hm3a", "state": "succeeded", "refund": { "value": 25000, "currency": "USD", "decimal_places": 2, "display": "USD 250.00" }, "penalty": { "value": 4500, "currency": "USD", "decimal_places": 2, "display": "USD 45.00" }, "booking_ref": "JNK-A7B3X9", "servicing_event": "servicing.completed" } } ``` | Field | Notes | | - | - | | `data.operation` | The `svc_…` operation handle, the same one the commit returned and the status endpoints take. | | `data.operation_kind` | What the operation did, e.g. `cancel`. | | `data.booked_item_id` | The booked item the operation acted on: `booked_item_id` on [`get_booking`](/api/get-booking). | | `data.state` | Always `succeeded`. The event is sent only for an operation that succeeded. | | `data.refund` | What was settled back to the customer for this item. `null` when the operation has no refund figure. | | `data.penalty` | The supplier fee the customer agreed to. `null` when the operation has no fee figure. | | `data.booking_ref`, `data.servicing_event` | The event-level `booking_ref` and the event name again. | | `data.customer_emails` | The cancellation email for this item: `flight-cancellation`, `hotel-cancellation` or `car-cancellation`. See [Customer emails](#customer-emails). | `refund` and `penalty` use the same money shape as the `*_money` fields above, with `decimal_places` at the ISO 4217 digits of the currency. `null` means the operation carries no such figure, which is different from a figure of zero. ### Exchanges and failed operations `servicing.exchange_confirmed`, `servicing.ticket_issued` and `servicing.failed` each report one operation on one booked item. Their `data` carries: | Field | Notes | | - | - | | `data.operation_kind` | The operation: `cancel`, `void`, `exchange` or `refund`. | | `data.booked_item_id` | The booked item the operation acted on, when known. | | `data.booking_ref` | The booking's Jinko reference, when known. | | `data.operation` | The `svc_…` operation handle, when the operation has one. | | `data.customer_emails` | The email Jinko sends at that moment: `flight-exchange`, `flight-exchange-ticket-number`, or `exchange-failed` or `refund-failed`. | > [!NOTE] > > The `event_id` is an opaque string, unique to each occurrence of an event. Its format is not part of the contract: don't parse it. The `servicing.*` events can happen more than once for the same booking, for example `servicing.completed` for each cancelled item, and each occurrence has its own `event_id`. Retries and replays reuse it, so your dedupe on `X-Jinko-Event-Id` covers them. Each request also carries these headers: | Header | Purpose | | - | - | | `X-Jinko-Signature` | `sha256=` HMAC of the request (see below). | | `X-Jinko-Timestamp` | Unix seconds; part of the signed payload (replay protection). | | `X-Jinko-Event-Id` | Stable id for the business event; use it to dedupe. | | `X-Jinko-Delivery-Id` | Id of this specific delivery attempt. | ## Verify the signature Compute `HMAC-SHA256(secret, ".")` and compare it, in constant time, to the hex in `X-Jinko-Signature` (after the `sha256=` prefix). **Use the raw request body**: parsing and re-serializing the JSON will change the bytes and break the check. > [tab] Node.js > > ```javascript theme={null} > import crypto from 'node:crypto'; > > // rawBody: the exact bytes Jinko sent (Buffer/string), NOT re-serialized JSON. > function verifyJinkoWebhook(rawBody, headers, secret) { > const ts = headers['x-jinko-timestamp']; > const sig = headers['x-jinko-signature']; > const toleranceSeconds = 300; > if (typeof ts !== 'string' || !/^[0-9]{1,12}$/.test(ts) || > typeof sig !== 'string' || !/^sha256=[a-fA-F0-9]{64}$/.test(sig)) { > return false; > } > if (Math.abs(Date.now() / 1000 - Number(ts)) > toleranceSeconds) { > return false; > } > const expected = crypto.createHmac('sha256', secret) > .update(`${ts}.`).update(rawBody).digest(); > const received = Buffer.from(sig.slice('sha256='.length), 'hex'); > return received.length === expected.length && > crypto.timingSafeEqual(expected, received); > } > ``` > [tab] Python > > ```python theme={null} > import hashlib > import hmac > import re > import time > > def verify_jinko_webhook(raw_body: bytes, headers: dict, secret: str) -> bool: > headers = {key.lower(): value for key, value in headers.items()} > ts = headers.get("x-jinko-timestamp") > sig = headers.get("x-jinko-signature") > tolerance_seconds = 300 > if not isinstance(ts, str) or not re.fullmatch(r"[0-9]{1,12}", ts): > return False > if not isinstance(sig, str) or not re.fullmatch(r"sha256=[a-fA-F0-9]{64}", sig): > return False > if abs(time.time() - int(ts)) > tolerance_seconds: > return False > signed = f"{ts}.".encode() + raw_body > expected = hmac.new(secret.encode(), signed, hashlib.sha256).digest() > received = bytes.fromhex(sig[len("sha256="):]) > return len(received) == len(expected) and hmac.compare_digest(expected, received) > ``` Reject the request if the signature doesn't match, or if `X-Jinko-Timestamp` is outside your tolerance in either direction (the examples use 5 minutes) to guard against replays. Respond `2xx` once you've accepted the event. ## Handle retries and duplicates 1. Return `2xx` as soon as you have stored the event. Process slower work asynchronously. 2. Jinko retries a timeout or non-`2xx` response with exponential backoff, up to 8 attempts over about 80 minutes. 3. Deduplicate retries with `X-Jinko-Event-Id`. Every attempt for the same business event uses the same value. 4. After the eighth failed attempt, the delivery becomes `exhausted`. You can replay it from the [delivery log](#inspect-and-replay-deliveries). ## Inspect and replay deliveries Jinko records every attempt to deliver an event. 1. **Dashboard:** open [Webhooks in the dashboard](https://dashboard.gojinko.com/developers/webhooks), select the webhook, then open **Deliveries**. You can inspect each attempt and replay a delivery. 2. **API with a legacy person-bound key:** [`GET /v1/webhooks/{id}/deliveries`](/api/webhooks/deliveries) lists deliveries. [`POST /v1/webhooks/{id}/deliveries/{delivery_id}/replay`](/api/webhooks/replay) replays one. | `status` | Meaning | | - | - | | `pending` | Not attempted yet, or a replay is queued. | | `delivered` | Your endpoint answered `2xx`. | | `failed` | The last attempt failed and another one is scheduled. Deliveries that failed before this log existed are not retried and can't be replayed. | | `exhausted` | The last of the 8 attempts failed. Jinko does not retry it. | A replay sends the same event again: same `event_id`, same payload, signed with a new `X-Jinko-Timestamp`. It starts a fresh set of attempts and adds one to the delivery's `replay_count`. Replay is accepted for a `delivered` or `exhausted` delivery. It is refused with `409` and code `delivery_in_progress` while the delivery is `pending` or `failed`, and with `409` and code `payload_purged` once the payload is deleted, 30 days after the delivery's last attempt or replay. Because a replay keeps the `event_id`, a receiver that deduplicates on `X-Jinko-Event-Id` treats it as an event it already has, if it processed the first delivery. ## Test the endpoint The dashboard has no test button. With a legacy person-bound key, send a test event through the API: ```bash theme={null} curl -X POST https://api.gojinko.com/v1/webhooks/42/test \ -H "X-API-Key: $JINKO_API_KEY" ``` This delivers a sample event with `"livemode": false` and `booking_ref: "JNK-TEST00"`, so you can confirm your signature handling end-to-end without a real booking. # Introduction Source: https://docs.gojinko.com/introduction The end-to-end travel rails between agents and suppliers. Jinko provides the end-to-end travel rails between agents and suppliers. We connect agents to airlines, hotels, and car rental companies, and handle search, booking, and post-booking in one workflow. > [card] [Get an API key](https://dashboard.gojinko.com/developers/keys) > > Grab your API key and ask your coding agents to build. > [card] [Quickstart](/quickstart) > > Connect a client and run your first search in under two minutes. ## Who Jinko is for Built for products that already own the user relationship. > [card] Personal agents > > Let personal assistants search, book, and manage travel for their users. > [card] Work agents > > Let work agents book business travel inside existing workflows. > [card] Fintechs and banks > > Bring your travel portal into the AI agents your users already use. > [card] Platforms with an existing audience > > Turn an app, membership, or marketplace into a travel channel. [Explore more use cases](https://gojinko.com/usecases/) ## Why Jinko is different Built for agents, end to end. > [card] Built for agents > > Search, book, pay, and manage trips in one workflow. > [card] AI search > > Turn natural language into relevant, bookable flight and hotel options. > [card] Agentic payments > > Let agents pay programmatically with protocols such as Shared Payment Tokens. > [card] Full post-booking > > Let agents handle refunds, exchanges, and cancellations for their users. ## Four ways to connect Choose the interface that fits your product. > [card] [MCP](/connect/mcp) > > Give agents the full booking workflow through one URL. > [card] [API](/api-reference/introduction) > > Build fintech, banking, and branded travel products over REST. > [card] [TypeScript SDK](/connect/sdk) > > Add typed travel workflows to Node.js applications. > [card] [CLI](/connect/cli) > > Run the booking workflow from agents, scripts, and CI. ## Where to go next > [card] [Quickstart](/quickstart) > > Connect a client and book your first trip. > [card] [Guides](/guides/flight-booking) > > End-to-end walkthroughs for flight, hotel, car rental, and combined bookings. # Best price guarantee Source: https://docs.gojinko.com/marketing-claims/best-price-guarantee Let an AI agent find a lower rate and ask Jinko to match it. Jinko's Best Price Guarantee is designed for AI agents. The agent browses the web, looks for a lower rate, and submits the evidence to Jinko. The traveler does not need to search websites or prepare a claim. ## How it works 1. The AI agent searches the web for a lower rate for the same travel option. 2. It compares the price, travel details, included services, and booking conditions. 3. When it finds a matching lower rate, it sends Jinko the source URL and a screenshot of the offer. 4. Jinko verifies that the offer is accurate, equivalent, and still available. 5. If the offer passes verification, Jinko matches the price. ## A simple integration Choose MCP or the API. You do not need both. 1. Submit the selected Jinko hotel offer, lower price, currency, source URL, and screenshot URL with the `claim_best_price_guarantee` tool or `POST /v1/best_price_guarantee`. 2. Most reviews return a result in the same call. If the result is still pending, read it with `get_best_price_guarantee` or `GET /v1/best_price_guarantee/{id}`. 3. When Jinko returns a matched offer, add it to a trip and continue to checkout like any other hotel offer. ## What the AI agent should send The AI agent should provide enough information for Jinko to verify the offer: 1. The URL where the lower rate was found 2. A screenshot showing the price and travel details 3. The dates, travelers, and selected travel option 4. The included services and booking conditions shown with the rate The URL and screenshot should show the same offer. This lets Jinko compare the total price and confirm that the conditions match without asking the traveler to repeat the search. Integration details, request and response shapes: [Best Price Guarantee guide](/guides/best-price-guarantee). # Price Advice Source: https://docs.gojinko.com/marketing-claims/price-advice Help travelers decide whether to book a flight now or wait for a better price. Price Advice helps an AI agent explain whether a flight is well priced and whether the traveler should book now or wait. The agent starts with a selected flight and its current price. Jinko compares that fare with typical prices for similar flights, estimates how it may change, and returns a clear recommendation. ## How it works 1. The agent sends the flight details and current price to Jinko. 2. Jinko compares the fare with typical prices for similar flights. 3. Jinko forecasts the price one day and three days ahead. 4. Each forecast includes the probability of an increase, decrease, or no change. 5. Jinko recommends whether to book now or wait. ## Questions it can answer Price Advice helps an agent answer questions such as: 1. "Is this a good price for this flight?" 2. "Should I book now or wait?" 3. "How could the price change tomorrow?" 4. "What is the expected price in three days?" 5. "How likely is the fare to increase or decrease?" ## A simple integration Call `flight_price_advice` with MCP or `POST /v1/flight_price_advice` with the API after the traveler selects a live flight offer. The result includes the fare assessment, the one-day and three-day forecasts, and a recommendation the agent can explain directly to the traveler. Price Advice does not search, monitor, or book the flight. # Price Drop Protection Source: https://docs.gojinko.com/marketing-claims/price-drop-protection Monitor a confirmed hotel booking and rebook it when the same room costs less. Preview This feature is in preview and available for hotels. After a hotel stay has been booked, Jinko keeps looking for a better price for the same room. When the stay can be cancelled for a full refund, Jinko searches the same hotel once a day. If the same room becomes more than USD 10 cheaper, Jinko books it at the lower price as a new booking, cancels the original stay, and refunds the difference to the traveler. ## How it works 1. The hotel booking is confirmed and paid. 2. Price Drop Protection is added to the booking. It is free. 3. Jinko searches the same hotel once a day, until shortly before free cancellation of the stay ends. 4. When the same room costs more than USD 10 less, Jinko books it as a new booking, then cancels the original stay. 5. Jinko refunds the difference to the traveler's original payment and emails the traveler the new booking. ## What Jinko checks Price Drop Protection only acts when the booking and the replacement are eligible. Jinko checks: 1. The booking is paid, for one room, and can be cancelled for a full refund 2. The replacement is the same hotel, room, board, dates and guests 3. The replacement can be cancelled for free until at least the same date 4. The traveler saves more than USD 10 A stay is rebooked at most once. Jinko handles the search, the new booking, the cancellation, and the refund. # Quickstart Source: https://docs.gojinko.com/quickstart Set up Jinko yourself or hand the setup to your agent. Choose how you want to set up Jinko. ## For humans **1. Create your account** [Sign up in the Jinko dashboard](https://dashboard.gojinko.com). **2. Create an API key** Open [Developers > API keys](https://dashboard.gojinko.com/developers/keys) and create a key. **3. Connect Jinko** Use your key with [MCP](/connect/mcp), the [API](/api-reference/introduction), or the [CLI](/connect/cli). ## Start in sandbox Start in sandbox to test Jinko quickly without changing production data. Use it to run supported flows end to end, from search and trip creation to payment and post-booking management. Sandbox is built to test your integration and its behavior. > [!NOTE] > > **Use production to validate travel content.** Sandbox inventory, availability, prices, and supplier content can differ from production. Switch to production before checking what travelers will actually see. 1. Enable **Sandbox mode** in the dashboard. 2. Create a sandbox API key under **Developers**, then **API keys**. 3. Connect to the sandbox environment and follow [Testing in sandbox](/guides/testing-in-sandbox). Production and sandbox use separate keys. See [Sandbox keys](/authentication/api-keys#sandbox-keys) for the matching endpoints. ## For agents Copy this prompt into your coding agent: ```markdown theme={null} Set up Jinko for me. Read https://dashboard.gojinko.com/auth.md and follow its instructions. Start anonymously unless you need my email or broader access. Never print secrets or save them in plaintext. Ask me only when auth.md requires an action from me. Once you have the Jinko API key, ask whether I want MCP, API, or CLI. Then configure it using the matching guide on https://docs.gojinko.com. ``` # Cancel Car Rental Booking Source: https://docs.gojinko.com/tools/car-cancel Preview the cancellation fee, cancel a car rental, or re-read the latest attempt Cancel a car rental booked through Jinko and tell the customer what it costs before anything happens. The fee in force is quoted first and the quote is persisted, so the cancellation that follows is bound to the terms the customer actually saw; the refund is the amount paid less that fee, issued on Jinko's side. Guest auth, booking_ref + booked_item_id (plus last_name for guests) from the confirmation email. Changing a rental (dates, vehicle, extras) is not available; the only path to a different rental is to cancel and book again. > [accordion] Tool description (what the LLM sees) > > ```text theme={null} > get_booking with booking_ref (and last_name for guests) returns items[] with servicing eligibility and refusal reasons for item selection. The same booking_ref + booked_item_id identifies the selected item on every action, including commit and status. booked_item_id is the stable booked item, even after an exchange. last_name is required for guests and optional for authenticated owners. A 409 with items[] means customer selection is needed; a retry identifies that choice with booked_item_id. > > Cancel a car rental booking and refund the customer's payment less the cancellation fee. Guest mode requires the Jinko booking reference and the driver's last_name; authenticated owners may omit last_name. Use this when the customer wants to CANCEL. If they want to change dates, change the vehicle, upgrade, or amend the rental, say plainly that modifications are not available: the options are keeping the booking as is, or cancelling it (this tool, fee shown first) and booking a new rental with car_search. > > PREREQUISITES: > - booking_ref (JNK-XXXXXX), from the booking confirmation email. Guests must also provide the driver's last_name; authenticated owners may omit it. > > WORKFLOW: > 1. action="preview" with booking_ref + booked_item_id (plus last_name for guests) → quotes the fee in force and the refund it would leave, and returns a quote_id. NOTHING is cancelled. Where the quote carries an expires_at it is committable until then; preview again after it. > 2. Show the customer the fee and the refund and get explicit confirmation. > 3. action="commit" with booking_ref + booked_item_id (plus last_name for guests) + quote_id → cancels at the supplier and refunds. Safe to repeat: a committed cancellation is reported as it stands rather than cancelled twice, and the customer's email is never re-sent. > 4. action="status" with booking_ref + booked_item_id (plus last_name for guests) → re-reads the latest attempt at any time. Read-only; polling it can never start a cancellation. > > WHEN A PERSON HAS TO COMPLETE IT (manual_required): > - A preview with cancellable: false AND manual_required: true cannot be completed online, the fee could not be established, the rental was changed after it was paid for, or the fee is in another currency or above the rental; refund_review_reason says which. No refund figure is given and none may be quoted. > - It is not a dead end: if the customer explicitly agrees to hand the cancellation to a Jinko agent, call action="commit" with the same quote_id and manual_ok: true. The cancellation is then recorded for the agent (state "pending", refund_pending_review true); nothing is sent to the rental company by that call, and the agent completes it and settles the refund by hand. > - A commit of such a preview WITHOUT manual_ok is refused as manual_required, the tool's answer then tells you exactly that. Never send manual_ok pre-emptively, and never without the customer's agreement: it is their consent, not a retry flag. > > READING THE MONEY, this is the part that goes wrong: > - fee_known: false means the supplier published NO fee schedule we could resolve. The fee and refund fields are then ABSENT, not zero. Say "we will confirm the cancellation fee". NEVER present that as free cancellation. > - refund_pending_review: true means the booking IS cancelled (or, with state "pending", recorded for a Jinko agent) but a human still owes the customer the refund answer, do not quote refund_amount as final. > - Amounts are {value, currency, decimal_places} in MINOR units: divide by 10^decimal_places to display. > > IMPORTANT: > - Always preview before committing, the quote_id from preview is REQUIRED for commit, and it is what binds the charge to the quoted fee. > - Always get explicit customer confirmation before calling commit. This ends the rental. > - state is preview | pending | confirmed | rejected | failed. "pending" means recorded but not finished, the platform is still completing it, or a person has it, so follow it with status and do not commit again. "rejected" means the supplier declined and the booking still stands, surface rejected_reason; it is an outcome, not an error. > - A commit can be REFUSED without anything happening, and the answer says why and what to do: the quote expired (preview again), the refund moved since the preview (a fresh quote_id is given, show the new figure, then commit that one), an exchange or another cancellation is in flight (wait for it), the rental is no longer cancellable, or the refund cannot be covered yet. None of these means the booking reference or last name is wrong. > - A wrong booking_ref / last_name pair answers "not found" and never reveals which half was wrong. Re-check both with the customer. > - A booking with no cancellation on record answers "no attempt" on status, run preview first. > ``` ## Parameters | Name | Type | Required | Description | | - | - | - | - | | `action` | `enum ("preview" \| "commit" \| "status")` | Yes | Action to perform: "preview" to quote the cancellation fee and the refund it would leave (nothing is cancelled) and obtain a quote_id, "commit" to cancel at the supplier and refund, "status" to read the latest attempt. | | `booking_ref` | `string` | Yes | Trip-level Jinko booking_ref returned by get_trip or submit_agent_payment. Use it to look up the booking with get_booking. | | `booked_item_id` | `string \| null` | No | The booked item to service: booked_item_id from get_booking.items\[] (an "itm\_…" string). Send it on every action. May be omitted only when the booking has exactly one item in this domain. | | `last_name` | `string \| null` | No | Primary traveler last name. Required for guests; optional for an authenticated owner of the booking. | | `quote_id` | `string` | No | The "ccl\_…" reference a prior `action: "preview"` returned. REQUIRED for `action: "commit"`. It binds the cancellation to the fee the customer was quoted; one belonging to another booking is refused as not-found. | | `reason` | `string` | No | Optional free-text cancellation reason. Carried into the cancellation email the customer receives. Accepted on `action: "commit"` only. | | `manual_ok` | `boolean` | No | Accepted on `action: "commit"` only. Send `true` ONLY when the preview answered `manual_required: true` (or the commit was refused with `manual_required`) AND the customer has explicitly agreed to hand the cancellation to a Jinko agent. The cancellation is then recorded for a person to complete, nothing is sent to the rental company by that call, the answer is state "pending" with refund_pending_review true, and the agent settles the refund by hand. Never send it pre-emptively: on a preview that can be committed online it changes nothing, and on a manual one it is a consent the customer must actually have given. | | `user_intent` | `string` | No | The end user's current request in their own words, e.g. "help me with my travel plans". Pass it as-is when short; otherwise condense the goal and constraints into 1-2 sentences. Strip personal identifiers (names, emails, phone numbers, addresses, payment details), replace them with placeholders like "\[name]". Optional. Jinko uses it to understand demand, and hotel_search uses it to rank hotel results against what the user asked for (e.g. "quiet, with a gym, near Times Square"), so keep the user's stated preferences in it. | # Search Car Rentals Source: https://docs.gojinko.com/tools/car-search Live car rental availability between a pick-up and a drop-off place, priced and bookable Find a rental car for a trip and get bookable, priced offers. Each result flattens one vehicle x rate package x branch pair into an offer whose trip_item_token is what trip(add_item) takes: add it to a trip and check out like any other product. Places are named the way a traveler names them, an IATA airport code, free text, or coordinates, never a provider id. Live pricing, so each call reaches the supplier. > [accordion] Tool description (what the LLM sees) > > ```text theme={null} > Search live car rental availability and return bookable offers. Pass each offer's trip_item_token verbatim to trip(add_item) as trip_item_token to put the rental in a trip, then checkout as normal. There is NO car-specific booking tool. > > WHEN TO USE THIS TOOL: > - The user wants to rent a car / hire a car / needs a vehicle between two dates. > - You already know the pick-up place, the pick-up and return date-times, the driver's age, and the driver's country of residence. driver_age and residence_country are REQUIRED and both change the price, ask for them, never guess. > > NAMING THE PLACE (exactly one of three, per end): > - airport_code, a 3-letter IATA code ("LYS"). Prefer this whenever the user named an airport; it needs no resolution step. > - place, free text in any language ("lyon part dieu", "Köln Hbf", "Eiffel Tower", an address). Resolved server-side to the rental airport, station or whole city it names, or searched around its position for a landmark or address. resolved_place says what was searched, tell the user, and alternatives lists other places the text may have meant ("Portland, USA Maine" for "Portland"); offer them when the user may have meant one. A region ("Florida"), or text that cannot be pinned down, comes back with status "ambiguous_place" and a candidates list INSTEAD of offers. Put the candidates to the user and retry with the chosen candidate's place, never auto-pick one. > - geo, {latitude, longitude, range} for "near me"; range is in metres. Works at either end, including a one-way. > Provider ids (location, city, branch, supplier) are not accepted on this surface. > > DATE-TIMES: branch-local "YYYY-MM-DDTHH:MM:SS" with NO timezone. A "Z" or an offset is rejected, the rental desk works in its own local time. Responses carry each branch's IANA time_zone, which is the only way to turn a local time into an instant. > > ONE-WAY vs ROUND TRIP: omit drop_off and set drop_off_date_time to return the car to the pick-up branch. For a one-way rental, send drop_off with its own place and date_time. > > RESPONSE: resolved_place (with source "catalog" or "geocoder" for free text), alternatives (each with the place to search it with), warnings (place_widened: nothing near a landmark had offers, so the nearest airport or city was searched), and offers[], each with trip_item_token ("car_…"), expires_at (~75 minutes, after that, search again), on_request (the supplier confirms manually, so booking settles asynchronously), price, vehicle, package, and pick_up/drop_off branches. total_found / offers_shown / offers_omitted declare any truncation; when offers were dropped, narrow the search rather than paging. > > RENTAL COMPANY: package.supplier_name is the rental company the customer physically collects the car from, Avis, Hertz, Europcar, Sixt. Surface it with every offer you present: it is one of the things travelers decide on, and two otherwise identical offers are often different companies at different desks. Do not confuse it with vehicle.name (the car model, "or similar" unless model_guaranteed) or package.name (the rate plan, e.g. "Fully Inclusive"). > > MONEY: price.pay_now is the ONLY amount Jinko ever charges. due_at_desk is collected by the rental desk and is display-only, deposit is a card hold, estimated_total is the supplier's FX-movable estimate. Never sum them into a total. > > IMPORTANT: > - An EMPTY cancellation_fees list means the supplier published no schedule. That is UNKNOWN, never "free cancellation". A coverage's excess of null means "not stated", not "no excess". > - requires_flight_number on a branch is what the rental DESK asks for, not a booking requirement: EVERY branch is bookable either way, on both "always" and "out_of_hours_pickup". Pass the traveller's flight as contact.flight_number on trip(upsert_travelers) when they have one, the rental company can then hold the car for a delayed flight, and omit it otherwise. Checkout is never refused for want of it, so do not steer a traveller to a different branch over this field, and do not invent a flight number for someone who is not flying. > - Booking a car also needs the booking contact's honorific, pass contact.title (e.g. "mr", "ms", "mx") on trip(upsert_travelers). It is matched against the supplier's own title vocabulary, so an unusual value may not resolve. Checkout refuses a trip with a car and no title, before any card is charged. > ``` ## Parameters | Name | Type | Required | Description | | - | - | - | - | | `pick_up` | `object` | Yes | Where and when the car is collected. The place is exactly one of airport_code, place or geo. | | `pick_up.date_time` | `string` | Yes | Pick-up date-time, BRANCH-LOCAL and zone-less: "2026-09-12T10:00:00". Never send a "Z" or an offset. | | `pick_up.airport_code` | `string` | No | IATA airport code (e.g. "LYS"). The primary path, it needs no resolution hop, so prefer it whenever the user named an airport. | | `pick_up.place` | `string` | No | Free-text location in any language, a city, station, airport, landmark or address ("lyon part dieu", "Köln Hbf", "Eiffel Tower"). Resolved server-side to the rental airport, station or whole city it names, or searched around its position; `resolved_place` says how, and `alternatives` lists other places it may have meant. A region, or text that cannot be pinned down, returns `candidates` INSTEAD of offers: put those to the user and retry with the chosen candidate's `place`. Never auto-pick a candidate. | | `pick_up.geo` | `object` | No | Coordinates plus a radius, for "near me" searches. Works at either end, including a one-way: the other end may be an airport_code, a place or another geo. | | `pick_up.geo.latitude` | `number` | Yes | Latitude in decimal degrees. | | `pick_up.geo.longitude` | `number` | Yes | Longitude in decimal degrees. | | `pick_up.geo.range` | `integer` | Yes | Search radius around the coordinates, in metres (minimum 50). The provider returns the 30 closest branches. | | `drop_off` | `object` | No | Where the car is returned, for a one-way rental. OMIT for a round trip (returned to the pick-up branch) and set `drop_off_date_time` instead. | | `drop_off.date_time` | `string` | No | Drop-off date-time, branch-local. May instead be given as the top-level `drop_off_date_time`; set only one. | | `drop_off.airport_code` | `unknown` | No | | | `drop_off.place` | `unknown` | No | | | `drop_off.geo` | `unknown` | No | | | `drop_off_date_time` | `string` | No | Return date-time when `drop_off` is omitted, branch-local. A rental with no end has no price, so one of this or `drop_off.date_time` is REQUIRED. | | `driver_age` | `integer` | Yes | The driver's age at pick-up (18-99). Price-affecting and REQUIRED, ask the user rather than guessing. It is baked into the rate and is never asked again at booking. | | `residence_country` | `string` | Yes | The driver's country of residence, ISO 3166-1 alpha-2. REQUIRED: it changes both the price and which suppliers will rent at all. | | `currency` | `string` | No | ISO 4217 display currency (e.g. "EUR"). Defaults to the caller's country/locale, else USD, so a mixed trip stays single-currency. | | `lang` | `string` | No | BCP-47 language tag for provider text (package names, fuel policy), e.g. "en-gb". | | `user_intent` | `string` | No | The end user's current request in their own words, e.g. "help me with my travel plans". Pass it as-is when short; otherwise condense the goal and constraints into 1-2 sentences. Strip personal identifiers (names, emails, phone numbers, addresses, payment details), replace them with placeholders like "\[name]". Optional. Jinko uses it to understand demand, and hotel_search uses it to rank hotel results against what the user asked for (e.g. "quiet, with a gym, near Times Square"), so keep the user's stated preferences in it. | # Checkout Trip Source: https://docs.gojinko.com/tools/checkout Checkout a trip, returns a checkout URL the user opens to pay, plus agent payment params Turn a finalized trip into its two payment paths. Use it once the trip is set and traveler details are filled in, for example after the user picks a Paris to Tokyo round trip and adds a hotel for the stay. The returned checkout_url is what a human opens in a browser to pay; agent_spt_params is what an agent uses to pay programmatically via submit_agent_payment. > [accordion] Tool description (what the LLM sees) > > ```text theme={null} > Checkout a trip, returns the web checkout_url a human opens to pay, plus the agent_spt_params an agent can use to pay programmatically (no browser). > > PREREQUISITES (call these first via the trip tool): > trip(add_item) → add the chosen flight or hotel to the trip > trip(upsert_travelers) → set traveler details + contact info > > USAGE: > checkout({ trip_id }) > > Jinko prices the trip (schedules a quote and waits until it completes) and returns checkout_url, a Jinko page where the traveller reviews the trip and pays, all in one synchronous call. Checkout books nothing and charges nothing: the booking starts only when the traveller pays at checkout_url or you call submit_agent_payment. Until then get_trip shows no fulfillment and no booking_ref, and trip.status reads "draft". > • Human path: open the returned checkout_url in a browser to pay. Stripe webhooks finalize the booking after payment succeeds; no client-side confirm step is required. > • Agent path: mint a Shared Payment Token scoped to agent_spt_params, then call submit_agent_payment({ trip_id, shared_payment_token }). > > OPTIONAL FLIGHT ANCILLARIES: checkout → trip(select_ancillaries) → checkout. The first checkout quotes the trip; use get_trip to inspect available_ancillaries, select with the user's approval, then checkout again to refresh the quote and payment artifacts. Pay only from the latest checkout response. > > If travelers are edited after checkout, the quote is invalid: call checkout again before paying. > > PARTLY PRICED TRIP: when some items cannot be priced, checkout answers status "partial" in its data. Each such item carries quote_status "failed" and, when known, a failure_reason. Such a trip cannot be paid: there is no checkout_url and no agent_spt_params, and submit_agent_payment is refused. For an item whose failure_reason is "provider_error", call checkout again on the unchanged trip; do not replace it. For any other item that could not be priced, tell the user which item it is, show replacement options, and replace or remove it only after the user chooses; then call checkout again. > > IMPORTANT: Never fabricate traveler data. Always make sure trip(add_item) and trip(upsert_travelers) have been called with real user-provided data first. > ``` ## Parameters | Name | Type | Required | Description | | - | - | - | - | | `trip_id` | `string` | Yes | Trip ID returned by trip or get_trip. Pass it back exactly as returned. The trip must have items (add_item) and travelers (upsert_travelers) set before checkout. | | `user_intent` | `string` | No | The end user's current request in their own words, e.g. "help me with my travel plans". Pass it as-is when short; otherwise condense the goal and constraints into 1-2 sentences. Strip personal identifiers (names, emails, phone numbers, addresses, payment details), replace them with placeholders like "\[name]". Optional. Jinko uses it to understand demand, and hotel_search uses it to rank hotel results against what the user asked for (e.g. "quiet, with a gym, near Times Square"), so keep the user's stated preferences in it. | # Claim the Best Price Guarantee Source: https://docs.gojinko.com/tools/claim-best-price-guarantee Ask for a hotel offer at a lower price found elsewhere The traveller found the same hotel stay cheaper on another site and wants Jinko's offer at that price. Use it for prompts like "Booking.com shows this room at \$412, can you match it?". Claim with the Jinko offer they compared, the link, the screenshot and the price they saw; the answer is a new offer at that price, or a decline. > [accordion] Tool description (what the LLM sees) > > ```text theme={null} > Best Price Guarantee: makes a claim, asks for a Jinko hotel offer at a lower price the traveller found on another site. Nothing is booked or charged. > > WHEN TO USE: > - The traveller compared a Jinko hotel offer with the same stay on another site and found it cheaper there. > - The traveller has seen a hotel elsewhere and has no Jinko offer yet: run hotel_search first (it can search by hotel name), let them pick the offer, then claim with its trip_item_token. > > HOW TO CALL: > - trip_item_token (the htl_… offer from hotel_search), reference_url, reference_screenshot_url, reference_total, reference_currency. > - wait_seconds (0-20, default 15) is how long the call waits for the result; most claims are answered within it. A "pending" answer carries the claim's id: read its result with get_best_price_guarantee. > > WHAT THE TRAVELLER MUST SUPPLY: > - The link to the page showing the lower price, the hotel's own page on that site, for the same dates and guests, and, on most accounts, an https address a screenshot of that page can be downloaded from. Both come from the traveller. Never build, guess or reuse one. Jinko opens the link and checks the hotel, the dates, the guests, the room, the board, the cancellation terms and the price. > - The total they would pay at booking on that page, in the currency of the Jinko offer. Taxes payable at the property are not part of it. A price in another currency is declined, not converted. > > WHAT COMES BACK: > - "offered": a new offer (offer.trip_item_token, starting with htl_neg_) at offer.price_money, valid until offer.expires_at. offer.saving_money is the saving against the rate's current standard price (offer.original.total_money, which can be lower than the price the earlier search showed); 0 means that current price was already at or below the reference. > - "declined": no offer, with decline.reason, and decline.detail when the check of the reference page found something to explain, pass it on to the traveller. The offer from hotel_search can usually still be booked at its own price. > - "pending": the review is still running; reading the reference page can take a few minutes. It is not a decline and not a failure, read the result with get_best_price_guarantee; do not tell the traveller it failed. > - "expired": the offer was not used in time. > > BOOKING THE NEW OFFER: > - Call trip with add_item.trip_item_token = offer.trip_item_token, then checkout, exactly as for any hotel offer. > - A trip that holds the new offer can hold nothing else. Start a new trip (no trip_id); or, when the trip holds only the offer being replaced, send remove_item for that item and add_item for the new offer in the same trip call. Adding it beside another item is refused. > - The price at checkout can move with the supplier. > > WORDING: this is the price Jinko can offer after its own review. Do not tell the traveller that Jinko negotiated with the hotel or contacted it. A claim can be declined, so do not promise a match before the result says "offered". > ``` ## Parameters | Name | Type | Required | Description | | - | - | - | - | | `trip_item_token` | `string` | Yes | The Jinko hotel offer the traveller compared: an `htl_…` trip_item_token from hotel_search. It names the hotel, the dates, the party and the rate. When the traveller has no Jinko offer yet, run hotel_search first (it can search by hotel name) and claim with the offer they pick. | | `reference_url` | `string` | Yes | The https link to the page where the traveller saw the lower price. It must come from the traveller: never build or guess it. | | `reference_screenshot_url` | `string \| null` | No | An https address a screenshot of that page can be downloaded from, supplied by the traveller. Required on most accounts; a claim without it is then declined with reason `reference_invalid`. | | `reference_total` | `string` | Yes | The total the traveller would pay AT BOOKING on that page, as a plain decimal string such as "412.50", no currency symbol, no thousands separator. Taxes payable at the property are not part of it. | | `reference_currency` | `string` | Yes | The ISO 4217 currency of reference_total. It must be the currency of the Jinko offer (the currency of the offer's price in hotel_search); a price in another currency is declined, not converted. | | `wait_seconds` | `integer` | No | How long this call waits for the result before answering, 0-20 seconds (default 15). It only decides when the call returns; the review continues either way. | | `user_intent` | `string` | No | The end user's current request in their own words, e.g. "help me with my travel plans". Pass it as-is when short; otherwise condense the goal and constraints into 1-2 sentences. Strip personal identifiers (names, emails, phone numbers, addresses, payment details), replace them with placeholders like "\[name]". Optional. Jinko uses it to understand demand, and hotel_search uses it to rank hotel results against what the user asked for (e.g. "quiet, with a gym, near Times Square"), so keep the user's stated preferences in it. | # Find Dates Source: https://docs.gojinko.com/tools/find-dates Best date options for a route, the cheapest itinerary per date-pair, spread across the departure window Answers "when should I fly?" for a known route. Takes the same inputs as flight_calendar except offset, but returns one cheapest itinerary per (departure, return) date-pair, spread across the requested departure window (20 date-pairs by default; `limit` adjusts), so the user gets a diverse shortlist rather than a cluster of near-adjacent cheapest days. Cache-backed; no live pricing. Each result includes an offer token; run a flight_search price check on it to get a bookable fare before adding the flight to a trip. > [accordion] Tool description (what the LLM sees) > > ```text theme={null} > Find the best date options for a known origin and destination using cached pricing. Takes the same inputs as flight_calendar except offset, but returns one cheapest itinerary per (departure, return) date-pair, spread across the requested departure window (20 date-pairs by default; `limit` adjusts), so the user sees a diverse set of "when should I fly?" options rather than the full per-date list. > > WHEN TO USE THIS TOOL: > - The user knows the route (origin AND destination) and is flexible on WHEN, and wants a short, spread-out shortlist of the best date options. > - Examples: "When is the cheapest time to fly Paris → New York in June?", "Best weekends to go from London to Lisbon next month", "Give me a few good date options for a week in Tokyo". > > WHEN TO USE flight_calendar INSTEAD: > - The user wants the full price-per-date list / calendar grid for a route, not a curated shortlist. > > WHEN TO USE flight_search INSTEAD: > - The user wants live pricing on one specific route with an exact departure date. For a round trip, also require an exact return date; one-way trips need no return date. > - Examples: "Paris → NYC one-way on June 17", "Paris → NYC, June 17 → June 26" > - flight_search hits live pricing (each call has a cost) and is the step immediately before booking. Use once the route and required travel dates are locked. > > IMPORTANT: > All dates MUST be in the future. Never use past dates. > Origin and destination: the city code when the user named a city (PAR, NYC), the airport code when they named an airport (CDG, JFK). A code that names a multi-airport city covers every airport of that city; any other code is that one airport. LAX, MIA and LAS are both a city code and that city's main airport, so they are read as the city here. > By default search roundtrip unless the user explicitly asks for one-way (trip_type="oneway"). > > Flow: find_dates → flight_search (price-check the chosen dates) → trip → checkout > > The result carries `search_criteria` (what was actually searched) and `next` (the call to make next, on an empty answer up to three exact-date `flight_search` searches, on a non-empty one `price_check` for the best candidates). Follow `next` before telling the user there are no flights or quoting a cached price. > ``` ## Parameters | Name | Type | Required | Description | | - | - | - | - | | `origin` | `string` | Yes | Origin airport IATA code or city code (3 letters). Examples: "JFK", "PAR". A code that names a multi-airport city (NYC, LON, PAR, and LAX, MIA, LAS, which a city shares with its main airport) covers every airport of that city; any other code is that one airport. | | `destination` | `string` | Yes | Destination airport IATA code or city code (3 letters). Examples: "CDG", "NRT". A code that names a multi-airport city (NYC, LON, PAR, and LAX, MIA, LAS, which a city shares with its main airport) covers every airport of that city; any other code is that one airport. | | `trip_type` | `enum ("oneway" \| "roundtrip")` | Yes | Trip type: "oneway" or "roundtrip". | | `departure_dates` | `array` | No | Specific departure dates (YYYY-MM-DD). Multiple dates searched with OR logic. | | `departure_date_ranges` | `array` | No | Departure date ranges for flexible search. | | `departure_date_ranges[].start` | `string` | Yes | Range start date (YYYY-MM-DD) | | `departure_date_ranges[].end` | `string` | Yes | Range end date (YYYY-MM-DD) | | `return_dates` | `array \| null` | No | Specific return dates (YYYY-MM-DD) for round-trip flights. | | `return_date_ranges` | `array \| null` | No | Return date ranges for flexible round-trip search. | | `stay_days` | `integer \| null` | No | Exact stay duration in days for round trips. Auto-calculates return date. Omit when trip_type is "oneway". | | `stay_days_range` | `object \| null` | No | Flexible stay duration range for round trips. Example: \{min: 5, max: 10}. Omit when trip_type is "oneway". | | `direct_only` | `boolean` | No | Only return nonstop flights. | | `cabin_class` | `enum ("economy" \| "premium_economy" \| "business" \| "first") \| null` | No | Cabin class filter. | | `departure_time_range` | `object` | No | Filter the OUTBOUND leg by local departure time-of-day. Example: \{ "earliest": "08:00", "latest": "12:00" }. | | `departure_time_range.earliest` | `string` | No | Inclusive earliest local time-of-day (HH:MM, 24-hour). | | `departure_time_range.latest` | `string` | No | Inclusive latest local time-of-day (HH:MM, 24-hour). | | `arrival_time_range` | `object` | No | Filter the OUTBOUND leg by local arrival time-of-day. Example: \{ "latest": "20:00" }. | | `arrival_time_range.earliest` | `string` | No | Inclusive earliest local time-of-day (HH:MM, 24-hour). | | `arrival_time_range.latest` | `string` | No | Inclusive latest local time-of-day (HH:MM, 24-hour). | | `return_departure_time_range` | `object \| null` | No | Round-trip only. Filter the RETURN leg by local departure time-of-day. | | `return_arrival_time_range` | `object \| null` | No | Round-trip only. Filter the RETURN leg by local arrival time-of-day. | | `max_total` | `number \| null` | No | Maximum total of the cached fare, in the requested currency. Cached fares are priced for one adult, so the cap applies to a one-adult fare. For a whole-party budget, divide it by the number of ADULTS only and treat the result as a loose pre-filter: children and lap infants usually cost less than an adult, so dividing by every traveller would exclude affordable trips. Send a per-person budget as-is. The exact whole-trip budget check is flight_search with max_total. | | `sort_by` | `enum ("lowest")` | No | Sort order. "lowest" (cheapest first) is the only order today; omit it for the same. | | `currency` | `string` | No | ISO 4217 currency code. Defaults to "USD". | | `locale` | `string` | No | BCP 47 locale. Defaults to "en-US". | | `format` | `enum ("text" \| "json")` | No | Compatibility option: "text" and "json" both return JSON in the text channel for successful or empty results. Read structuredContent for the result data. | | `limit` | `integer` | No | Max date-pairs to return (1-100). Default 20. | | `user_intent` | `string` | No | The end user's current request in their own words, e.g. "help me with my travel plans". Pass it as-is when short; otherwise condense the goal and constraints into 1-2 sentences. Strip personal identifiers (names, emails, phone numbers, addresses, payment details), replace them with placeholders like "\[name]". Optional. Jinko uses it to understand demand, and hotel_search uses it to rank hotel results against what the user asked for (e.g. "quiet, with a gym, near Times Square"), so keep the user's stated preferences in it. | # Find Destination Source: https://docs.gojinko.com/tools/find-destination Discover travel destinations accessible from your departure airports Surface inspiration when a user knows where they want to leave from but not where they want to go. Typical prompts include "cheap beach getaways from New York" or "weekend trips out of London under €200". Results come back ranked by lowest available fare so the user can compare options before committing to a route. > [accordion] Tool description (what the LLM sees) > > ```text theme={null} > Discover travel destinations accessible from your departure airports. > > Search globally or restrict results with the destinations list of IATA airport/city codes. For a region or theme, supply the relevant destination codes; there is no region parameter. Returns destinations sorted by cheapest available flight. > > ORIGINS: Use 3-letter IATA airport codes (CDG, JFK) or city codes (PAR, NYC). When listing airports, include the nearby airports the user can use (e.g., CDG + ORY for Paris). A code that names a multi-airport city covers every airport of that city; any other code is that one airport. LAX, MIA and LAS are both a city code and that city's main airport, so they are read as the city here. > > Next step: Use flight_calendar with the destination to get specific flights with offer_tokens for pricing. > > The result carries `search_criteria` (what was actually searched) and, on a non-empty answer, `next`: the `flight_calendar` calls for the best destinations. Follow `next` to price a destination; on an empty answer the `message` names the window that was searched. > > Every price this tool returns is one adult's cached fare (search_criteria.priced_for: "one_adult"); the tool takes no party. To price the whole party, price-check the offer using flight_search with price_check and the travellers' counts in traveler_counts. > ``` ## Parameters | Name | Type | Required | Description | | - | - | - | - | | `origins` | `array` | Yes | Origin airport IATA codes or city codes (3 letters). Include all nearby airports. Examples: \["JFK", "LGA", "EWR"] for NYC. A code that names a multi-airport city (NYC, LON, PAR, and LAX, MIA, LAS, which a city shares with its main airport) covers every airport of that city; any other code is that one airport. | | `destinations` | `array` | No | Filter to specific destination IATA codes. Omit for global discovery mode. | | `trip_type` | `enum ("oneway" \| "roundtrip")` | Yes | Trip type: "oneway" or "roundtrip". | | `departure_dates` | `array` | No | Specific departure dates (YYYY-MM-DD). Multiple dates searched with OR logic. | | `departure_date_ranges` | `array` | No | Departure date ranges for flexible search. | | `departure_date_ranges[].start` | `string` | Yes | Range start date (YYYY-MM-DD) | | `departure_date_ranges[].end` | `string` | Yes | Range end date (YYYY-MM-DD) | | `return_dates` | `array \| null` | No | Specific return dates (YYYY-MM-DD) for round-trip flights. | | `return_date_ranges` | `array \| null` | No | Return date ranges for flexible round-trip search. | | `stay_days` | `integer \| null` | No | Exact stay duration in days for round trips. Omit when trip_type is "oneway". | | `stay_days_range` | `object \| null` | No | Flexible stay duration range for round trips. Example: \{min: 5, max: 10}. Omit when trip_type is "oneway". | | `direct_only` | `boolean` | No | Only return nonstop flights. | | `cabin_class` | `enum ("economy" \| "premium_economy" \| "business" \| "first") \| null` | No | Cabin class filter. | | `max_total` | `number \| null` | No | Maximum total of the cached fare, in the requested currency. Cached fares are priced for one adult, so the cap applies to a one-adult fare. For a whole-party budget, divide it by the number of ADULTS only and treat the result as a loose pre-filter: children and lap infants usually cost less than an adult, so dividing by every traveller would exclude affordable trips. Send a per-person budget as-is. The exact whole-trip budget check is flight_search with max_total. | | `sort_by` | `enum ("lowest")` | No | Sort order. "lowest" (cheapest first) is the only order today; omit it for the same. | | `limit` | `integer` | No | Max destinations to return per page (1-100). Default 20. | | `offset` | `integer` | No | Number of destinations to skip, for pagination. Default 0. | | `currency` | `string` | No | ISO 4217 currency code. Defaults to "USD". | | `locale` | `string` | No | BCP 47 locale. Defaults to "en-US". | | `format` | `enum ("text" \| "json")` | No | Compatibility option: "text" and "json" both return JSON in the text channel for successful or empty results. Read structuredContent for the result data. | | `user_intent` | `string` | No | The end user's current request in their own words, e.g. "help me with my travel plans". Pass it as-is when short; otherwise condense the goal and constraints into 1-2 sentences. Strip personal identifiers (names, emails, phone numbers, addresses, payment details), replace them with placeholders like "\[name]". Optional. Jinko uses it to understand demand, and hotel_search uses it to rank hotel results against what the user asked for (e.g. "quiet, with a gym, near Times Square"), so keep the user's stated preferences in it. | ## Examples **Explore destinations under \$500 from New York in June:** ```json theme={null} { "name": "find_destination", "arguments": { "origins": ["JFK", "LGA", "EWR"], "trip_type": "roundtrip", "departure_date_ranges": [{ "start": "2027-06-01", "end": "2027-06-30" }], "stay_days_range": { "min": 5, "max": 10 }, "max_total": 500, "currency": "USD" } } ``` **Europe from Paris in spring, direct only:** ```json theme={null} { "name": "find_destination", "arguments": { "origins": ["CDG", "ORY"], "destinations": ["LHR", "AMS", "FRA", "MAD", "BCN", "ROM"], "trip_type": "roundtrip", "departure_date_ranges": [{ "start": "2027-04-01", "end": "2027-05-31" }], "stay_days": 3, "direct_only": true, "currency": "EUR" } } ``` Read destination summaries from the MCP result's `structuredContent.destinations[]`. A destination's cached candidate token is `offer_token`. On a non-empty result, `structuredContent.next` suggests `flight_calendar` calls for up to the first three destinations. If the chosen destination is among them, pass its matching `next.args` entry to `flight_calendar`. Read the calendar response's `structuredContent.next.args` for the live-pricing handoff: * When cached fares are found, choose a candidate and send its `price_check` object as the `flight_search` input's `price_check`. * When the calendar is empty, each suggested entry instead contains `search` and `traveler_counts`; pass a chosen entry as the `flight_search` input. Use live pricing before quoting or booking. # Flight Calendar Source: https://docs.gojinko.com/tools/flight-calendar Search flights between a known origin and destination for flexible dates Find priced itineraries between a known origin and destination using cached results, ideal when the user is flexible on dates. It answers questions like "cheapest week to fly Paris to Barcelona in June" or "best Friday to Sunday options from JFK to LAX next month". Each result includes an offer token; run a flight_search price check on it to get a bookable fare before adding the flight to a trip. > [accordion] Tool description (what the LLM sees) > > ```text theme={null} > Search flights between a known origin and destination using cached pricing, especially for flexible dates. > > WHEN TO USE THIS TOOL (CRITICAL): > - The user provides both an origin AND a destination (city or airport) > - Examples: "Paris to Barcelona", "JFK to CDG", "London to NYC for a weekend" > - Supports loose / flexible dates: single dates, date arrays, date ranges, stay_days > - ALSO the right tool for "cheapest flight", "best flight", "find me a flight", "cheapest date" phrasings, returns the cheapest cached itineraries. > > WHEN TO USE find_destination INSTEAD: > - The user does NOT specify a destination: "Where should I go from Paris?", "Best deals from NYC" > - The user wants inspiration: "Beach destinations from London", "Cheap flights from SF" > > WHEN TO USE find_dates INSTEAD: > - The user wants a short shortlist of the best date options rather than the full per-date list: one cheapest itinerary per (departure, return) date-pair, spread across the departure window. Same inputs as this tool except offset (find_dates does not paginate; limit scales the shortlist). > > WHEN TO USE flight_search INSTEAD: > - The user wants live pricing on one specific route with an exact departure date. For a round trip, also require an exact return date; one-way trips need no return date. > - Examples: "Paris → NYC one-way on June 17", "Paris → NYC, June 17 → June 26" > - flight_search hits live pricing (each call has a cost) and is the step immediately before booking. Use once the route and required travel dates are locked. > > IMPORTANT: > All dates in query parameters (departure_dates, departure_date_ranges, return_dates, return_date_ranges) MUST be in the future. Never use past dates. > Use departure_dates for specific days or departure_date_ranges for a window. There is no departure_date parameter. > Origin and destination: send the city code when the user named a city (Paris → PAR, New York → NYC) and the airport code when they named an airport (JFK, CDG). A code that names a multi-airport city covers every airport of that city; any other code is that one airport. LAX, MIA and LAS are both a city code and that city's main airport, so they are read as the city here, this tool has no type field; flight_search has origin_type / destination_type to pin one airport. > > ROUTE SEARCH: > - Use exact 3-letter IATA airport codes or IATA city code for both origin and destination > - Date ranges OR stay duration for flexible trip planning > - Natural trip duration (stay_days) instead of exact return dates > - By default, please search roundtrip flights unless user specifies one-way. Use trip_type="oneway" ONLY when the user explicitly asks for a one-way trip > > USE CASES: > ✓ "Find flights from JFK to CDG next month" - Specific route with date range > ✓ "Fly from Los Angeles to Tokyo for a week in December" - Uses departure_date_ranges + stay_days > ✓ "Paris to Barcelona for a weekend in April" - Specific route > ✓ "Cheapest flight from ORD to LHR under $600" - Specific route with budget > ✓ "Direct flight in business class from New York to London" - Specific route with preferences > > Flow: flight_calendar → flight_search (price-check) → trip → checkout > > The result carries `search_criteria` (what was actually searched) and `next` (the call to make next, on an empty answer up to three exact-date `flight_search` searches, on a non-empty one `price_check` for the best candidates). Follow `next` before telling the user there are no flights or quoting a cached price. > > Every price this tool returns is one adult's cached fare (search_criteria.priced_for: "one_adult"); the tool takes no party. To price the whole party, price-check the offer using flight_search with price_check and the travellers' counts in traveler_counts. > ``` ## Parameters | Name | Type | Required | Description | | - | - | - | - | | `origin` | `string` | Yes | Origin airport IATA code or city code (3 letters). Examples: "JFK", "PAR". A code that names a multi-airport city (NYC, LON, PAR, and LAX, MIA, LAS, which a city shares with its main airport) covers every airport of that city; any other code is that one airport. | | `destination` | `string` | Yes | Destination airport IATA code or city code (3 letters). Examples: "CDG", "NRT". A code that names a multi-airport city (NYC, LON, PAR, and LAX, MIA, LAS, which a city shares with its main airport) covers every airport of that city; any other code is that one airport. | | `trip_type` | `enum ("oneway" \| "roundtrip")` | Yes | Trip type: "oneway" or "roundtrip". | | `departure_dates` | `array` | No | Specific departure dates (YYYY-MM-DD). Multiple dates searched with OR logic. | | `departure_date_ranges` | `array` | No | Departure date ranges for flexible search. | | `departure_date_ranges[].start` | `string` | Yes | Range start date (YYYY-MM-DD) | | `departure_date_ranges[].end` | `string` | Yes | Range end date (YYYY-MM-DD) | | `return_dates` | `array \| null` | No | Specific return dates (YYYY-MM-DD) for round-trip flights. | | `return_date_ranges` | `array \| null` | No | Return date ranges for flexible round-trip search. | | `stay_days` | `integer \| null` | No | Exact stay duration in days for round trips. Auto-calculates return date. Omit when trip_type is "oneway". | | `stay_days_range` | `object \| null` | No | Flexible stay duration range for round trips. Example: \{min: 5, max: 10}. Omit when trip_type is "oneway". | | `direct_only` | `boolean` | No | Only return nonstop flights. | | `cabin_class` | `enum ("economy" \| "premium_economy" \| "business" \| "first") \| null` | No | Cabin class filter. | | `departure_time_range` | `object` | No | Filter the OUTBOUND leg by local departure time-of-day. Example: \{ "earliest": "08:00", "latest": "12:00" }. | | `departure_time_range.earliest` | `string` | No | Inclusive earliest local time-of-day (HH:MM, 24-hour). | | `departure_time_range.latest` | `string` | No | Inclusive latest local time-of-day (HH:MM, 24-hour). | | `arrival_time_range` | `object` | No | Filter the OUTBOUND leg by local arrival time-of-day. Example: \{ "latest": "20:00" }. | | `arrival_time_range.earliest` | `string` | No | Inclusive earliest local time-of-day (HH:MM, 24-hour). | | `arrival_time_range.latest` | `string` | No | Inclusive latest local time-of-day (HH:MM, 24-hour). | | `return_departure_time_range` | `object \| null` | No | Round-trip only. Filter the RETURN leg by local departure time-of-day. | | `return_arrival_time_range` | `object \| null` | No | Round-trip only. Filter the RETURN leg by local arrival time-of-day. | | `max_total` | `number \| null` | No | Maximum total of the cached fare, in the requested currency. Cached fares are priced for one adult, so the cap applies to a one-adult fare. For a whole-party budget, divide it by the number of ADULTS only and treat the result as a loose pre-filter: children and lap infants usually cost less than an adult, so dividing by every traveller would exclude affordable trips. Send a per-person budget as-is. The exact whole-trip budget check is flight_search with max_total. | | `sort_by` | `enum ("lowest")` | No | Sort order. "lowest" (cheapest first) is the only order today; omit it for the same. | | `currency` | `string` | No | ISO 4217 currency code. Defaults to "USD". | | `locale` | `string` | No | BCP 47 locale. Defaults to "en-US". | | `format` | `enum ("text" \| "json")` | No | Compatibility option: "text" and "json" both return JSON in the text channel for successful or empty results. Read structuredContent for the result data. | | `limit` | `integer` | No | Max results to return per page (1-100). Default 20. | | `offset` | `integer` | No | Number of results to skip, for pagination. Default 0. | | `user_intent` | `string` | No | The end user's current request in their own words, e.g. "help me with my travel plans". Pass it as-is when short; otherwise condense the goal and constraints into 1-2 sentences. Strip personal identifiers (names, emails, phone numbers, addresses, payment details), replace them with placeholders like "\[name]". Optional. Jinko uses it to understand demand, and hotel_search uses it to rank hotel results against what the user asked for (e.g. "quiet, with a gym, near Times Square"), so keep the user's stated preferences in it. | ## Examples **Cheapest days to fly JFK→CDG in June:** ```json theme={null} { "name": "flight_calendar", "arguments": { "origin": "JFK", "destination": "CDG", "trip_type": "roundtrip", "departure_date_ranges": [{ "start": "2027-06-01", "end": "2027-06-30" }], "stay_days": 7, "currency": "USD" } } ``` **One-way, direct-only, business class:** ```json theme={null} { "name": "flight_calendar", "arguments": { "origin": "CDG", "destination": "NRT", "trip_type": "oneway", "departure_date_ranges": [{ "start": "2027-09-01", "end": "2027-09-30" }], "cabin_class": "business", "direct_only": true, "currency": "EUR" } } ``` The response lists the cheapest flights found across the date range, not one entry per day. Read `structuredContent.flights` and pass the selected entry’s `id` to `flight_search` as `price_check.offer_token` for live pricing before booking. The calendar’s `next.args` also provides ready-to-use price-check arguments. # Flight Exchange Source: https://docs.gojinko.com/tools/flight-exchange Exchanges a booked flight for a different itinerary ## When an exchange can't be completed automatically Pricing may say that the exchange needs Jinko support, and states what the customer would owe when that is known. Pricing does not open a case: after the traveler confirms, commit the same offer without a `quote_id` to send the request to support. A commit refusal with `manual_handling.status: "pending"` means support has the request and will complete the exchange; they contact the traveler about any payment. Show the refusal message and read `get_booking` to track `items[].servicing.exchange`: `attention_required`, then `in_progress`, then `succeeded`, or `failed` if support closes the request. Do not retry commit automatically or claim the ticket has already changed. The existing exchange confirmation email is sent on completion; no email is sent when the case opens. See [Flight exchanges](/guides/flight-exchanges#when-an-exchange-cant-be-completed-automatically) for the customer messages and support workflow. > [accordion] Tool description (what the LLM sees) > > ```text theme={null} > Exchanges a booked flight for a different itinerary. > > get_booking with booking_ref (and last_name for guests) returns items[] with servicing eligibility and refusal reasons for item selection. The same booking_ref + booked_item_id identifies the selected item on every action, including commit and status. booked_item_id is the stable booked item, even after an exchange. last_name is required for guests and optional for authenticated owners. A 409 with items[] means customer selection is needed; a retry identifies that choice with booked_item_id. > > Guest verification uses the Jinko booking reference and traveler last name; no login is required. > > The workflow is shop → price → commit → status: > 1. action="shop" with booking_ref + booked_item_id (plus last_name for guests) and segments_to_exchange browses exchange alternatives. segments_to_exchange names each leg to change by the airports get_booking lists for it (the leg's first departure and final arrival airport, not a connection airport) with its new departure_date; legs not named stay as booked. To change only the return, name only the return leg. A refusal names the booked legs. > 2. action="price" with the same identity and offer_id obtains exact pricing: the current ticket, the new ticket's value, the airline change fee if any, and the amount due. An exchange does not pay a price difference back: when the new ticket costs less than the current one, nothing is due, or only the airline change fee, and the price states the difference that is not refunded. > 3. action="commit" with the same identity, offer_id and the quote_id from price carries out the exchange the customer agreed to after seeing that price: its ticket values, change fee, amount due and the new fare's terms. An exchange can involve an additional payment. When the customer pays a difference, the commit returns a payment page: the exchange is carried out only after that payment is authorized, so send the customer to the page; action="status" returns the same page while it waits. A price that can't be completed automatically returns no quote_id, and states what the customer would owe when that is known: if the traveler confirms, commit the same offer_id without one, which sends the request to Jinko support. > 4. action="status" with the same identity reports exchange progress. > > When the answer carries customer_amounts (the price prints "Current ticket" and "New ticket"), its figures obey: current ticket + amount due = new ticket + change fee + residual value + price difference not refunded (an absent figure counts as 0). > Answers without customer_amounts carry older supplier figures that need not add up; the identity does not apply to those answers. > The "You pay" line, or "No payment", gives the amount due directly, without reconstruction from the ticket values and change fee. With several tickets, a "Per ticket" block gives each ticket's change fee and amount due. > In the structured result, customer_amounts holds the traveler's figures when present; the top-level fare_difference, original_fare, new_fare and penalty_amount keep an older supplier meaning and are not the traveler's figures. > > The airline reference is the locator usable on the airline's site or at check-in. If absent from this result, get_booking or the original confirmation can supply it. The same booking_ref + booked_item_id identifies the booked item after an exchange. > > An exchange re-fares the ticket, so the traveler ends up on a different product. A price output that opens with "FARE CHANGE" states the one change the amount due does not show: a cheaper exchange can still move the traveler off a refundable fare. The "New fare" block gives the new fare's refund policy, change policy, checked baggage and carry-on. "Not stated by the fare" means the provider stated no rule: it is unknown, which is neither "non-refundable" nor "included", and the replaced ticket's rules are not carried over to it. > ``` ## Parameters | Name | Type | Required | Description | | - | - | - | - | | `action` | `enum ("shop" \| "price" \| "commit" \| "status")` | Yes | Action to perform: "shop" to browse exchange alternatives, "price" to get exact pricing for an offer, "commit" to execute the exchange, "status" to poll exchange progress | | `booking_ref` | `string` | Yes | Trip-level Jinko booking_ref returned by get_trip or submit_agent_payment. Use it to look up the booking with get_booking. | | `booked_item_id` | `string \| null` | No | The booked item to service: booked_item_id from get_booking.items\[] (an "itm\_…" string). Send it on every action. May be omitted only when the booking has exactly one item in this domain. | | `last_name` | `string \| null` | No | Primary traveler last name. Required for guests; optional for an authenticated owner of the booking. | | `offer_id` | `string \| null` | No | Exchange offer ID returned from a previous shop action. Required for price and commit actions. | | `quote_id` | `string \| null` | No | The quote_id a previous price action returned. Required for commit action, except after a price that can't be completed automatically, which returns none: committing the same offer_id then sends the request to Jinko support. A not_exchangeable refusal is final: the booking cannot be exchanged as it stands. | | `segments_to_exchange` | `array \| null` | No | Required with action "shop". One entry per leg to change; legs not listed stay exactly as booked. Name each leg by the airports get_booking lists for it. | | `user_intent` | `string` | No | The end user's current request in their own words, e.g. "help me with my travel plans". Pass it as-is when short; otherwise condense the goal and constraints into 1-2 sentences. Strip personal identifiers (names, emails, phone numbers, addresses, payment details), replace them with placeholders like "\[name]". Optional. Jinko uses it to understand demand, and hotel_search uses it to rank hotel results against what the user asked for (e.g. "quiet, with a gym, near Times Square"), so keep the user's stated preferences in it. | ## Examples **Shop for exchange options (guest path):** Name each leg to change in `segments_to_exchange` by the airports `get_booking` lists for it: the leg's first departure and final arrival, not a connection airport. Legs you do not name stay as booked. This moves only the return of a JFK ⇄ LHR round trip: ```json theme={null} { "name": "flight_exchange", "arguments": { "action": "shop", "booking_ref": "JNK-ABC123", "last_name": "Doe", "segments_to_exchange": [ { "origin": "LHR", "destination": "JFK", "departure_date": "2027-07-15" } ] } } ``` Response lists alternative itineraries with `offer_id` per option. A selection the booking refuses prints its code and the booked legs, for example `LEG_ALREADY_DEPARTED` for a leg that has flown, or `INVALID_SEGMENTS_TO_EXCHANGE` for a leg named by a connection airport. An entry the tool's input check refuses (a missing field, or a date not written YYYY-MM-DD) is answered before the booking is read, without the booked legs. **Price a specific offer:** ```json theme={null} { "name": "flight_exchange", "arguments": { "action": "price", "booking_ref": "JNK-ABC123", "last_name": "Doe", "offer_id": "exch_offer_abc" } } ``` Returns the exchange in the traveler's own figures, and a `quote_id` to commit against. Moving a ZZ Standard ticket to ZZ Flex on the [sandbox test airline](/guides/testing-in-sandbox#exchange) prints these lines: ```text theme={null} Payment Outcome: ADD_COLLECT Current ticket: USD 789.00 New ticket: USD 1062.00 Change fee: USD 25.00 You pay: USD 298.00 ``` `structuredContent.data.customer_amounts` carries the same figures as money objects: `original_fare` (what the traveler paid for the ticket), `new_fare` (the new ticket's value), `penalty_amount` (the airline's change fee, absent when there is none), `total_due` (exactly what is charged), `non_refundable_difference` (the price difference the exchange does not pay back when the new ticket costs less, present only when there is one), and `residual_value` (the part of the original fare the airline keeps as a credit in the traveler's name after an exchange to a cheaper fare, present only when the airline reports one; it is not refunded to the card and not part of `total_due`). They add up: `original_fare + total_due = new_fare + penalty_amount + residual_value + non_refundable_difference`, an absent figure counting as 0, here 789.00 + 298.00 = 1062.00 + 25.00. The top-level `fare_difference`, `original_fare`, `new_fare` and `penalty_amount` are the supplier's figures and are deprecated. **Commit the exchange:** ```json theme={null} { "name": "flight_exchange", "arguments": { "action": "commit", "booking_ref": "JNK-ABC123", "last_name": "Doe", "offer_id": "exch_offer_abc", "quote_id": "sess_xyz789" } } ``` When the customer pays more (`ADD_COLLECT`), the commit does not change the ticket yet. It prints the payment page: ```text theme={null} Status: pending Payment Outcome: ADD_COLLECT Waiting for the customer's payment. Payment page: https://app.gojinko.com/checkout?t=… The exchange is carried out only after this payment is authorized. Send the customer to this page, then call action="status" to follow the exchange. ``` Send the customer to that page. It takes the payment for up to one hour, or until the new fare's own deadline when that comes sooner. While the exchange waits for the payment, `status` prints the same page, and a second `commit` prints `exchange_in_progress` instead of starting another exchange. If the customer has not paid by then, the exchange is cancelled within a minute: `status` prints `failed` with the reason and no page, nothing is charged, the booking is unchanged, and a new `commit` starts a new exchange with a new page. **Poll status:** ```json theme={null} { "name": "flight_exchange", "arguments": { "action": "status", "booking_ref": "JNK-ABC123", "last_name": "Doe", "booked_item_id": "itm_aaaaaaaaaaaaafhuxsdxpbzrbfz5hm3a" } } ``` > [!NOTE] > > Run the four steps in order. Show the priced `total_due`, any penalty and any price difference that is not refunded to the user for confirmation before calling `commit`. Poll with the same `booking_ref` and the selected `booked_item_id` from `get_booking`. # Flight Price Advice Source: https://docs.gojinko.com/tools/flight-price-advice Accept a flight with its current price for price advice Compare a supplied fare with typical fares for comparable flights and receive fixed 1-day and 3-day price forecasts. Each available forecast includes a forecasted price and estimated probabilities that the price will increase, decrease, or remain unchanged. Initial numeric coverage is one-adult, nonstop, USD; one-way, and round-trip with return_date; other valid inputs return a reasoned unavailable result. > [accordion] Tool description (what the LLM sees) > > ```text theme={null} > Accepts a flight with its current price and returns price advice when data covers the request. > > The response contains fixed 1-day and 3-day price forecasts; the user does not select a wait duration. Each available forecast includes a forecasted price and estimated probabilities that the price will increase, decrease, or remain unchanged relative to current_price. price_assessment compares the supplied fare with typical prices for comparable flights. recommendation.summary is deterministic and can be displayed without an LLM. > > The current_price is the one-adult total including tax and excluding optional paid extras. Its value is an integer in minor units: {value:32000,currency:"USD",decimal_places:2} means USD 320.00. Initial numeric coverage is one-adult, nonstop, USD; one-way, and round-trip with return_date. A round trip requires return_date, on or after departure_date; omit return_date for a one-way trip. For a round trip, stops 0 means nonstop on both the outbound and the inbound flight. Other structurally valid currencies and stop counts are accepted and return an unavailable reason when statistics do not cover them. Omit stops when the actual number of connections is unknown. This tool does not search, monitor, quote, or book flights. > ``` ## Parameters | Name | Type | Required | Description | | - | - | - | - | | `origin` | `string` | Yes | Uppercase three-letter IATA city code for the flight's origin. Airport codes are not mapped to cities. | | `destination` | `string` | Yes | Uppercase three-letter IATA city code for the flight's destination; it must differ from origin. Airport codes are not mapped to cities. | | `departure_date` | `string` | Yes | Departure date in YYYY-MM-DD format; it must be a real calendar date strictly after the current UTC date. | | `trip_type` | `enum ("oneway" \| "roundtrip")` | Yes | Trip shape: oneway or roundtrip. A roundtrip requires return_date. | | `return_date` | `string \| null` | No | Return date in YYYY-MM-DD format; it must be a real calendar date on or after departure_date. Required when trip_type is roundtrip; omit it when trip_type is oneway. | | `stops` | `enum (0 \| 1 \| 2) \| null` | No | Actual number of flight connections: 0 for nonstop, 1, or 2. Omit when unknown. For a round trip, 0 means nonstop on both the outbound and the inbound flight; 1 and 2 are not covered for round trips. | | `cabin_class` | `enum ("economy" \| "premium_economy" \| "business" \| "first")` | Yes | Cabin class: economy, premium_economy, business, or first. | | `current_price` | `object` | Yes | One adult's total fare including tax for the supplied trip, excluding optional paid extras. | | `current_price.value` | `integer` | Yes | One adult total fare as a positive safe integer in minor units. | | `current_price.currency` | `string` | Yes | Supported uppercase ISO 4217 currency code. | | `current_price.decimal_places` | `integer` | Yes | Currency minor-unit precision; it must match the currency's ISO 4217 value. | | `user_intent` | `string` | No | The end user's current request in their own words, e.g. "help me with my travel plans". Pass it as-is when short; otherwise condense the goal and constraints into 1-2 sentences. Strip personal identifiers (names, emails, phone numbers, addresses, payment details), replace them with placeholders like "\[name]". Optional. Jinko uses it to understand demand, and hotel_search uses it to rank hotel results against what the user asked for (e.g. "quiet, with a gym, near Times Square"), so keep the user's stated preferences in it. | # Flight Refund Source: https://docs.gojinko.com/tools/flight-refund Cancels a booked flight, refunding tickets or voiding them inside the airline's void window > [accordion] Tool description (what the LLM sees) > > ```text theme={null} > Cancels a booked flight, refunding tickets or voiding them inside the airline's void window. > > get_booking with booking_ref (and last_name for guests) returns items[] with servicing eligibility and refusal reasons for item selection. The same booking_ref + booked_item_id identifies the selected item on every action, including commit and status. booked_item_id is the stable booked item, even after an exchange. last_name is required for guests and optional for authenticated owners. A 409 with items[] means customer selection is needed; a retry identifies that choice with booked_item_id. > > The preview costs nothing and cancels nothing. The workflow is preview → commit → status: > 1. action="preview" (the default) with booking_ref + booked_item_id (plus last_name for guests) returns refund versus void, the penalty, the customer refund, covered tickets, and an "svq_…" quote handle. > 2. The preview's penalty and customer refund are the figures the customer agrees to. > 3. action="commit" takes the same identity as the preview, quote_id="svq_…", and acknowledged = the preview's refund object (value, currency, decimal_places), copied field for field. It returns an "svc_…" operation handle. The platform refuses a commit without a live quote handle from a preview. When the amount has moved since the preview, it refuses the commit and returns a fresh quote with the new figure. > 4. action="status" with the same booking_ref + booked_item_id and operation="svc_…" reports the airline's answer, every ticket's state, and the money's progress through its terminal state. > > A void returns the original charge except any part the preview lists as paid later; a refund returns what the customer paid less the penalty. A ticket that was exchanged gets back what the airline refunds for the ticket now held, whether voided or refunded. The preview identifies which outcome applies, lists covered documents and marks extras excluded from its immediate refund. Its customer refund and penalty are the customer-facing figures. > > fee_known: false means the penalty and amount remain to be confirmed, rather than free cancellation. support_level "MANUAL_REQUIRED" means a person at Jinko completes the cancellation. A commit with manual_ok=true hands the cancellation to Jinko support; nothing reaches the airline until a person at Jinko completes it. Such a commit includes acknowledged when the preview carries a refund. When the penalty could not be established and the preview carries no refund, manual_ok travels without acknowledged and Jinko support establishes the amount. > > action="check" (deprecated: use "preview") is a read-only eligibility probe that quotes no customer figure and returns no quote handle, so a commit cannot be made from it. A "Reason:" line on a check or refusal is the supplier's classification (NON_REFUNDABLE_FARE, EXCHANGED_TICKET, CARRIER_NOT_AUTHORIZED, DOCUMENT_RETIRED). These distinguish a fare nobody can refund from a ticket requiring an agent's manual refund; they are separate outcomes rather than a single "not refundable" answer. > > Guest usage (no login required): > flight_refund({ action: "preview", booking_ref: "JNK-A7B3X9", booked_item_id: "itm_aaaaaaaaaaaaafhuxsdxpbzrbfz5hm3a", last_name: "Doe" }) > Authenticated owner usage: > flight_refund({ action: "preview", booking_ref: "JNK-A7B3X9", booked_item_id: "itm_aaaaaaaaaaaaafhuxsdxpbzrbfz5hm3a" }) > > action="refund" (deprecated: use "preview" then "commit") is the legacy one-shot path for existing integrations: it prices and refunds in a single call, so no quote is shown before the refund. > > A paid seat the airline settles itself is refunded once the airline refunds us; the preview lists it under seat_refunds as pending, separate from the fare refund. > ``` ## Parameters | Name | Type | Required | Description | | - | - | - | - | | `action` | `enum ("preview" \| "commit" \| "status" \| "check" \| "refund")` | No | Action. "preview" (default) prices the cancellation and returns a quote handle without cancelling anything, it shows the customer whether this is a refund or a void, the penalty and the amount they get back. "commit" cancels, using the quote handle and the refund the customer acknowledged. "status" reports where a committed cancellation, its tickets and its refund got to. "check" (deprecated: use "preview") is the read-only eligibility probe and quotes no customer figure. "refund" (deprecated: use "preview" then "commit") is the legacy one-shot path that prices and refunds in a single call, with no chance to confirm the figures first. | | `booking_ref` | `string` | Yes | Trip-level Jinko booking_ref returned by get_trip or submit_agent_payment. Use it to look up the booking with get_booking. | | `booked_item_id` | `string \| null` | No | The booked item to service: booked_item_id from get_booking.items\[] (an "itm\_…" string). Send it on every action. May be omitted only when the booking has exactly one item in this domain. | | `last_name` | `string \| null` | No | Primary traveler last name. Required for guests; optional for an authenticated owner of the booking. | | `quote_id` | `string \| null` | No | The "svq\_…" handle a prior action "preview" returned. Required for action "commit". It binds the cancellation to the figures the customer was shown. | | `acknowledged` | `object \| null` | No | The preview's `refund` object copied field for field, the amount the customer agreed to. Required for action "commit", except when submitting a MANUAL_REQUIRED preview that carried no figure at all (manual_ok, see below). It retains the original value and scale: the platform compares it against the live figure and refuses the commit with a fresh quote when they differ, rather than settling at a number nobody was shown. | | `manual_ok` | `boolean` | No | For a preview with support_level "MANUAL_REQUIRED", this flag hands it to Jinko support. Nothing is sent to the airline until a person at Jinko completes it. Without this flag such a commit is refused. The preview's `refund` accompanies it as `acknowledged` whenever the preview carried one; a preview whose penalty was not established carries none, and then this flag travels alone and Jinko support establishes the amount. | | `operation` | `string \| null` | No | The "svc\_…" operation handle a prior action "commit" returned. Required for action "status", unless you are following a legacy refund through refund_reference. | | `user_intent` | `string` | No | The end user's current request in their own words, e.g. "help me with my travel plans". Pass it as-is when short; otherwise condense the goal and constraints into 1-2 sentences. Strip personal identifiers (names, emails, phone numbers, addresses, payment details), replace them with placeholders like "\[name]". Optional. Jinko uses it to understand demand, and hotel_search uses it to rank hotel results against what the user asked for (e.g. "quiet, with a gym, near Times Square"), so keep the user's stated preferences in it. | ## Examples Start with `get_booking`, then choose the flight’s `booked_item_id`. Use the same booking reference, item, and authentication throughout the operation. **Preview the customer’s refund:** ```json theme={null} { "name": "flight_refund", "arguments": { "action": "preview", "booking_ref": "JNK-ABC123", "booked_item_id": "itm_aaaaaaaaaaaaafhuxsdxpbzrbfz5hm3a", "last_name": "Doe" } } ``` This example uses guest verification (`booking_ref` + `last_name`). An authenticated owner can omit `last_name`; the credential must own the booking. Choose one authentication mode and keep it for every action. Do not add `order_id` to these requests. **Commit after the customer agrees to the preview:** Copy the returned `quote_id` and the preview’s `refund` object into `acknowledged`, field for field. The values below are illustrative; use the actual preview values. ```json theme={null} { "name": "flight_refund", "arguments": { "action": "commit", "booking_ref": "JNK-ABC123", "booked_item_id": "itm_aaaaaaaaaaaaafhuxsdxpbzrbfz5hm3a", "last_name": "Doe", "quote_id": "svq_01J7ZQ8F4M3K9W2B", "acknowledged": { "value": 15977, "currency": "USD", "decimal_places": 2 } } } ``` **Poll the returned operation handle:** ```json theme={null} { "name": "flight_refund", "arguments": { "action": "status", "booking_ref": "JNK-ABC123", "booked_item_id": "itm_aaaaaaaaaaaaafhuxsdxpbzrbfz5hm3a", "last_name": "Doe", "operation": "svc_01J7ZR5Q2KME8V4T" } } ``` The operation’s `state` uses lowercase values: `in_progress` and `attention_required` are non-terminal; `succeeded` and `failed` are terminal. Keep polling when Jinko needs to resolve `attention_required`. Read the supplier outcome and money state before telling the customer the refund is complete. > [!NOTE] > > `preview` cancels nothing. A legacy `check` call does not return a `quote_id` and cannot replace a preview. For a `MANUAL_REQUIRED` preview, follow the tool’s `manual_ok` instructions; omit `acknowledged` only when that preview carried no refund figure. # Flight Search Source: https://docs.gojinko.com/tools/flight-search Get live flight pricing, search by route, or re-price a known offer ## Cabin class and empty live searches For `search`, omit `cabin_class` or send `null` when the user has not chosen a cabin. Providers search economy by default, and other recognized cabins can still be returned. Send an explicit cabin only when the user requests it: fares must match on the longest segment, while shorter connections may use another cabin. On flights entirely within the United States (including Puerto Rico and the US Virgin Islands), `business` also returns `first` fares, because US airlines sell the domestic premium cabin as first; those fares keep cabin `first`. When the live search finds no matching offers, the tool returns a successful result with `status: "empty"`, `reason: "no_matches"`, and an `instruction` to explain the outcome: it asks the user which filter to relax when the search sent a narrowing filter, and otherwise whether to try other dates or airports. Do not silently change the cabin or other filters. This holds even when one airline source could not be searched, as long as another answered; results do not say which sources failed. A search where every source failed returns an error result with retry guidance and one of the fixed messages listed in [Messages on supplier failures](/concepts/errors#messages-on-supplier-failures); preserve the filters when retrying later. These rules apply to `search`. `price_check` and cache-based discovery keep their existing behavior. Fetch live, bookable pricing for a specific route and date pair. Use it once the user has settled on exact travel dates, for example "Paris to New York departing June 1 returning June 8 in economy". It also reprices an offer surfaced earlier by the calendar or destination tools so you can confirm availability before adding it to a trip. > [accordion] Tool description (what the LLM sees) > > ```text theme={null} > Get live flight pricing and fare options. Provide exactly one of the "search" or "price_check" nested objects. Set the unused one to null or leave it out; for a route search, send "price_check": null. > > 1. search: Live flight search by route and dates. > Example: { "search": { "origin": "PAR", "destination": "NYC", "departure_date": "2027-06-01" } } > Required fields: origin, destination, departure_date. > ROUTE CODES: the city code when the user named a city (PAR, NYC), the airport code when they named an airport (CDG, JFK). Untyped, a code that names a multi-airport city is searched as the city and any other code as the airport. LAX, MIA and LAS are both a city code and that city's main airport, so untyped LAX is the Los Angeles CITY and the provider returns other Los Angeles airports too (Ontario, ONT, often cheapest). When the user said "LAX", send destination_type: "airport". > Optional filters: return_date, trip_type, cabin_class, max_stops, multi_fare, max_total (whole-trip budget for all travelers), limit, include_carriers, exclude_carriers, single_carrier_only, departure_time_range, arrival_time_range, return_departure_time_range, return_arrival_time_range, connection_time_min_minutes, connection_time_max_minutes, max_total_duration_minutes, refundable_only, changeable_only, checked_bag_included, via_airports, exclude_via_airports, aircraft_types, origin_alternate_airports, destination_alternate_airports, nearby_airports, same_connection_airport_only, same_origin_airport_only, same_turnaround_airport_only, origin_type, destination_type. > DATE FLEXIBILITY: this call prices ONE exact date pair. Send "give or take a day", open windows and date ranges to flight_calendar instead. flight_calendar takes only direct_only, cabin_class, max_total and the time windows, refundable_only, changeable_only, checked_bag_included, max_stops and the carrier lists are NOT in its input. So when the user gave constraints like those, do not stop at the calendar result: once they pick dates there, call flight_search again on those exact dates WITH the original filters. The calendar's (and find_destination's) max_total caps a cached fare, and cached fares are priced for one adult; a whole-party budget is divided by adults only for a loose pre-filter there. This tool's max_total covers the whole trip for all travelers, send the user's whole-trip figure unchanged, or for a per-person figure multiply by the number of travelers. Do not carry the calendar figure across unchanged for a party of several. > > 2. price_check: Get live pricing for a specific flight deal. In structuredContent, use flights[].offer_token from flight_calendar or find_dates, destinations[].offer_token from find_destination, or flight.offer_token from price_monitoring as price_check.offer_token. An offer_id or a trip_item_token from an earlier flight_search is also accepted and answers for that offer with all its fares. A flight_search result needs no price_check: add its trip_item_token with the trip tool. > Example: { "price_check": { "offer_token": "token_from_discovery" } } > > IMPORTANT: "search" and "price_check" are nested objects, not string values. Do NOT pass them as strings. > > RESPONSE: > - The text result is a summary, not JSON: the itinerary count, carriers, stops and price range, then each itinerary's legs (local times, durations, stopovers) and one line per fare ending in trip_item_token=, with that fare's price, refund, change and checked-bag terms on the same line. Every bookable token is listed. > - structuredContent carries the full payload: every flight with detailed segments and fare options with baggage/refund/change rules and a trip_item_token per fare. Every fare also carries refundable, changeable and checked_bag_included booleans. > - FILTERS: Every filter that narrows the results (cabin on the longest segment, stops, price, airlines, times, connections, fare conditions, aircraft) is applied exactly as sent: no returned itinerary breaks one, except that business also returns first fares on flights entirely within the United States, where the premium cabin is sold as first. Options that widen a search (alternate or nearby airports) are searched where the source supports them, and sources search at most 9 via_airports per leg. An empty result carries an instruction: relay it. It asks which filter to relax only when a narrowing filter was sent; otherwise it asks about other dates or airports. > - origin_alternate_airports / destination_alternate_airports are searched beside an airport or a city anchor: origin NYC with ["BOS"] covers New York's airports and Boston. > - price_check may return status "offer_unavailable" when the selected offer no longer matches, including its cabin. The same flight may still have other fares. Show any returned alternatives and ask the user to choose; do not book the original offer. > > NEXT STEP: Use the trip tool with add_item and the trip_item_token from the fare the user selects. > > Flow: discovery (flight_calendar / find_destination) or price_monitoring or direct search → flight_search → trip → checkout > > PASSENGERS: If a search fails, surface the error, never retry with a changed passenger list (e.g. dropping an infant); that silently changes the user's request. > > PRICES: total_price is for all travellers; price_per_person is per person. > ``` ## Parameters | Name | Type | Required | Description | | - | - | - | - | | `search` | `object \| null` | No | Live flight search by route and dates. Use city codes when the user named a city (PAR, NYC) and airport codes when they named an airport (CDG, JFK). A code a city shares with its main airport (LAX, MIA, LAS) is read as the CITY unless you send origin_type / destination_type "airport", send it when the user said "LAX", since the city search returns other Los Angeles airports such as Ontario (ONT). Takes ONE anchor departure_date (+ return_date for a round trip), no date ranges and no date arrays. Any date flexibility ("give or take a day", open windows, an ask with no anchor date at all, or a range implying several candidate departure/return pairs) goes to flight_calendar instead. | | `price_check` | `object \| null` | No | Get live pricing for a specific flight deal. Returns confirmed fares with trip_item_token for booking. Accepts no search filters, the cached offer already has a concrete route, cabin, carrier, and price. | | `traveler_counts` | `object` | No | How many travelers of each type. Defaults to 1 adult. | | `traveler_counts.adults` | `integer` | No | Adult travelers (12+) | | `traveler_counts.children` | `integer` | No | Child travelers (2-11) | | `traveler_counts.infants` | `integer` | No | Infant travelers (under 2), traveling on an adult's lap. Seated infants (own seat) are not supported. | | `currency` | `string` | No | ISO 4217 currency code. Defaults to "USD". | | `locale` | `string` | No | BCP 47 locale. Defaults to "en-US". | | `user_intent` | `string` | No | The end user's current request in their own words, e.g. "help me with my travel plans". Pass it as-is when short; otherwise condense the goal and constraints into 1-2 sentences. Strip personal identifiers (names, emails, phone numbers, addresses, payment details), replace them with placeholders like "\[name]". Optional. Jinko uses it to understand demand, and hotel_search uses it to rank hotel results against what the user asked for (e.g. "quiet, with a gym, near Times Square"), so keep the user's stated preferences in it. | ## Examples **Price-check a specific offer from discovery:** ```json theme={null} { "name": "flight_search", "arguments": { "price_check": { "offer_token": "offer_ABc123xYz..." } } } ``` **Live search by route (no prior discovery):** ```json theme={null} { "name": "flight_search", "arguments": { "search": { "origin": "PAR", "destination": "NYC", "departure_date": "2027-06-15", "return_date": "2027-06-22", "cabin_class": "economy" } } } ``` **Live search with passenger mix + max price filter:** ```json theme={null} { "name": "flight_search", "arguments": { "search": { "origin": "CDG", "destination": "JFK", "departure_date": "2027-07-01", "max_total": 1200, "max_stops": 0 }, "traveler_counts": { "adults": 2, "children": 1 } } } ``` The response has detailed segments and fare options for each itinerary. Fare brands can share the same cabin: compare each fare's `brand_name`, `cabin_class`, baggage, refund and change terms. Pass the `trip_item_token` from the fare the traveler selects to `trip(add_item)`. > [!NOTE] > > If `price_check` returns `status: "offer_unavailable"`, the selected offer no longer matches. Search again and ask the user to choose an available live fare. # Read a Best Price Guarantee claim Source: https://docs.gojinko.com/tools/get-best-price-guarantee Read the result of a claim A claim made with claim_best_price_guarantee answered "pending", or the traveller asks what became of one. Pass the id the claim returned; the answer is the new offer, a decline, or "pending" again. > [accordion] Tool description (what the LLM sees) > > ```text theme={null} > Best Price Guarantee: reads the result of a claim already made with claim_best_price_guarantee. It changes nothing, and it does not make a claim: to ask for a lower price, call claim_best_price_guarantee. > > HOW TO CALL: > - id = the "ngo_…" id the claim returned (not a trip id, not an offer id). > - wait_seconds (0-20, default 15) is how long the call waits for a review that is still running. > > WHAT THE TRAVELLER MUST SUPPLY: > - The link to the page showing the lower price, the hotel's own page on that site, for the same dates and guests, and, on most accounts, an https address a screenshot of that page can be downloaded from. Both come from the traveller. Never build, guess or reuse one. Jinko opens the link and checks the hotel, the dates, the guests, the room, the board, the cancellation terms and the price. > - The total they would pay at booking on that page, in the currency of the Jinko offer. Taxes payable at the property are not part of it. A price in another currency is declined, not converted. > > WHAT COMES BACK: > - "offered": a new offer (offer.trip_item_token, starting with htl_neg_) at offer.price_money, valid until offer.expires_at. offer.saving_money is the saving against the rate's current standard price (offer.original.total_money, which can be lower than the price the earlier search showed); 0 means that current price was already at or below the reference. > - "declined": no offer, with decline.reason, and decline.detail when the check of the reference page found something to explain, pass it on to the traveller. The offer from hotel_search can usually still be booked at its own price. > - "pending": the review is still running; reading the reference page can take a few minutes. It is not a decline and not a failure, read the result with get_best_price_guarantee; do not tell the traveller it failed. > - "expired": the offer was not used in time. > > BOOKING THE NEW OFFER: > - Call trip with add_item.trip_item_token = offer.trip_item_token, then checkout, exactly as for any hotel offer. > - A trip that holds the new offer can hold nothing else. Start a new trip (no trip_id); or, when the trip holds only the offer being replaced, send remove_item for that item and add_item for the new offer in the same trip call. Adding it beside another item is refused. > - The price at checkout can move with the supplier. > > WORDING: this is the price Jinko can offer after its own review. Do not tell the traveller that Jinko negotiated with the hotel or contacted it. A claim can be declined, so do not promise a match before the result says "offered". > ``` ## Parameters | Name | Type | Required | Description | | - | - | - | - | | `id` | `string` | Yes | The id of the claim: the `ngo_…` value claim_best_price_guarantee returned as `id`. It is not a trip id and not an offer id. | | `wait_seconds` | `integer` | No | How long this call waits for the result before answering, 0-20 seconds (default 15). It only decides when the call returns; the review continues either way. | | `user_intent` | `string` | No | The end user's current request in their own words, e.g. "help me with my travel plans". Pass it as-is when short; otherwise condense the goal and constraints into 1-2 sentences. Strip personal identifiers (names, emails, phone numbers, addresses, payment details), replace them with placeholders like "\[name]". Optional. Jinko uses it to understand demand, and hotel_search uses it to rank hotel results against what the user asked for (e.g. "quiet, with a gym, near Times Square"), so keep the user's stated preferences in it. | # Get Booking Source: https://docs.gojinko.com/tools/get-booking Look up a booking and choose the item to service Start every servicing workflow here. Retrieve the booking, choose the intended booked_item_id, and inspect that item's servicing eligibility and refusal reasons. > [accordion] Tool description (what the LLM sees) > > ```text theme={null} > Start here before flight_refund, flight_exchange, hotel_cancel or car_cancel. Retrieve a booking by its Jinko booking_ref, then choose the intended items[] entry. > > Each item has a stable booked_item_id (an "itm_…" string), itinerary summary, confirmation, supplier_references (the confirmations the airline, hotel or rental company issued), status and servicing eligibility: can_refund, can_void, can_exchange, refund_support_level, exchange_support_level and refusal reasons/reason_code. Use booking_ref + that booked_item_id on every subsequent servicing action. Keep the same booked_item_id after an exchange. booking_state summarizes the booking's progress after payment. > > A flight item's confirmation.details.flight.fare_conditions lists the fare's refund and change rules (rule_type, penalty, penalty_fee). They are an estimate kept with the booking, not a live check: whether a refund or change can be done is confirmed by the refund or exchange tools when it starts. > > check_eligibility (default true) checks each item's servicing eligibility live with the airline or supplier, which can add several seconds for a flight. Send check_eligibility: false to list or display a booking; leave it out or send true when the user wants to cancel or change, before the refund or exchange tools. > > last_name is required for guests and optional for an authenticated owner. No login is needed for guest lookup. > > USAGE: get_booking({ booking_ref: "JNK-A7B3X9", last_name: "Doe" }) > > booking_ref is the JNK-XXXXXX reference from the confirmation email, get_trip or submit_agent_payment. The airline record locator (pnr) in a flight item's supplier_references is for airline check-in; servicing uses booking_ref + booked_item_id. > ``` ## Parameters | Name | Type | Required | Description | | - | - | - | - | | `booking_ref` | `string` | Yes | Trip-level Jinko booking_ref returned by get_trip or submit_agent_payment. Use it to look up the booking with get_booking. | | `last_name` | `string \| null` | No | Primary traveler last name. Required for guests; optional for an authenticated owner of the booking. | | `check_eligibility` | `boolean` | No | Check now, with the airline or supplier, whether each item can be voided, refunded or exchanged (items\[].servicing). Defaults to true. For flights this can add several seconds; send false to read the booking and its stored fare conditions only. | | `user_intent` | `string` | No | The end user's current request in their own words, e.g. "help me with my travel plans". Pass it as-is when short; otherwise condense the goal and constraints into 1-2 sentences. Strip personal identifiers (names, emails, phone numbers, addresses, payment details), replace them with placeholders like "\[name]". Optional. Jinko uses it to understand demand, and hotel_search uses it to rank hotel results against what the user asked for (e.g. "quiet, with a gym, near Times Square"), so keep the user's stated preferences in it. | ## Examples **Guest lookup by Jinko reference + last name:** ```json theme={null} { "name": "get_booking", "arguments": { "booking_ref": "JNK-ABC123", "last_name": "Doe" } } ``` Returns the booking envelope (itineraries, travelers, status). The MCP connection still requires authentication. Guest lookup verifies the booking reference and last name, so travelers do not need a personal Jinko login. **Read a booking to display it, without the live eligibility check:** ```json theme={null} { "name": "get_booking", "arguments": { "booking_ref": "JNK-ABC123", "last_name": "Doe", "check_eligibility": false } } ``` `check_eligibility` defaults to `true`, which checks with the airline or supplier whether each item can be voided, refunded or exchanged, and for a flight can add several seconds. With `false` the booking is read without that check and `items[].servicing` keeps the cancellation and exchange progress but leaves out `can_refund`, `can_void`, `can_exchange` and the support levels. Leave it out, or send `true`, when the traveler wants to cancel or change. Either way, a flight item whose fare rules are known carries them in `confirmation.details.flight.fare_conditions`, kept with the booking. The field is absent when no rules were recorded for the fare, so read it only when it is there: ```json theme={null} { "rules": [ { "rule_type": "CHANGE", "penalty": "ALLOWED_WITH_FEE", "penalty_fee": { "value": 8900, "currency": "EUR", "decimal_places": 2 } }, { "rule_type": "CANCEL", "penalty": "NOT_ALLOWED" } ] } ``` A fee is in the currency the airline states it in, which can differ from the fare's. The conditions are an estimate: the airline can refund or void a ticket they call non-refundable, for example on the day it was issued. Whether a refund or change can be done is confirmed by `flight_refund` or `flight_exchange` when it starts. **Error handling:** MCP returns `structuredContent.status: "not_found"` for an unknown or inaccessible booking, including a last-name mismatch. It deliberately does not reveal whether the booking exists. Ask the user to check the reference and last name rather than retrying with variations. # Get Trip Source: https://docs.gojinko.com/tools/get-trip Fetch the full lifecycle state of a trip, items, travelers, quote, fulfillment, and any booking references Inspect the current state of a trip without modifying it. Reach for it when you need to confirm what items are on the trip, verify the travelers attached to a booking, or check whether a checkout has finalized after the user paid. The response covers items, traveler details, quote status, and any booking references that have been issued. > [accordion] Tool description (what the LLM sees) > > ```text theme={null} > Fetch the full lifecycle state of a trip, its items, travelers, quote status, fulfillment status, and any booking references already produced. > > USAGE: > get_trip({ trip_id }) > > This is a read-only call. Use it to inspect a trip after trip(add_item), trip(upsert_travelers), or checkout, for example to confirm what items / travelers are currently on the trip, or to check whether a booking has been finalized post-checkout. > > In structuredContent, lifecycle data is nested under trip. Until payment starts, trip.status reads "draft": checkout prices the trip but books and charges nothing, so a priced, unpaid trip reads trip.status "draft" with trip.quote.status "completed". Read progress from three fields: trip.quote.status (pricing), trip.payment_attempt.payment_status (payment), trip.booking_state (booking: awaiting_payment, processing, completed, partial, failed, cancelled or needs_review; trip.fulfillment.status has the detailed status). trip.fulfillment, trip.booking_ref and trip.booking_state appear when payment starts (the traveller presses Pay at checkout_url, or submit_agent_payment is called); trip.booking_state "awaiting_payment" means the payment is not authorized yet. The text answer's Stage line says where an unpaid trip stands. > > Read trip.booking_ref (JNK-XXXXXX) for the Jinko booking reference, which get_booking, hotel_cancel and flight_refund take as booking_ref. It can be present before payment completes, do not treat its presence as paid; check trip.booking_state. The value never changes afterwards. trip.bookings[].supplier_references are the SUPPLIER confirmations (airline record locator / hotel confirmation number, each with its issuer) and are NOT accepted by get_booking. > > trip.quote.invalid_reason = "travelers_changed" means the travelers were edited after the quote was priced: the quote can no longer be paid, so call checkout again before paying. "items_changed" means the same after an item was added, removed or replaced: call checkout again and get the user's approval of the new total. > ``` ## Parameters | Name | Type | Required | Description | | - | - | - | - | | `trip_id` | `string` | Yes | Trip ID returned by trip, get_trip, or checkout. Pass it back exactly as returned. | | `user_intent` | `string` | No | The end user's current request in their own words, e.g. "help me with my travel plans". Pass it as-is when short; otherwise condense the goal and constraints into 1-2 sentences. Strip personal identifiers (names, emails, phone numbers, addresses, payment details), replace them with placeholders like "\[name]". Optional. Jinko uses it to understand demand, and hotel_search uses it to rank hotel results against what the user asked for (e.g. "quiet, with a gym, near Times Square"), so keep the user's stated preferences in it. | ## Examples **Inspect a trip's lifecycle state:** Use the `trip_id` returned by `trip` or `checkout`; `"1128"` below is an example. ```json theme={null} { "name": "get_trip", "arguments": { "trip_id": "1128" } } ``` **Abbreviated `structuredContent` for an empty draft trip:** ```json theme={null} { "status": "success", "trip_id": "1128", "trip": { "trip_id": "1128", "status": "draft", "items": [], "travelers": [] } } ``` `structuredContent.status` reports whether the lookup succeeded. Read the trip's lifecycle state from `structuredContent.trip.status` and, once payment starts, the booking's progress from `structuredContent.trip.booking_state`, and its items and travelers from `structuredContent.trip.items` and `structuredContent.trip.travelers`. Quote, fulfillment, and booking details, when present, are also inside `structuredContent.trip`. Use `structuredContent.trip.booking_ref` (Jinko reference) for lookup and servicing. It can appear before payment completes. Within `structuredContent.trip.bookings[]`, `supplier_references` lists each item's supplier confirmations, `[]` when none is known. Failed items can also appear in that array, and an entry carries no outcome of its own: read `structuredContent.trip.booking_state` for the outcome. # Cancel Hotel Booking Source: https://docs.gojinko.com/tools/hotel-cancel Preview a hotel cancellation, then cancel it Preview and then cancel a hotel booking when the traveler can no longer make the stay or wants to drop a hotel from a multi-item trip. Preview first: it returns the penalty, the refund the customer would receive and the supplier's policy without cancelling anything, so the customer agrees to a figure before the booking is gone. Choose the booked item through get_booking and pass booking_ref + booked_item_id, with last_name for guests. > [accordion] Tool description (what the LLM sees) > > ```text theme={null} > get_booking with booking_ref (and last_name for guests) returns items[] with servicing eligibility and refusal reasons for item selection. The same booking_ref + booked_item_id identifies the selected item on every action, including commit and status. booked_item_id is the stable booked item, even after an exchange. last_name is required for guests and optional for authenticated owners. A 409 with items[] means customer selection is needed; a retry identifies that choice with booked_item_id. > > Cancel a hotel booking. CALL WITH ACTION PREVIEW FIRST, the preview costs nothing and cancels nothing. > > WORKFLOW: > 1. action="preview" with booking_ref + booked_item_id (plus last_name for guests) → penalty, customer refund, policy, and an "svq_…" quote handle. > 2. Show the customer the refund and get their agreement. > 3. action="commit" with the SAME auth you used to preview, quote_id="svq_…", and acknowledged = that quote's `refund` object copied field for field → returns an "svc_…" operation handle. > 4. action="status" with operation="svc_…" → the supplier's answer and where the refund got to. > > USAGE (guest, no login required): > hotel_cancel({ action: "preview", booking_ref: "JNK-A7B3X9", booked_item_id: "itm_aaaaaaaaaaaaafhuxsdxpbzrbfz5hm3a", last_name: "Doe" }) > > USAGE (authenticated owner): > hotel_cancel({ action: "preview", booking_ref: "JNK-A7B3X9", booked_item_id: "itm_aaaaaaaaaaaaafhuxsdxpbzrbfz5hm3a" }) > > > IMPORTANT: > - Never commit without a preview: the customer must see the penalty and the refund first. > - `acknowledged` is the preview's `refund` object copied verbatim (value, currency, decimal_places), never recomputed. If the refund has moved since, the commit is refused and a fresh quote is returned, show that one to the customer rather than committing the old figure. > - When the preview reports the penalty is not known (`fee_known: false`), tell the customer we will confirm the amount. That is NOT free cancellation. > - Quote the customer refund and penalty returned by the preview. > - action="cancel" is the legacy one-shot path: it prices and cancels in a single call, so the customer cannot agree to the refund first. Use it only for callers already written against it. > > Always start with `get_booking` and select the item before cancelling. > ``` ## Parameters | Name | Type | Required | Description | | - | - | - | - | | `action` | `enum ("preview" \| "commit" \| "status" \| "cancel")` | No | What to do. "preview" (default) prices the cancellation and returns a quote handle without cancelling anything, always start here so the customer sees the penalty and the refund before agreeing. "commit" cancels, using the quote handle and the refund the customer acknowledged. "status" reports where a committed cancellation and its refund got to. "cancel" (deprecated: use "preview" then "commit") is the legacy one-shot path that quotes and cancels in a single call, with no chance to confirm the figures first. | | `booking_ref` | `string` | Yes | Trip-level Jinko booking_ref returned by get_trip or submit_agent_payment. Use it to look up the booking with get_booking. | | `booked_item_id` | `string \| null` | No | The booked item to service: booked_item_id from get_booking.items\[] (an "itm\_…" string). Send it on every action. May be omitted only when the booking has exactly one item in this domain. | | `last_name` | `string \| null` | No | Primary traveler last name. Required for guests; optional for an authenticated owner of the booking. | | `quote_id` | `string \| null` | No | The "svq\_…" handle a prior action "preview" returned. REQUIRED for action "commit". It binds the cancellation to the figures the customer was shown. | | `acknowledged` | `object \| null` | No | The preview's `refund` object copied field for field, the refund the customer agreed to. REQUIRED for action "commit". Do not recompute or re-scale it: the platform compares it against the live figure and refuses the commit with a fresh quote when they differ, rather than settling at a number nobody was shown. | | `operation` | `string \| null` | No | The "svc\_…" operation handle a prior action "commit" returned. REQUIRED for action "status". | | `user_intent` | `string` | No | The end user's current request in their own words, e.g. "help me with my travel plans". Pass it as-is when short; otherwise condense the goal and constraints into 1-2 sentences. Strip personal identifiers (names, emails, phone numbers, addresses, payment details), replace them with placeholders like "\[name]". Optional. Jinko uses it to understand demand, and hotel_search uses it to rank hotel results against what the user asked for (e.g. "quiet, with a gym, near Times Square"), so keep the user's stated preferences in it. | # Hotel Details Source: https://docs.gojinko.com/tools/hotel-details Fetch rich metadata (gallery, facilities, policies, per-room details) for a single hotel Pull the full marketing and operational profile of a single property after a search result catches the user's attention. Useful for questions like "what amenities does this hotel have", "is there a pool on site", or "what amenities does the deluxe room have". Returns the gallery, facilities, room metadata, and property policies. For refundability and cancellation terms, read the selected rate from hotel_search. > [accordion] Tool description (what the LLM sees) > > ```text theme={null} > Fetch rich metadata (gallery, facilities, policies, per-room metadata) for a single hotel. > > Use this AFTER hotel_search returns a list of hotels and the user wants a closer look at one. > > REQUIRED: > - hotel_id: the hotel_id of a hotel from hotel_search, passed exactly as returned > > OPTIONAL: > - checkin, checkout (YYYY-MM-DD): accepted; the platform does not use them yet. > > RESPONSE: > - hotel: { id, name, star_rating, address, images[], facilities[], policies[] } > - rooms[]: per-room metadata, each with name + description, and max_adults / max_children (when available; max_children 0 means the room takes no children) > > Notes: > - Read-only. Does not affect the trip or quote. > - Property policies and room metadata are not rate cancellation terms. Read refundability and the cancellation schedule from the selected hotel_search rate. > - Independent of pricing, call hotel_search first to get live rates with offer tokens. > ``` ## Parameters | Name | Type | Required | Description | | - | - | - | - | | `hotel_id` | `string` | Yes | The hotel_id of a hotel from hotel_search, passed exactly as returned. It is an opaque string: do not parse or build it. | | `checkin` | `string` | No | Check-in date (YYYY-MM-DD). Accepted; the platform does not use it yet. | | `checkout` | `unknown` | No | Check-out date (YYYY-MM-DD). Accepted; the platform does not use it yet. | | `user_intent` | `string` | No | The end user's current request in their own words, e.g. "help me with my travel plans". Pass it as-is when short; otherwise condense the goal and constraints into 1-2 sentences. Strip personal identifiers (names, emails, phone numbers, addresses, payment details), replace them with placeholders like "\[name]". Optional. Jinko uses it to understand demand, and hotel_search uses it to rank hotel results against what the user asked for (e.g. "quiet, with a gym, near Times Square"), so keep the user's stated preferences in it. | ## Examples **Fetch full details for a single hotel returned by `hotel_search`:** ```json theme={null} { "name": "hotel_details", "arguments": { "hotel_id": "lpe2264" } } ``` **Optional dates (accepted but currently unused):** `checkin` and `checkout` do not change the returned details. Omit them when fetching the property profile. ```json theme={null} { "name": "hotel_details", "arguments": { "hotel_id": "lpe2264", "checkin": "2027-07-15", "checkout": "2027-07-18" } } ``` The response carries hotel-level metadata (images, facilities, policies) plus per-room details (room name + description). Read-only: doesn't affect a trip or quote. # Hotel Reviews Source: https://docs.gojinko.com/tools/hotel-reviews Fetch the guest review summary, per-category scores and recent reviews for a single hotel Answer what guests say about a property after a search result or a hotel_details lookup catches the user's attention. Useful for questions like "what do guests say about this hotel", "is it clean", "how is the location" or "is the staff friendly". Returns the overall guest score and review count, a pros/cons summary, per-category scores and the most recent individual reviews. > [accordion] Tool description (what the LLM sees) > > ```text theme={null} > Fetch the guest review summary and recent reviews for a single hotel. > > Use this AFTER hotel_search or hotel_details, when the user asks what guests say about a hotel, or how it scores on cleanliness, location, staff or value. > > REQUIRED: > - hotel_id: the hotel_id from hotel_search, or the id from hotel_details, passed exactly as returned > > OPTIONAL: > - limit: number of recent reviews to return (1-50, default 10) > - offset: number of recent reviews to skip, for paging (default 0) > > RESPONSE: > - hotel: { id, name, rating (overall guest score out of 10), review_count } > - summary: { pros[], cons[], categories[] ({ name, rating, description }), updated_at }, or null when the hotel has no review summary > - reviews[]: most recent first, each with headline, score (out of 10), pros, cons, date, language and reviewer_name when available > - page: { limit, offset, total_count } (total_count is null when unknown) > > Notes: > - Read-only. Does not affect the trip or quote. > - The review source is not attributed; present the scores and reviews as guest reviews. > - Never invent reviews or scores the response does not contain. When reviews[] is empty, say no recent reviews were returned. > ``` ## Parameters | Name | Type | Required | Description | | - | - | - | - | | `hotel_id` | `string` | Yes | The hotel_id of a hotel from hotel_search, or the id hotel_details returns, passed exactly as returned. It is an opaque string: do not parse or build it. | | `limit` | `integer` | No | Max recent reviews to return (1-50). Default 10. | | `offset` | `integer` | No | Number of recent reviews to skip, for pagination. Default 0. | | `user_intent` | `string` | No | The end user's current request in their own words, e.g. "help me with my travel plans". Pass it as-is when short; otherwise condense the goal and constraints into 1-2 sentences. Strip personal identifiers (names, emails, phone numbers, addresses, payment details), replace them with placeholders like "\[name]". Optional. Jinko uses it to understand demand, and hotel_search uses it to rank hotel results against what the user asked for (e.g. "quiet, with a gym, near Times Square"), so keep the user's stated preferences in it. | # Hotel Search Source: https://docs.gojinko.com/tools/hotel-search Search live hotel inventory and rates Search live hotel inventory and nightly rates for a destination and stay window. It handles requests like "three nights in Lisbon next weekend for two adults" or "family room in Rome with one child in August". Each result includes an `htl_*` offer token you can hand to the trip tool to start a booking. > [accordion] Tool description (what the LLM sees) > > ```text theme={null} > Search live hotel inventory and rates. > > CONTINUATION: > - To load more from a prior result, send { next_handle } by itself: it continues the same search. Do not repeat destination, dates, occupancy, currency, sort_by, filters, user_intent or trip_id. > > FIRST SEARCH REQUIRED: > - destination: object, two distinct modes. Mode A (rate lookup): { hotel_name (+ optional country_code, city_name) } or { hotel_ids }. Mode B (hotel search): { query }, { city_name + country_code }, or { latitude + longitude (+ radius_km) }. > - checkin, checkout: the user's stay dates in YYYY-MM-DD. Check-in must be today or later at the hotel; send timezone (the user's IANA time zone) so a stay that starts tonight is accepted. Check-out must be after check-in. > > OCCUPANCY (state it whenever the user gave a party): > - either { occupancies: [{ adults, children_ages? }, ...] } (one entry per room) OR shorthand { adults, children?, rooms? }, not both. > - When the user stated no party at all, you may search without one: the search then runs for 2 adults per room (1 room unless rooms says otherwise) and search_criteria.occupancy.source is "server_default". Tell the user the prices are for 2 adults in 1 room, and confirm the real party before trip(add_item), search again if it differs. A booking is priced for the party of the search. > > TWO MODES, pick deliberately: > > MODE A (rate lookup, the user named a specific hotel): > - { hotel_name }: free-text hotel name ("Hotel Calimala", "The St. Regis Rome", "Hôtel Costes"). The server matches the name against its hotel catalog. ALWAYS pair with country_code AND city_name when known, lookup precision drops sharply on common names without scope. Returns 422 HOTEL_NAME_LOW_CONFIDENCE if no candidate scores ≥ 0.7; see "ERROR HANDLING" below. > - { hotel_ids }: re-shop a known set (from a prior search result). > In Mode A: property filters (min_rating, min_star_rating, max_star_rating, min_reviews, hotel_type_ids, chain_ids, facility_ids) do not apply: the named hotel is priced as if they were not sent (the user named the property). The same holds when a query is read as one hotel (destination_resolution.shape hotel_name). filters.min_budget_per_night and filters.max_budget_per_night apply. filters.max_results does not limit Mode A: every named hotel that has rates is returned. The response includes nearby_alternatives, up to 40 hotels within ~3km of the matched property, in the same response shape so the user can compare. > > MODE B (hotel search, the user is exploring a destination): > - { query }: a natural-language destination (city, POI, island or region). The platform parses it once into city + country or coordinates and applies shared location normalization; raw query text is never sent to a supplier. > - { city_name + country_code }: when the user named a city, even if ambiguous. Best when the destination has a primary city ("Mahón, ES" for Menorca; "Florence, IT" for Tuscany). Spell the city as an English-language booking site would, "Munich"/"Florence"/"Rome"/"Vienna", NOT "München"/"Firenze"/"Roma"/"Wien", but keep the local form where that IS the international one ("Regensburg", "Nürnberg", "Lyon"), and never an archaic exonym ("Leghorn", "Ratisbon"). When the user wrote the city in another language, translate it for this field only; keep their spelling when you talk back to them. > - { latitude + longitude + radius_km }: when exact coordinates and the desired area are already known; radius_km is the half-side of the square searched, up to 50. > > ERROR HANDLING, 422 HOTEL_NAME_LOW_CONFIDENCE (Mode A only): > When { hotel_name } fuzzy lookup finds no candidate ≥ 0.7, the response body is: > { "error": { "code": "HOTEL_NAME_LOW_CONFIDENCE", "message": "...", "top_candidates": [{hotel_id, name, city, score}], "suggested_retry": { "destination": {...} } } } > This is ACTIONABLE, not fatal. Pick one: > 1. Top candidate matches what the user meant (typo/spelling) → confirm with the user, then retry with { hotel_ids: [""] }. > 2. None of the candidates fit → ask the user "I couldn't pin down 'X', want me to search all hotels in instead?" then retry with suggested_retry.destination. > 3. User likely meant a different city → ask to clarify, then retry hotel_name with corrected country_code/city_name. > Don't silently auto-pick a low-confidence candidate, booking the wrong hotel is worse than asking one clarifying question. > > ERROR HANDLING, 422 DESTINATION_LOW_CONFIDENCE (Mode B city_name+country_code only): > When the city has no exact catalog match but close candidates exist, top_candidates are CITIES ({city, country_code, hotel_count, score}), not hotels: confirm an obvious typo and retry with that candidate's city_name + country_code (it resolves exactly), ask the user when several fit, and never report the city has no hotels. > > destination_resolution comes back on every successful search and says HOW the destination resolved (exact / fuzzy / provider_matched / fallback_string); the text summary's opening "Searched: …" line, when present, means the match was fuzzy, fell back to a literal string, resolved to a different city than requested, or the platform located a place that is not a city (an island, region, district, landmark, station, address or airport). When destination_resolution.resolved_place is set, the platform located the place itself: tell the user that place, with its place_type when it is not a city, as where you searched. When destination_resolution.alternatives is set, the destination may name another place too (the same name in another country or state, the island rather than its town): name them, ask which one the user meant before booking, and search another by sending its latitude, longitude and radius_km. > > SANITY-CHECK THE CITY GROUP (Mode B city_name, an "exact" match can still be the wrong group): > destination_resolution.catalog_hotel_count is how many properties the matched city group holds. A count in the single or low double digits for a city you would expect to be large does NOT mean the city is small, it means you matched a near-empty duplicate group. "Roma" holds 3 properties where "Rome" holds 20,706; "Firenze" holds 1 where "Florence" holds 6,986; "Wien" holds 7 where "Vienna" holds 4,580. Treat it as a DESTINATION problem: retry with the English-booking-site spelling, or with { latitude + longitude + radius_km }. > This overrides empty_reason. "no_availability_for_dates" is computed against the matched group alone, so a wrong-spelling match reports a sold-out city that actually has thousands of rooms, never tell the user a city is full, or that only N hotels exist there, on the strength of a small group. > > FIRST SEARCH OPTIONAL: > - currency (ISO 4217), guest_nationality (ISO 3166-1 alpha-2) > - sort_by: "recommended" (default) or "lowest" (cheapest per night first). Mode B only. > - filters: { min_rating, min_star_rating, max_star_rating, min_reviews, hotel_type_ids, chain_ids, facility_ids, max_results, min_budget_per_night, max_budget_per_night } > - filters.facility_ids / filters.hotel_type_ids take NAMES ("pool", "spa", "parking"; "hostel", "ryokan", "chalet"), the accepted names are listed on each parameter. For a facility the user requires, send that one name. A name outside the list is rejected with the accepted names. Every property filter of a destination search is applied as sent. > - filters.max_budget_per_night: per-night per-room price cap (request currency) for "under $150/night" asks. Hotels whose CHEAPEST rate fits are kept with ALL their rates, on every page. Also applies in Mode A. > - filters.min_budget_per_night: per-night per-room price floor (request currency), alone or with max_budget_per_night as a band. "not under $80/night" → min 80; "around $100" → a band such as min 80 + max 120; "70 to 150 GBP" → min 70 + max 150 (min must not exceed max). A hotel is kept when at least one of its rates is inside the band, with ALL its rates, so rates outside the band can appear: label them, never say every rate fits. Also applies in Mode A. > > DESTINATION AND OCCUPANCY EXAMPLES: > Add checkin and checkout for the user's actual stay to each example below. > 1. Free-text city search: > { "destination": { "query": "Paris" }, "adults": 2 } > > 2. Two-room family with kids: > { "destination": { "city_name": "Barcelona", "country_code": "es" }, > "occupancies": [{ "adults": 2 }, { "adults": 1, "children_ages": [5, 7] }] } > > 3. Island/region with known coordinates: > { "destination": { "latitude": 39.9496, "longitude": 4.1102, "radius_km": 30 }, "adults": 1 } > > 4. Geo-radius search around a POI: > { "destination": { "latitude": 41.4036, "longitude": 2.1744, "radius_km": 3 }, "adults": 2 } > > 5. Mode A, user named a specific hotel: > { "destination": { "hotel_name": "Hotel Calimala", "country_code": "it", "city_name": "Florence" }, "adults": 2, "currency": "EUR" } > > RESPONSE: > - The text result is a summary, not JSON: hotels shown (with the total available when known), the price range and refundable split, then each hotel's stars, rating, cheapest price, rate count and hotel_id, and the rates an agent needs to choose a hotel: the cheapest rate of each board and refund-terms combination, cheapest first, one line per rate ending in trip_item_token= with that rate's price, board and refund terms on the same line. A hotel's dearer rates at the same board and refund terms are not printed; a closing line counts them. Every rate, listed or not, is in structuredContent with its token. > - structuredContent carries the full payload: each hotel with basic metadata (name, address, star_rating, rating, main_photo), a rooms[] list of room metadata (room_id, room_name, description, max_occupancy; rates[] is empty) and the hotel's bookable rates, once each, in offers[]: each offer has a trip_item_token (the htl_* token), board type, refund policy, cancellation schedule, taxes, total_amount_money and room_rates[] naming the room it prices (room_id, room_name, occupancy_number, occupancy). On a search of 2 or more rooms each offer's room_rates[] names the room slot it prices, one token per room, the same token repeated for identical rooms, or, when one offer covers every room, every room it books with its one token. > - Order: hotels come in the order sort_by names, by default the hotel source's recommended order, or cheapest per night first with sort_by "lowest". Each hotel carries distance_km, its straight-line distance from the search center. When user_intent is given, hotels are re-ranked by how well each hotel matches the stated intent and carry recommendation_score (0 to 1; not a guest rating); the summary prints it on the hotel's "AI ranking" line. structuredContent also carries search metadata. > - structuredContent.search_criteria states what the prices were produced under, on every response (success, empty, error): destination (as sent, and resolved as the platform reported it), stay (checkin, checkout, nights), occupancy (rooms, adults, children_ages, source: request | server_default | session), currency (and whether it was defaulted), filters (requested, and as sent to the platform search, ids where the platform takes ids; every property filter of a destination search is applied as sent, and a named hotel's applied filters leave the property filters out), and on an empty page relax_first (what to change first, in order). The summary's "Priced for:" line repeats the party, currency and filters: read them back to the user with the prices. > - Empty page with a next_handle (empty_reason "search_in_progress"): the search has not finished. Call hotel_search with that next_handle and change nothing; there is no relax_first. Any other empty page ends the search: do not repeat the same call. Change one thing per call in the order relax_first gives (the "Relax first:" line) before telling the user there is nothing. > - Short page: a "Coverage:" line says how many hotels have rates for the area and dates, e.g. 1 hotel. A short list is not a paging gap: widen the radius, shift the dates or try a nearby city. filters.offset is rejected once a search returned search_handle; page with next_handle instead. > - Error: the text names the retry policy, whether the SAME request is worth retrying once and after how many seconds (also structuredContent.retry_after_seconds when known), or whether the request has to change. One retry at most, never a loop; if it fails again, tell the user. > > NEXT STEP: Use the trip tool with add_item and the trip_item_token (htl_* token) of the rate the user picks. Hotel items work alongside flight items in the same trip. > > Flow: hotel_search → trip(add_item) → trip(upsert_travelers) → checkout > > PRICES: rate prices, in the summary and in structuredContent, are totals for the stay. > ``` ## Parameters | Name | Type | Required | Description | | - | - | - | - | | `next_handle` | `string \| null` | No | Opaque continuation handle returned by a prior hotel_search. Send this field by itself, or with every other field null. A first request needs destination, checkin and checkout. | | `destination` | `object \| null` | No | Destination, provide exactly one shape; unused fields may be null or left out. Two distinct modes: MODE A (rate lookup, you know which hotel): • \{ hotel_ids } to re-shop a known set. • \{ hotel_name, country_code?, city_name? } when the user named a specific property. Server resolves via fuzzy lookup; returns 422 HOTEL_NAME_LOW_CONFIDENCE if no candidate scores ≥ 0.7. MODE B (hotel search, you're exploring): • \{ query } for a natural-language destination. The platform parses it once into city + country or coordinates and never forwards the raw query to a supplier. • \{ city_name + country_code } for ambiguous city names or when the user named a primary city ("Mahón, ES" for Menorca). • \{ latitude + longitude + radius_km } when exact coordinates and the half-side of the square area are already known. In Mode A, property filters (min_rating / star / min_reviews / facility / chain / hotel_type) do not apply, the user already named the property, which is priced as if they were not sent; the same holds when a query is read as one hotel. filters.min_budget_per_night and filters.max_budget_per_night apply with hotel_ids or hotel_name. | | `checkin` | `string \| null` | No | Check-in date (YYYY-MM-DD). | | `checkout` | `unknown \| null` | No | Check-out date (YYYY-MM-DD). | | `timezone` | `string \| null` | No | The user's IANA time zone (e.g. "America/New_York"), when known. Check-in may be today there, so a stay that starts tonight is accepted. | | `occupancies` | `array \| null` | No | One entry per room (structured). PREFERRED whenever the party is larger than 2 adults or has children, it removes ambiguity about how guests are split across rooms. Example: \[\{ "adults": 2 }, \{ "adults": 1, "children_ages": \[5] }]. Do NOT combine with the shorthand fields (adults/children/rooms), use one or the other. | | `adults` | `integer \| null` | No | Shorthand: total adults across all rooms. Use ONLY when there is no ambiguity (1 or 2 adults = single room). For 3+ adults, or odd splits, ask the user how they want to split rooms and pass occupancies\[] instead, e.g. 4 adults → \[\{adults:2},\{adults:2}] (double + double) vs a single 4-sleeper is a meaningfully different search. Without rooms or occupancies\[], the server prices ONE room for all the adults (adults 4 alone is a single 4-sleeper, never two doubles) and search_criteria in the result says so; with rooms, it spreads the adults evenly across that many rooms. Do NOT combine with occupancies\[], use one or the other. | | `children` | `array \| null` | No | Shorthand: ages of all children across all rooms. If children are present, prefer occupancies\[] so the caller controls which room each child goes in (ages affect pricing and some providers reject invalid age/room combinations). | | `rooms` | `integer \| null` | No | Shorthand: number of rooms (the platform auto-distributes adults + children). Use when the user named a room count but not the per-room split. | | `currency` | `string \| null` | No | ISO 4217 currency code (e.g. "EUR", "USD", "GBP", "JPY"). ALWAYS set this, omitting it falls back to USD which is rarely what users actually want. Infer from the strongest signal available: (1) the user's explicit ask ("show me prices in pounds"), (2) the conversation language/locale (French → EUR, Japanese → JPY, German → EUR, Spanish/Catalan/Italian/Portuguese → EUR, English UK → GBP, English US → USD), (3) the destination country (Italy/France/Germany → EUR, UK → GBP, Japan → JPY, US → USD). When in doubt between two plausible currencies, prefer the one matching the user's likely home country. | | `guest_nationality` | `string \| null` | No | Guest nationality (ISO 3166-1 alpha-2, uppercase, e.g. "FR"). Affects rate availability + tax handling at search time. Separate from traveler nationality used for booking documents. | | `filters` | `object \| null` | No | Optional filter overrides applied on top of the tenant default filter set. Every property filter of a destination search is applied as sent; they do not apply to a search that names a hotel. | | `trip_id` | `string \| null` | No | Existing trip_id. Accepted on every surface for schema consistency; this surface does not use it. | | `sort_by` | `enum ("recommended" \| "lowest") \| null` | No | Order of the hotels of a destination search (Mode B). "recommended", the default, is the hotel source's own recommended order (popularity, review quality, content completeness). "lowest" is cheapest per night first: send it when the user asks for the cheapest hotels or to sort by price. Mode A ignores it. | | `user_intent` | `string` | No | The end user's current request in their own words, e.g. "help me with my travel plans". Pass it as-is when short; otherwise condense the goal and constraints into 1-2 sentences. Strip personal identifiers (names, emails, phone numbers, addresses, payment details), replace them with placeholders like "\[name]". Optional. Jinko uses it to understand demand, and hotel_search uses it to rank hotel results against what the user asked for (e.g. "quiet, with a gym, near Times Square"), so keep the user's stated preferences in it. | ## Examples **Simple city search, 2 adults, 3 nights in Paris:** ```json theme={null} { "name": "hotel_search", "arguments": { "destination": { "query": "Paris" }, "checkin": "2027-07-15", "checkout": "2027-07-18", "adults": 2 } } ``` **Two rooms, kids in one:** ```json theme={null} { "name": "hotel_search", "arguments": { "destination": { "city_name": "Barcelona", "country_code": "es" }, "checkin": "2027-08-01", "checkout": "2027-08-05", "occupancies": [ { "adults": 2 }, { "adults": 1, "children_ages": [5, 7] } ] } } ``` **Near a coordinate with filters:** ```json theme={null} { "name": "hotel_search", "arguments": { "destination": { "latitude": 48.8566, "longitude": 2.3522, "radius_km": 3 }, "checkin": "2027-07-15", "checkout": "2027-07-18", "adults": 2, "filters": { "min_rating": 8, "min_star_rating": 4, "facility_ids": ["pool", "wifi"], "max_results": 20 } } } ``` Choose a bookable offer from `structuredContent.data.hotels[].offers[]` and pass its `trip_item_token` unchanged to `trip(add_item)`. The `rooms[].rates[]` lists can be empty even when bookable offers are available. Hotels can coexist with flight items in the same trip. **What a hotel result actually carries.** Use these names, not the ones a generic hotel API would suggest: ```json theme={null} { "hotel_id": "lp1897c", "name": "Hôtel Le Marais", "address": "12 Rue de Rivoli", "city": "Paris", "country": "fr", "star_rating": 4, "rating": 8.6, "review_count": 1243, "main_photo": "https://…/large.jpg", "thumbnail": "https://…/thumb.jpg", "latitude": 48.8566, "longitude": 2.3522, "rooms": [] } ``` | Field | Note | | - | - | | `main_photo` | The single hero image. There is **no `images[]` array** on a search result; use `hotel_details` for the full gallery. | | `thumbnail` | Small image. **Not** `thumbnail_url`. | | `country` | Lowercase ISO 3166-1 alpha-2, e.g. `"fr"`. **Not** `country_code`, which is a *request* field on `destination`. | Country codes are matched case-insensitively on the request, but lowercase is what comes back, so prefer lowercase everywhere for round-trip consistency. # Overview Source: https://docs.gojinko.com/tools/overview What you can do with the Jinko MCP server and how to connect your AI agent to it: search flights, hotels, and rental cars, build a trip, pay, and manage bookings from inside a conversation. The Jinko MCP server plugs travel straight into your AI agent. Connect a client like Claude or Cursor over OAuth (or a bearer API key), and it can search flights, hotels, and rental cars, build a trip, pay, and manage bookings right inside a conversation, with no custom integration to write. New to this? Start with [Connect over MCP](/connect/mcp) to set up your client. The tools are grouped by what they do (below), and each page lists its input schema, parameters, and examples. ## Endpoint | Environment | Endpoint | | - | - | | Production | `https://mcp.builders.gojinko.com/mcp` | | Sandbox | `https://mcp.builders.sandbox.gojinko.com/mcp` | Production is the default. Use **sandbox** to run the full flow against isolated data. Sandbox MCP authenticates with a sandbox **API key** (`jnk_sandbox_t_…`, see [Sandbox keys](/authentication/api-keys#sandbox-keys)); it has no OAuth sign-in. A production key will not authenticate against sandbox, and vice-versa. **Sandbox flight tests: use Jinko Airline (`ZZ`).** It is a fake airline that exists only in sandbox: search with `include_carriers: ["ZZ"]` on a route such as JFK–LHR from tomorrow onwards, and book flight ZZ101 for the normal flow. Every other flight number triggers one documented behaviour, such as a price change, a sold-out booking or a failed ticket, so you can test failure paths on demand. See [Testing in sandbox](/guides/testing-in-sandbox). ## Authentication Most modern MCP clients connect over **OAuth**: give them the endpoint URL and approve the flow. When a client doesn't support OAuth, attach your API key as a bearer token instead: ```http theme={null} Authorization: Bearer jnk_t_your_key ``` See [Connect over MCP](/connect/mcp) for client-specific setup (Claude Code, Cursor, and more). ## Tool groups > [card] [Flights](/tools/flight-search) > > Discover routes and dates, run a live search, then handle refunds and exchanges: `find_destination`, `flight_calendar`, `price_monitoring`, `flight_search`, `flight_refund`, `flight_exchange`. > [card] [Hotels](/tools/hotel-search) > > Search hotels and pull details; results drop into the same trip as flights: `hotel_search`, `hotel_details`, `hotel_reviews`, `hotel_cancel`, `claim_best_price_guarantee`, `get_best_price_guarantee`. > [card] [Cars](/tools/car-search) > > Search live rental offers and cancel a rental with the fee shown first; a `car_*` offer books through the same trip: `car_search`, `car_cancel`. > [card] [Trip & Payment](/tools/trip) > > Build a trip, check out, pay via a browser link or a Shared Payment Token, and look up the booking: `trip`, `checkout`, `submit_agent_payment`, `get_trip`, `get_booking`. # Price Monitoring Source: https://docs.gojinko.com/tools/price-monitoring Get one cached price snapshot for a specific route and date pair Get one cached price snapshot for a specific route and date pair. To track fares over time, the calling agent or application must schedule repeated calls and send notifications. This tool creates no persistent monitor or alert subscription. When status is "ok", the response includes the cheapest matching cached fare and an offer token for flight_search price_check; "stale" means no matching cached itinerary. Cache-only; never triggers a live call. > [accordion] Tool description (what the LLM sees) > > ```text theme={null} > Cache-only flight price snapshot for a fixed origin/destination + dates pair. Returns one snapshot per call. The calling agent or application must schedule repeated calls and send notifications; this tool creates no persistent monitor or alert subscription. Intended for scheduled polling, NOT for one-shot shopping or booking. > > WHEN TO USE: > - Track the price of a specific route + dates over time and react when it drops (cron / scheduled job). > - Recommended cadence: poll no faster than the cache refresh interval. Polling faster is wasted work. > > WHAT IT RETURNS: > - The single cheapest cached itinerary matching the request filters (lowest WITHIN the filter constraints, filters constrain the candidate set, not the win condition). > - Its price is a ONE-ADULT fare. traveler_counts has no effect on the fare, max_total cap, or returned flight (the price and cap are for one adult; the counts are only echoed back in request_echo); the response contains no booking link. Use flight_search with max_total for the exact whole-trip budget check for all travelers. > - An offer_token that remains re-shoppable via flight_search (price_check mode) when the user decides to book. > - status: "ok" (offer present) or "stale" (cache had no matching itinerary, retry later, or call flight_search for a live quote). > > WHEN TO USE flight_search INSTEAD: > - The user is ready to book NOW and needs a live quote. > - One-shot exploration where you don't intend to come back. > > WHEN TO USE flight_calendar / find_destination INSTEAD: > - Flexible dates or ranges, price_monitoring requires exact departure_date (+ optional exact return_date). > - The user is still exploring and hasn't committed to a specific route to monitor. > > CACHE-ONLY CONTRACT: > - This tool NEVER triggers a live connector call. status:"stale" is the correct response when the cache is cold, do not retry in a tight loop and do not silently fall back to flight_search. > > INPUT NOTES: > - Origin / destination: the city code when the user named a city (PAR, NYC, LON); origin_type / destination_type "airport" when they named an airport. Untyped, a code that names a multi-airport city is the city and any other code is the airport, LAX, MIA and LAS are read as the city. > - Use the SAME filter set the user has been monitoring against between polls. > > The result carries `search_criteria` (what was actually monitored). On `status: "stale"` it also carries `next`: the live `flight_search` for the same dates, to offer when the user needs a price now, monitoring itself stays cache-only. > ``` ## Parameters | Name | Type | Required | Description | | - | - | - | - | | `origin` | `string` | Yes | Origin IATA city code (e.g. PAR, NYC, LON) or airport code (CDG, JFK, LHR). City codes preferred, they cover every airport in the city. | | `origin_type` | `enum ("city" \| "airport") \| null` | No | How to read origin: "city" searches every airport of the city; "airport" only that one airport. With no type sent, the platform applies one rule: a code that names a multi-airport city is searched as the city; every other code is searched as the airport. NYC, LON, PAR → the city. JFK, LHR, CDG → the airport. LAX, MIA, LAS, codes a city shares with its main airport, → the CITY, every airport of it. If the user named the airport ("LAX", "JFK", "Heathrow"), send "airport"; if they named the city ("Los Angeles", "New York"), send the city code and omit the type. | | `destination` | `string` | Yes | Destination IATA city code (e.g. MIL, BCN, TYO) or airport code (MXP, BCN, NRT). City codes preferred. | | `destination_type` | `enum ("city" \| "airport") \| null` | No | How to read destination: "city" searches every airport of the city; "airport" only that one airport. With no type sent, the platform applies one rule: a code that names a multi-airport city is searched as the city; every other code is searched as the airport. NYC, LON, PAR → the city. JFK, LHR, CDG → the airport. LAX, MIA, LAS, codes a city shares with its main airport, → the CITY, every airport of it. If the user named the airport ("LAX", "JFK", "Heathrow"), send "airport"; if they named the city ("Los Angeles", "New York"), send the city code and omit the type. | | `departure_date` | `string` | Yes | Single departure date (YYYY-MM-DD). Exactly one date, no arrays or ranges. | | `return_date` | `string \| null` | No | Single return date (YYYY-MM-DD). Omit for one-way. Must be on or after departure_date. | | `direct_only` | `boolean` | No | If true, only return non-stop flights. Mirror the upstream filter the user committed to when they started monitoring. | | `cabin_class` | `enum ("economy" \| "premium_economy" \| "business" \| "first")` | No | Cabin class filter. Omit for economy. | | `max_total` | `number \| null` | No | Maximum total of the cached fare, in the requested currency. Cached fares are priced for one adult, so the cap applies to a one-adult fare. For a whole-party budget, divide it by the number of ADULTS only and treat the result as a loose pre-filter: children and lap infants usually cost less than an adult, so dividing by every traveller would exclude affordable trips. Send a per-person budget as-is. The exact whole-trip budget check is flight_search with max_total. traveler_counts has no effect on the fare, the max_total cap, or the returned flight (the counts are only echoed back in request_echo). Lowest-fare semantics are "lowest within the filter constraints", max_total tightens the candidate set, not the win condition. | | `include_carriers` | `array` | No | IATA 2-letter marketing carrier codes to include (whitelist). Example: \["AF","KL"]. Use to lock monitoring to specific airlines the user actually flies. | | `exclude_carriers` | `array` | No | IATA 2-letter marketing carrier codes to exclude (blacklist). Example: \["FR","U2"]. Use to keep airlines the user refuses out of the picture. | | `traveler_counts` | `object` | No | Traveler counts. Defaults to 1 adult. They do not affect the fare, the max_total cap, or the returned flight (the counts are only echoed back in request_echo). The price and cap are for one adult, and the response contains no booking link. | | `traveler_counts.adults` | `integer` | No | Number of adult travelers (12+). | | `traveler_counts.children` | `integer` | No | Number of child travelers (2-11). | | `traveler_counts.infants` | `integer` | No | Infant travelers (under 2), traveling on an adult's lap. Seated infants (own seat) are not supported. | | `locale` | `string` | No | User's BCP 47 locale (e.g. "fr-FR", "en-US"). Inherits from the conversation locale if omitted. | | `currency` | `string` | No | ISO 4217 currency code (e.g. "EUR", "USD"). Inherits from the conversation if omitted. Must match the currency the user is monitoring against, switching currencies mid-poll is not what they want. | | `user_intent` | `string` | No | The end user's current request in their own words, e.g. "help me with my travel plans". Pass it as-is when short; otherwise condense the goal and constraints into 1-2 sentences. Strip personal identifiers (names, emails, phone numbers, addresses, payment details), replace them with placeholders like "\[name]". Optional. Jinko uses it to understand demand, and hotel_search uses it to rank hotel results against what the user asked for (e.g. "quiet, with a gym, near Times Square"), so keep the user's stated preferences in it. | ## Examples **Daily poll of PAR → NYC for a date pair:** ```json theme={null} { "name": "price_monitoring", "arguments": { "origin": "PAR", "destination": "NYC", "departure_date": "2027-06-17", "return_date": "2027-06-26", "currency": "EUR" } } ``` **Constrained poll (direct-only, economy, under €800, Air France or KLM only):** ```json theme={null} { "name": "price_monitoring", "arguments": { "origin": "PAR", "destination": "NYC", "departure_date": "2027-06-17", "return_date": "2027-06-26", "direct_only": true, "cabin_class": "economy", "max_total": 800, "include_carriers": ["AF", "KL"], "currency": "EUR" } } ``` The returned `offer_token` is directly re-shoppable via `flight_search` (price_check mode) when the user is ready to book. # Submit Agent Payment Source: https://docs.gojinko.com/tools/submit-agent-payment Redeem a Shared Payment Token to authorize the booking server-side Pay for a trip programmatically with a Shared Payment Token, no checkout page. After checkout returns the trip's agent_spt_params and the agent has minted a token scoped to them, call this to schedule the agent fulfillment and authorize the charge server-side in one step. > [accordion] Tool description (what the LLM sees) > > ```text theme={null} > Submit a Shared Payment Token (SPT) to schedule the agent fulfillment and authorize the booking server-side in one call. This is the agent-pay alternative to sending the user to a checkout page. > > PREREQUISITE: call checkout first (and again if travelers were edited since, or the quote expired and checkout did not say payment stays open, such a quote is refused with 410 QUOTE_EXPIRED and nothing is charged) to get agent_spt_params, then mint an SPT scoped to those params. > > USAGE: > submit_agent_payment({ trip_id, shared_payment_token }) > submit_agent_payment({ trip_id, shared_payment_token, quote_id }) > > To bind the payment to the quote the customer approved, pass the quote_id checkout returned. A quote_id that is not one of the trip's quotes is refused and nothing is charged; calling again with the same trip_id, quote_id and token returns the first attempt's outcome instead of charging again. Without quote_id, the trip's latest valid quote is charged and the answer names it as quote_id: if checkout ran again after the customer saw the price, that is the newer quote. > > On success the booking proceeds to fulfillment ({ status, payment_verified: true, booking_ref }). booking_ref (JNK-XXXXXX) is the Jinko booking reference, keep it: get_booking, hotel_cancel and flight_refund take it as booking_ref. It is the direct way an agent paying by SPT obtains that reference (no confirmation email); get_trip(trip_id) returns the same booking_ref if this reply is lost. If the issuer requires customer authentication (3DS), the response carries payment_status: requires_authentication, an authentication object ({ url, expires_at }) and no checkout_url, read your issued token's next_action.use_stripe_sdk.value with your Stripe secret key and give the traveler authentication.url + "#hv=" + that value (unchanged) to complete the bank challenge before quote_expires_at, or run stripe.handleNextAction({ hashedValue }) on your own page, then poll get_trip until payment_attempt.payment_status is none of requires_authentication, cancelling or pending (cancelling is a transient cleanup state and pending is still in progress, keep polling): authorized or captured means the payment went through and fulfillment proceeds (watch booking_state); failed, declined or cancelled means it did not, submit again with a new token before the deadline; expired means the quote expired with it, call checkout again to price a new quote, then mint and submit a new token. If the card is declined, the response carries a checkout_url instead of booking_ref, open it in a browser to pay with another method. > ``` ## Parameters | Name | Type | Required | Description | | - | - | - | - | | `trip_id` | `string` | Yes | Trip ID returned by trip, get_trip, or checkout. Pass it back exactly as returned. | | `shared_payment_token` | `string` | Yes | The Shared Payment Token (spt\_...) minted by the agent platform, scoped to the agent_spt_params returned by checkout. | | `quote_id` | `string \| null` | No | Optional. The quote_id checkout returned. With it, the payment is bound to that quote: a quote_id that is not one of this trip's quotes is refused and nothing is charged, an expired one is refused with QUOTE_EXPIRED, and calling again with the same trip_id, quote_id and token returns the first attempt's outcome instead of charging again. Without it, the trip's latest valid quote is charged and the answer names it as quote_id. | # Trip Source: https://docs.gojinko.com/tools/trip Create and manage a trip, add or remove items, set travelers, select ancillaries Assemble and edit a trip before sending it to checkout. Use it to add a flight, hotel, or car offer, set traveler details, swap one item for another, or attach ancillaries like bags and seats. Flights, hotels, and cars can sit side by side in the same trip and settle through a single checkout. > [accordion] Tool description (what the LLM sees) > > ```text theme={null} > Create and manage a trip: add flight, hotel, or car items, remove items, set traveler details, and select ancillaries. > > Operations: > - add_item: Add a flight, hotel, or car item to the trip. Pass trip_item_token from flight_search (one per fare), hotel_search (htl_* tokens) or car_search. Omit trip_id to create a new trip. MULTI-ROOM HOTEL: to book several rooms of the SAME hotel and stay as ONE booking with ONE reference, make ONE add_item call with rooms: [{trip_item_token: "htl_..."}, ...] (2-8 entries, one htl_* rate token per room, mutually exclusive with trip_item_token; not every hotel rate can be booked this way), do NOT add the same hotel twice as separate items. > - remove_item: Remove an existing item from the trip by item_id (from trip response items[].item_id). Requires an existing trip_id. Can be combined with add_item in a single call to swap an item, remove runs first, then add. > - upsert_travelers: Set traveler details and contact info on an existing trip_id. > - select_ancillaries: Select bags, seats, meals for a quoted trip item. Requires trip_id and item_id. > > Returns trip_id for use with the checkout tool. Flights, hotels, and cars can coexist in the same trip (single checkout). > > IMPORTANT, TRAVELER DATA: > NEVER invent or fabricate traveler data. Before calling upsert_travelers, you MUST ask the user for the required fields: > - Always: first_name, last_name, traveler_type > - date_of_birth (YYYY-MM-DD), required when the trip contains a flight, and for a child or infant staying at a hotel (the room is priced by the children's ages); optional for an adult on a hotel-only trip > - Flights only: gender (MALE/FEMALE), required when the trip contains a flight, optional for hotel-only trips > - Contact: email, phone in international format with a leading + and the country code (e.g. +12025550147); a number without the + is rejected with INVALID_PHONE_NUMBER > If a required field is missing, ASK the user. Do not use placeholder or default values. > > ANCILLARY FLOW: > Ancillaries (bags, seats) appear as available_ancillaries on trip items once checkout has quoted the trip; offer them to the user before they pay. > Use select_ancillaries with offer_ids from available_ancillaries. Full replacement, send every desired selection (bags and seats) in each call. > > SEATS (flights): > 1. get_trip after checkout: each available_ancillaries entry with type "seat" covers one segment (segment_ref_ids) and lists seat_map.seats[] {seat_number, available, chargeable, price_money}. > 2. Take each traveler's traveler_ref from the trip's travelers[].traveler_ref. > 3. Send one selection per traveler per segment: {offer_id, traveler_ref, segment_ref_ids: [that offer's segment], seat_number}. Pick only available seats; no two travelers share a seat. > Read price_money for the exact seat price. Chargeable seats add their price to the trip total (the server sets the price); call checkout again to pay it. Ask before choosing a paid seat. > > Flows: > - Flights: flight_calendar → flight_search → trip(add_item) → trip(upsert_travelers) → [checkout → trip(select_ancillaries)] → checkout > - Hotels: hotel_search → trip(add_item) → trip(upsert_travelers) → checkout > - Cars: car_search → trip(add_item) → trip(upsert_travelers) → checkout > - Mixed: supported item kinds in the same trip, one checkout > ``` ## Parameters | Name | Type | Required | Description | | - | - | - | - | | `trip_id` | `string \| null` | No | Existing trip ID returned by trip or get_trip. Pass it back exactly as returned; omit it to create a new trip. | | `add_item` | `object \| null` | No | Add a flight, hotel, or car item to the trip. For MULTIPLE ROOMS of the same hotel stay, make ONE add_item call with the rooms array (2-8 htl\_\* tokens), do NOT add the same hotel twice as separate items. | | `remove_item` | `object \| null` | No | Remove an existing item from the trip. Requires an existing trip_id, you cannot remove from a trip that has not been created yet. Can be combined with add_item in a single call to swap an item (remove runs first, then add). | | `upsert_travelers` | `object \| null` | No | Set or update travelers and contact info on the trip. Optional per call (you can add_item while building the trip), but travelers and a contact must be present before booking. | | `select_ancillaries` | `object \| null` | No | Select ancillaries (bags, seats, meals) for a quoted trip item. Uses full-replacement semantics, send all desired selections. | | `user_intent` | `string` | No | The end user's current request in their own words, e.g. "help me with my travel plans". Pass it as-is when short; otherwise condense the goal and constraints into 1-2 sentences. Strip personal identifiers (names, emails, phone numbers, addresses, payment details), replace them with placeholders like "\[name]". Optional. Jinko uses it to understand demand, and hotel_search uses it to rank hotel results against what the user asked for (e.g. "quiet, with a gym, near Times Square"), so keep the user's stated preferences in it. | ## Examples **Create a new trip (add flight + set travelers in one call):** ```json theme={null} { "name": "trip", "arguments": { "add_item": { "trip_item_token": "offer_abc123:fare_xyz" }, "upsert_travelers": { "travelers": [ { "first_name": "Jane", "last_name": "Doe", "date_of_birth": "1990-01-15", "gender": "FEMALE", "traveler_type": "adult", "frequent_flyer": { "airline": "LH", "number": "992100100" } } ], "contact": { "email": "jane@example.com", "phone": "+33612345678" } } } } ``` **Add a hotel to an existing trip:** ```json theme={null} { "name": "trip", "arguments": { "trip_id": "42", "add_item": { "trip_item_token": "htl_abc..." } } } ``` **Update travelers only (no new items):** ```json theme={null} { "name": "trip", "arguments": { "trip_id": "42", "upsert_travelers": { "travelers": [ { "first_name": "Jane", "last_name": "Doe", "date_of_birth": "1990-01-15", "gender": "FEMALE", "traveler_type": "adult", "frequent_flyer": { "airline": "LH", "number": "992100100" } }, { "first_name": "John", "last_name": "Doe", "date_of_birth": "2015-05-20", "gender": "MALE", "traveler_type": "child" } ], "contact": { "email": "jane@example.com", "phone": "+33612345678" } } } } ``` **Add a frequent-flyer number:** Each traveler can carry an optional `frequent_flyer` object so miles are credited on the booking. `airline` is the IATA code of the **program issuer** (e.g. `LH` for Lufthansa Miles & More), not necessarily the operating carrier, since alliances credit miles on partner flights. Both `airline` and `number` are required when the object is present. Include `upsert_travelers.contact` with every MCP traveler update, even when only adding a frequent-flyer number. Use the booking contact's email and phone; the phone must be in international format with a leading `+` and country code, e.g. `+12025550147`. ```json theme={null} { "name": "trip", "arguments": { "trip_id": "42", "upsert_travelers": { "travelers": [ { "first_name": "Jane", "last_name": "Doe", "date_of_birth": "1990-01-15", "gender": "FEMALE", "traveler_type": "adult", "frequent_flyer": { "airline": "LH", "number": "992100100" } } ], "contact": { "email": "jane@example.com", "phone": "+33612345678" } } } } ``` > [!WARNING] > > Traveler details must match real travel documents, airlines enforce name / DOB matching and reject bookings where they don't. Never let an agent fabricate these. The response includes `trip_id`, the current item list, and totals. Use `trip_id` with `checkout` when you're ready to check out.