> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gojinko.com/llms.txt
> Use this file to discover all available pages before exploring further.

# API reference

> 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](https://docs.gojinko.com/connect/sdk.md) 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](https://docs.gojinko.com/authentication/api-keys.md#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](https://docs.gojinko.com/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](https://docs.gojinko.com/authentication/api-keys.md) 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](https://docs.gojinko.com/authentication/api-keys.md#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: <stable per session, any UUID or opaque string>
X-Request-ID: <fresh per request, any UUID>
```

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](https://docs.gojinko.com/concepts/errors.md) 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](https://docs.gojinko.com/api/destination.md)
>
> See where people are searching to fly and how it trends over time: `destination`, `market`, `audience`, their `/trend` series, and `trend`.

> [card] [Flights](https://docs.gojinko.com/api/flight-search.md)
>
> 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](https://docs.gojinko.com/api/hotel-search.md)
>
> 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](https://docs.gojinko.com/api/car-search.md)
>
> 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](https://docs.gojinko.com/api/trip.md)
>
> 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](https://docs.gojinko.com/guides/webhooks.md)
>
> Register endpoints and get notified on booking events: `register`, `list`, `get`, `delete`, `test`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.