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

# Checkout handoff

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](/docs/developers/sandbox)).

```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 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:

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

## Request rules [#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 SKU` at `lines[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-Locale` header. 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 [#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`:

```json
{
  "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`:** `listedUnitPrice` appears only for single-component pricing. Never infer a total by multiplying `listedUnitPrice`. Hosted checkout revalidates final price and availability.
- **Show warnings even on `200`:** a sold-out SKU still succeeds with `warnings: [{ sku, code: "sold_out_at_handoff" }]`. Warning codes are an open vocabulary: show a generic fallback message for any unknown code.
- **Use `url` unchanged:** the URL and `seed` query 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 [#error-handling]

- **Locale errors:** `checkout.createHandoff` requires a supported `Buchung-Locale`. Missing or malformed values return `400 validation_failed`; well-formed unsupported values return `400 locale_not_supported` with the list of supported locales.
- **Unavailable or unknown SKUs:** any foreign or non-offerable SKU rejects the entire request with `404 not_found` and per-item `details`:

```json
{
  "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`:

```json
{
  "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](/docs/developers/errors) for the full error envelope and retry rules.

