Checkout handoff
Create a stateless signed URL that sends the visitor's selection to Buchung-hosted checkout.
Early access. Use the API base, channel key and allowed origins supplied by Buchung before running examples. Interactive API requests are disabled here.
Call checkout.createHandoff (POST /checkout/handoff) directly from the visitor's browser on an allowed origin, using the publishable channel key and a required supported Buchung-Locale header. Test checkout on your sandbox operator first (see sandbox & testing).
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 result = await response.json();
if (!response.ok) throw new Error(result.error.message);Display result.warnings and the listed prices, then navigate to result.url unchanged:
window.location.assign(result.url);Request rules
- Verified storefront domain required: without one configured for the operator, the call returns
409 storefront_domain_missing. - 1 to 10 lines, 1 to 10 quantity per line: pass real returned opaque SKUs (1–128 ASCII characters) and integer quantities. Keep the JSON body at or below 16 KiB.
- Unique SKUs: send each SKU at most once. Repeating a SKU rejects the whole request with
400 validation_failed(Duplicate SKUatlines[index].sku); put the combined quantity on one line. - No prices or return URL: never send prices, discounts, tax totals or a return URL. Locale comes solely from the
Buchung-Localeheader. Participants, options, extras and payment are collected on Buchung-hosted checkout. - Quantity units: quantity counts units of the selected sellable, not necessarily people. Label quantities with
bookingUnitNounForms.
Response and stateless seed semantics
A 200 response returns locale, an absolute url on the operator's storefront domain (/<lang>/booking?seed=<token>), expiresAt, display-only lines and warnings:
{
"locale": "en",
"url": "https://storefront.example.com/en/booking?seed=synthetic-token",
"expiresAt": "2026-10-19T12:15:00Z",
"lines": [
{ "sku": "synthetic-sku", "quantity": 1, "listedTotal": { "amount": 15000, "currency": "EUR", "hasPromotion": false }, "listedUnitPrice": { "amount": 15000, "currency": "EUR", "hasPromotion": false } }
],
"warnings": [
{ "sku": "synthetic-sku", "code": "sold_out_at_handoff" }
]
}Important invariants:
- Nothing is persisted or reserved: the signed seed carries SKUs and quantities only, never prices. It is valid for 15 minutes (
expiresAt) and a second redemption is not guaranteed; request a fresh handoff if it expires. - Always show
listedTotal:listedUnitPriceappears only for single-component pricing. Never infer a total by multiplyinglistedUnitPrice. Hosted checkout revalidates final price and availability. - Show warnings even on
200: a sold-out SKU still succeeds withwarnings: [{ sku, code: "sold_out_at_handoff" }]. Warning codes are an open vocabulary: show a generic fallback message for any unknown code. - Use
urlunchanged: the URL andseedquery parameter are not secrets (visitors and browsers may see them). Never strip or rewrite the URL or its<lang>path segment.
When the visitor opens the URL, hosted checkout adds the items to their booking session and walks them through participant details and payment.
Error handling
- Locale errors:
checkout.createHandoffrequires a supportedBuchung-Locale. Missing or malformed values return400 validation_failed; well-formed unsupported values return400 locale_not_supportedwith the list of supported locales. - Unavailable or unknown SKUs: any foreign or non-offerable SKU rejects the entire request with
404 not_foundand per-itemdetails:
{
"error": {
"code": "not_found",
"message": "One or more selections are unavailable",
"doc_url": "https://api.buchungapp.com/v1/docs#errors/not_found",
"request_id": "example-request",
"details": [
{ "path": "lines[0].sku", "message": "SKU is unavailable" }
]
}
}- Missing storefront domain: if the operator has not configured a verified storefront domain, the API returns
409 storefront_domain_missing:
{
"error": {
"code": "storefront_domain_missing",
"message": "No verified storefront domain is configured",
"doc_url": "https://api.buchungapp.com/v1/docs#errors/storefront_domain_missing",
"request_id": "example-request"
}
}See errors for the full error envelope and retry rules.