> 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.

# Authentication and channel keys

```http
X-Buchung-Channel-Key: <provisioned-channel-key>
Buchung-Locale: en
```

## Base URL and headers [#base-url-and-headers]

The API base is `https://api.buchungapp.com/v1`. Join guide paths relative to that base; never prepend `/v1` twice. Send `X-Buchung-Channel-Key` on every storefront request. `Buchung-Locale` is optional on reads and required on `checkout.createHandoff` (see [locale selection](/docs/developers/pagination#how-do-i-select-a-locale)).

## What does the storefront channel key authorize? [#what-does-the-storefront-channel-key-authorize]

A storefront channel key (`bg_st_` followed by 32 lowercase hexadecimal characters) identifies one operator's booking channel. It grants access only to public catalogue reads and stateless checkout handoff creation: it cannot manage content, view bookings or read customer data. Draft, archived, absent and foreign resources return `404 not_found`.

Request channel keys through your Buchung contact (see [Before you start](/docs/developers#before-you-start)).

When a read includes `collectionId`, the booking channel must still be live in the authenticated scope. If it becomes unavailable after authentication, the collection read returns `404 not_found`. Check the channel and collection configuration before retrying. See [catalogue query errors](/docs/developers/errors#catalogue-query-errors).

## Can a browser use a channel key? [#can-a-browser-use-a-channel-key]

Yes. The storefront channel key is a **publishable key**. Call the Storefront API directly from the visitor's browser on an allowed origin, for both reads and `POST /checkout/handoff`. Visitors can see the key in network traffic; that is expected.

What protects your channel:

- **Browser origin allowlist (CORS):** data responses are readable only by pages served from an allowed origin on the channel. Any other origin (including `null`) gets `403 forbidden_origin`. Preflight and error responses remain readable so your app can inspect the error envelope.
- **Public-only scope:** the key reads only public catalogue data and creates stateless checkout links.
- **Per-visitor rate limits:** limits count per booking channel and client IP (IPv6 `/64`), so visitors do not share one budget. See [rate limits](/docs/developers/rate-limits).

Requests without an `Origin` header (such as server-side renders or `curl`) bypass the browser origin check. You may proxy requests through your own server if needed, but then every visitor shares your server's single rate-limit budget (600 reads and 60 handoffs per minute for the whole site). Call the API directly from the browser unless you have a specific server-side need.

CORS preflight allows `GET`, `POST` and `OPTIONS` with headers `X-Buchung-Channel-Key`, `Buchung-Locale` and `Content-Type` (no key required on preflight). Responses expose `Content-Language`, `Buchung-Locale-Fallback`, `X-Request-Id`, `X-RateLimit-*` and `Retry-After`, and carry `Cache-Control: private, no-store` with `Vary: Buchung-Locale, Origin, X-Buchung-Channel-Key`.

## Server-side management credentials [#server-side-management-credentials]

The [Management API](/docs/developers/management-api) uses separate secret tokens (`Authorization: Bearer bg_it_<32 hex chars>`) for backend integrations that sync custom definitions, translations and PDFs. Never put a `bg_it_` credential in browser code. Storefront keys never authorize management calls, and management credentials never authorize storefront checkout handoffs.

## Rotating or revoking keys [#rotating-or-revoking-keys]

Ask Buchung for a replacement credential, deploy it to your site, verify traffic, then request revocation of the old key. Issuing a new key does not automatically revoke the previous one. Credentials are resolved uncached on every request, so revoking a key takes effect immediately (`401 unauthorized`).

