Quickstart for agents
The canonical plain-Markdown runbook for coding agents integrating the Buchung Storefront API.
Early access. Use the API base, channel key and allowed origins supplied by Buchung before running examples. Interactive API requests are disabled here.
Build a storefront against the Buchung Storefront v1 API.
If you have an API base and a channel key, call the API directly from the
browser on an allowed origin. Stop and ask your user only when a call fails
with an error you cannot fix: 401 unauthorized, 403 forbidden_origin,
404 not_found on GET /site, or 409 storefront_domain_missing on checkout
handoff. Report the exact HTTP status, error.code, error.message and
error.request_id. Fix validation errors yourself.
Entry points:
- Read /llms.txt, /docs/developers/mental-model, /docs/developers/use-cases
and /docs/developers/reference; download /openapi.json.
- Follow /docs/developers/booking-ux and /docs/developers/component-craft
for UI layout, date rows, scarcity and filter bar patterns.
- Ready-to-use agent prompts and playbooks: /docs/developers/agent-playbooks.
- For guest AI assistant access (no custom site needed), see /docs/developers/mcp.
- Optional TypeScript SDK generation: /docs/developers/build-storefront.
- API base: https://api.buchungapp.com/v1. Join guide paths relative to that
base; never prepend /v1 twice.
Authentication and origins:
- Send X-Buchung-Channel-Key on every storefront request. The bg_st_ key is
publishable and belongs in browser code.
- Do not add a server proxy unless asked: behind a proxy all visitors share
one rate-limit budget (600 reads / 60 handoffs per minute) and browser
origin checks stop applying.
- Never put bg_it_ Management API credentials in browser code. A storefront
does not need Management API endpoints.
Locales, timezones and money:
- Call GET /site first to discover supported locales, currency and timeZone.
- Buchung-Locale is optional on all reads (omitted or unsupported falls back
to operator default; Content-Language reports applied locale;
Buchung-Locale-Fallback reports an unsupported value). Only
POST /checkout/handoff requires a supported Buchung-Locale (otherwise
400 validation_failed or 400 locale_not_supported).
- Never send locale in a query parameter or handoff body. Accept-Language is
not read; match navigator.language against site.locales and send it
explicitly. See /docs/developers/pagination.
- Never display activity times in the visitor's browser timezone. Format
startsAt in the departure location's timezone and endsAt in the arrival
location's timezone, falling back independently to the AA's timeZone
(operator default).
- Money is Price { amount, currency } with integer minor units (15000 EUR =
150.00 EUR). Format with Intl.NumberFormat after dividing by
10 ** maximumFractionDigits for that currency.
Catalogue, filtering and presentation:
- Never invent activity handles, UUIDs, SKUs, event IDs, prices or dates.
- Resolve handles via GET /activities/by-handle/{handle} and retain UUIDs
(handles can change). Hidden activities are unlisted in discovery but
accessible by direct UUID/handle; draft and archived return 404.
- Filter with typed activity, availability or fact leaves composed via
all/any/not. Same-AA matching applies across occurrence predicates. No
free-text filter exists.
- GET encodes where/facets as JSON strings (total URL < 8 KiB). For larger
queries use POST activities/query, availabilities/query or
activities/{id}/availabilities/query with decoded JSON (16 KiB body cap).
- Use the configured collectionId on HTTP list queries. A collection returns
the activities it selects without exposing its selection criteria. Use the
returned facet and option IDs and honor optionsTruncated. Refresh options
after selecting one. If the collection returns 404 not_found, check the
collection and booking channel. An eligible activity outside a valid
collection returns an empty activity-scoped availability page.
- For 400 validation_failed, read error.details when present. Structural
where/facets paths use query.* on GET and body.* on POST with dotted indexes.
Unknown fact sets or fields use reader paths such as where.all[2].fact.field.
Unavailable category, event and variation references answer like unknown ones. Refresh
those values or remove the filter.
- Keep cursors opaque and bound to the exact query. Each page is a fresh
snapshot with exact totalCount and facet counts. Restart without a cursor
after changing filters or when a saved cursor returns 400 validation_failed.
Retry 503 count_timeout with backoff; never substitute 0 or page length.
- Grouping AAs into departure/event cards is presentation only. Never sum
remaining across AAs (options can share a capacity pool). Use
bookingUnitNounForms for localized quantity labels (one unit is not
necessarily one person).
- Media arrays may be empty: render a neutral labelled placeholder, never a
broken image. Treat image URLs as opaque (never alter signed URLs or
invent widths) and build srcset only from returned srcSet entries. Videos
with muxPlaybackId use HLS (.m3u8); otherwise direct video URL.
- Public PDF downloads come from pdf entries in customFacts; use their
returned document URLs unchanged.
- Open string vocabularies (handoff warning codes, trust-signal kind/source/
renderingShape/surfaces, CatalogueReference.kind, site location channel
types) may add values within v1: render unknown strings with a fallback
and ignore unsupported surfaces/channels.
Checkout handoff:
- Call POST /checkout/handoff from the browser with 1-10 unique returned
SKUs (quantities 1-10) and a supported Buchung-Locale header.
Never send prices to checkout.
- The response returns a stateless signed URL valid for 15 minutes. Nothing
is persisted or reserved. Hosted checkout revalidates price/availability
and collects participants, options, extras and payment.
- Display handoff.warnings (including sold_out_at_handoff and a fallback for
unknown codes) and display-only listedTotal (never infer total by
multiplying listedUnitPrice), then navigate to handoff.url unchanged
without stripping the seed parameter.
- Foreign or non-offerable SKUs reject the whole request with 404 not_found
and per-item lines[index].sku details.
Errors, retries and testing:
- Read error.code, error.message, optional error.details, error.doc_url and
error.request_id. Fix 4xx errors; back off on 429/503 honoring Retry-After.
- Test checkout only on the sandbox operator with synthetic customer details.
Verify every step against real responses.Before you ship
Read data model and filtering, checkout handoff, authentication and errors. A successful catalogue read does not prove checkout works: verify the full handoff on your sandbox operator from an allowed origin.