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

# Errors

```json
{
  "error": {
    "code": "validation_failed",
    "message": "validation failed",
    "doc_url": "https://api.buchungapp.com/v1/docs#errors/validation_failed",
    "request_id": "example-request",
    "details": [
      { "path": "query.facets.0.match", "message": "Expected \"any\" | \"all\"" }
    ]
  }
}
```

## Error envelope [#error-envelope]

Every error returns a top-level `error` object with string fields `code`, `message`, `doc_url` and `request_id`. `details` is optional and is normally an array of `{ path, message }` validation items (for Management API conflict detail shapes, see the [Management API guide](/docs/developers/management-api)). Error codes are closed per error variant within v1.

## Storefront API error codes [#storefront-api-error-codes]

| Wire code | HTTP status | Recommended action |
| --- | ---: | --- |
| `validation_failed` | 400 | Fix invalid query syntax, cursor, malformed `Buchung-Locale`, missing handoff locale or invalid body fields; inspect `details`. |
| `locale_not_supported` | 400 | Returned by `checkout.createHandoff` for an unsupported locale. Pick a locale from `site.get` (listed in `details`). Reads fall back to the operator default instead. |
| `unauthorized` | 401 | Check `X-Buchung-Channel-Key` and whether the key was revoked; do not retry unchanged. |
| `forbidden_origin` | 403 | The browser page's `Origin` is not on the booking channel's allowlist. Ask Buchung to add that exact origin (see [Before you start](/docs/developers#before-you-start)). |
| `not_found` | 404 | Check the resource UUID/handle and operator scope. On `checkout.createHandoff`, any invalid or non-offerable SKU rejects the whole request with `lines[index].sku` details. |
| `storefront_domain_missing` | 409 | The operator has no verified storefront domain configured for hosted checkout. Configure one before retrying. |
| `payload_too_large` | 413 | Keep storefront POST JSON bodies (queries and checkout handoffs) at or below 16 KiB. |
| `validation_failed` | 414 | The full GET request URL is 8 KiB or longer. Switch to the matching POST `/query` endpoint. |
| `rate_limited` | 429 | Honor `Retry-After` and back off with jitter. |
| `count_timeout` | 503 | Exact counting exceeded its budget. Retry the read with backoff; never substitute `0` or an estimate. |
| `service_unavailable` | 503 | Retry reads with backoff; checkout handoff returns `Retry-After: 30` when the shared limiter is unavailable. |
| `internal_error` | 500 | Log `request_id` for support; avoid blind write retries. |

Note that sold-out SKUs on `checkout.createHandoff` return `200 OK` with `warnings: [{ sku, code: "sold_out_at_handoff" }]` rather than an error; show warnings to the visitor before continuing.

## Catalogue query errors [#catalogue-query-errors]

These rules apply to GET lists and POST `/query` requests for activities, availabilities and one activity's availabilities.

- **`400 validation_failed` for malformed input.** Read `details[].message` for the expected shape or value. Structural paths for `where` and `facets` start with `query.` on GET and `body.` on POST, with dotted array indexes, such as `query.facets.0.match` or `body.where.activity.categories.containsAny.0`. An unexpected property can be reported at its enclosing object or array item, such as `body.facets.0`. Invalid GET JSON points to `query.where` or `query.facets`; invalid POST JSON points to `body`.
- **`400 validation_failed` for a rejected fact condition.** An unknown fact set or field or a value or operator the field does not accept returns the message `Invalid catalogue query` with a path rooted at `where` and bracketed array indexes, such as `where.all[2].fact.field`.
- **`400 validation_failed` for unavailable filters or a query over budget.** A category, event or variation unavailable to the public query gets the same response as an unknown reference. Refresh your filter values and facet options or remove the rejected filter. If the query exceeds its complexity budget, simplify `where` or remove selections. The API can return this code without structural details.
- **`400 validation_failed` for an invalid cursor.** Retry from the first page without `cursor`. See [pagination](/docs/developers/pagination#how-do-i-paginate-safely).
- **`404 not_found` for an unavailable collection.** Check the configured collection UUID and channel key. The collection needs a storefront handle and must be available on that booking channel. An archived collection or one with unusable saved criteria also returns this code. The existing ceiling of 1,000 distinct saved category IDs bounds the references checked per collection read. A collection above that ceiling is unavailable. If the setup looks correct, send `error.request_id` to your Buchung contact. The same code applies if the channel becomes unavailable after authentication.

## Management API errors [#management-api-errors]

Backend integrations using `/management` endpoints also handle `403 forbidden`, `409 revision_conflict`, `409 document_referenced`, `413 payload_too_large` (64 KiB cap) and `422 validation_failed` on document uploads. See [Management API error handling](/docs/developers/management-api#errors-and-limits).

## Logging and retries [#logging-and-retries]

Log the operation, HTTP status, `error.code` and `error.request_id` (keep `request_id` when contacting support). Redact channel keys, management tokens, signed upload URLs and customer data from logs. The checkout handoff URL and its `seed` are not secrets and may appear in browser logs; always navigate to the full URL unchanged.

Correct `4xx` input before retrying. On `429` and `503`, use exponential backoff with jitter and honor `Retry-After`.

