> Full index: https://docs.buchungapp.com/llms.txt
> Early access. Use the API base, channel key and allowed origins supplied by Buchung before running examples.

# Quickstart for humans

These steps take you from your supplied API base and channel key to a first activity list and a hosted checkout handoff. Browse the [API reference](/docs/developers/reference), [download OpenAPI](/openapi.json), or [generate a client](/docs/developers/build-storefront).

> **Need credentials?**
>
> Request early access through your Buchung contact to receive your API base, channel key and allowed origins. See [Before you start](/docs/developers#before-you-start).

## 1. Use the supplied base URL [#1-use-the-supplied-base-url]

The API base is `https://api.buchungapp.com/v1`. Paths in these guides are relative to that base.

> [!WARNING]
> **Keep the base path**
>
> Never prepend `/v1` again. Keep the base path when joining URLs.

## 2. Discover locales and list activities [#2-discover-locales-and-list-activities]

Call `site.get` (`GET /site`) to discover the operator's `locale`, `locales` (`code`, `isDefault`) and `defaultLocale`. `Buchung-Locale` is optional on reads and falls back to the operator's default; see [locale selection](/docs/developers/pagination#how-do-i-select-a-locale).

```sh
# Set these from the values Buchung gave you.
: "${BUCHUNG_API_BASE:?Missing supplied API base}"
: "${BUCHUNG_CHANNEL_KEY:?Missing channel key}"
curl --fail-with-body \
  -H "X-Buchung-Channel-Key: $BUCHUNG_CHANNEL_KEY" \
  "${BUCHUNG_API_BASE%/}/site"
# Read locale/locales above, then set BUCHUNG_LOCALE to a supported code.
: "${BUCHUNG_LOCALE:?Missing supported operator locale}"
curl --fail-with-body \
  -H "X-Buchung-Channel-Key: $BUCHUNG_CHANNEL_KEY" \
  -H "Buchung-Locale: $BUCHUNG_LOCALE" \
  "${BUCHUNG_API_BASE%/}/activities?limit=10"
```

This JavaScript runs directly in the visitor's browser on an allowed origin. The channel key is publishable, so a server proxy is optional; see [authentication](/docs/developers/authentication#can-a-browser-use-a-channel-key).

```js
// suppliedApiBase and channelKey come from Buchung; both may live in browser code.
// Normalize once; relative paths preserve /v1 in the base.
const apiBase = suppliedApiBase.replace(/\/+$/, '') + '/';
const siteResponse = await fetch(new URL('site', apiBase), {
  headers: { 'X-Buchung-Channel-Key': channelKey },
});
const site = await siteResponse.json();
if (!siteResponse.ok) throw new Error(site.error.message);
const supportedLocales = site.locales.map(({ code }) => code);
const supportedLocale = site.locale;
const response = await fetch(new URL('activities?limit=10', apiBase), {
  headers: {
    'X-Buchung-Channel-Key': channelKey,
    'Buchung-Locale': supportedLocale,
  },
});
const payload = await response.json();
if (!response.ok) throw new Error(payload.error.message);
for (const activity of payload.items) console.log(activity.id, activity.handle, activity.title);
```

## 3. Check the response [#3-check-the-response]

List pages return `items`, applied `locale`, `nextCursor`, exact `totalCount`, `evaluatedAt`, nullable `collection` and `facets`:

```json
{
  "items": [],
  "locale": "en",
  "nextCursor": null,
  "totalCount": 0,
  "evaluatedAt": "2026-10-18T12:00:00Z",
  "collection": null,
  "facets": []
}
```

## 4. Filter or send a larger query [#4-filter-or-send-a-larger-query]

Filter with typed leaves such as `availability: { startDate: { from, to } }` and compose them with `all`, `any` or `not`. GET encodes `where` and `facets` as JSON query parameters (full URL strictly below 8 KiB). When a query outgrows a URL, POST the same decoded fields as JSON:

```js
const response = await fetch(new URL('availabilities/query', apiBase), {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-Buchung-Channel-Key': channelKey,
    'Buchung-Locale': supportedLocale,
  },
  body: JSON.stringify({
    where: { availability: { startDate: { from: '2027-01-01', to: '2027-12-31' } } },
    limit: 20,
  }),
});
const payload = await response.json();
if (!response.ok) throw new Error(payload.error.message);
```

The other POST forms are `POST /activities/query` and `POST /activities/{id}/availabilities/query`. They share the GET read rate limit and enforce a 16 KiB body cap. See [data model and filtering](/docs/developers/data-model).

For a configured collection, send its UUID as `collectionId` in either request form. A collection returns the activities it selects without exposing its selection criteria. Read `facets` from the response before offering filters. If the API returns `404 not_found`, check the collection and booking channel. For `400 validation_failed`, use the [validation details](/docs/developers/errors#catalogue-query-errors) to correct the query.

## 5. Choose a booking option [#5-choose-a-booking-option]

Retain the returned activity UUID. For a link containing a handle, resolve `/activities/by-handle/{handle}` first and keep its `id` (handles can change). Use `/activities/{id}/availabilities` to browse matching availabilities or `/activities/{id}/booking-options` for the offerable option chooser and headline `priceSummary`.

## 6. Hand off to hosted checkout [#6-hand-off-to-hosted-checkout]

Call `checkout.createHandoff` (`POST /checkout/handoff`) from the browser with the channel key, a required supported `Buchung-Locale`, and returned SKUs with quantities:

```js
const response = await fetch(new URL('checkout/handoff', apiBase), {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-Buchung-Channel-Key': channelKey,
    'Buchung-Locale': supportedLocale,
  },
  body: JSON.stringify({ lines: [{ sku: returnedSku, quantity: 1 }] }),
});
const handoff = await response.json();
if (!response.ok) throw new Error(handoff.error.message);
```

Display `handoff.warnings` and display-only `handoff.lines`, then navigate unchanged:

```js
window.location.assign(handoff.url);
```

The response supplies a signed URL on the operator's storefront domain, valid for 15 minutes. It reserves nothing and carries only SKUs and quantities, never prices. Always render `listedTotal` (never multiply `listedUnitPrice` to infer a total), send each SKU at most once, and show `sold_out_at_handoff` or a generic fallback for unknown warning codes. Hosted checkout revalidates price and availability and collects participants, options, extras and payment. See [checkout handoff](/docs/developers/checkout).

> [!WARNING]
> **Nothing is held**
>
> Prices and per-availability capacity are live snapshots, not holds. Test checkout on your sandbox operator first; see [sandbox & testing](/docs/developers/sandbox).

## Next steps [#next-steps]

- [Data model and filtering](/docs/developers/data-model): Typed filters, facets, POST queries and exact counts.
- [Checkout handoff](/docs/developers/checkout): Response shapes, warnings and error handling for `checkout.createHandoff`.
- [Build a storefront & SDK](/docs/developers/build-storefront): Generate a TypeScript client and structure the integration.
- [Errors](/docs/developers/errors): The shared error envelope and how to handle each code.

