Zum Hauptinhalt springen

Erstelle eigene bookingkit-Berichte mit einem KI-Assistenten

Schritt-für-Schritt-Anleitung für Anbieter zur Nutzung eines KI-Assistenten (z. B. Claude) und der bookingkit-API v3, um auf ihrem eigenen Computer vollständig individuelle CSV-Berichte zu erstellen

Verfasst von Björn Blankenhagen

Gilt für: BusinessKit und höher · API v3 · Mac und Windows

⚠️ Hinweis zur API-Nutzung: Das Erstellen und Ausführen von Berichten auf diese Weise verbraucht dein bookingkit-API-Kontingent. Ein monatlicher Auftragsbericht benötigt typischerweise einige hundert bis einige tausend Anfragen pro Durchlauf. Du hast ein monatliches Budget von 500.000 Anfragen und erhältst Warn-E-Mails bei 50 %, 80 %, 90 % und 100 %.


Was du bekommst

Einen Bericht über deine bookingkit-Bestellungen – genau die Spalten, die du brauchst, in genau der Reihenfolge, die du möchtest – als CSV-Datei auf deinem Computer, die sich in Excel öffnen lässt. Du beschreibst den Bericht in einfacher Sprache; ein KI-Assistent schreibt und führt den Code für dich aus.

Wenn alles eingerichtet ist, dauert die Erstellung des nächsten Monatsberichts nur einen einzigen Satz. Dieses Tool ist genau das richtige für dich, wenn du jeden Monat denselben Bericht mit einem festen Spaltenlayout brauchst, du mehr Daten benötigst als der Standard-Export liefert, oder dein Bericht mehrere Dinge kombinieren muss (zum Beispiel Umsatz und Teilnehmerzahlen pro Kostenstelle).

Dieses Tool ist nicht das richtige für dich, wenn du nur einmal etwas nachschlagen möchtest – nutze dafür die Standard-Exporte in bookingkit.

Warum nicht Google Sheets? Berichte, die als Google Apps Script erstellt werden, stoßen an Googles Limits: Skripte werden nach wenigen Minuten gestoppt, und Google drosselt die Anzahl der Anfragen. Ein Bericht für einen ganzen Monat an Bestellungen benötigt mehrere hundert Anfragen und stößt regelmäßig an diese Grenzen. Wenn du deinen eigenen Computer verwendest, entfallen beide Einschränkungen, und er kann zuvor abgerufene Daten speichern, sodass Wiederholungen viel schneller sind.


Bevor du anfängst

1. Prüfe deinen Tarif. Für den API-Zugriff ist ein BusinessKit-Account oder höher erforderlich.

2. Fordere API-Zugangsdaten an. Dafür gibt es keine Self-Service-Oberfläche – wende dich per Chat an den bookingkit-Support und bitte um API-v3-Zugangsdaten.

Teile ihnen mit:

  • dass du nur Lesezugriff für Berichte möchtest;

  • die benötigten Berechtigungen: orders_read_owned (oder orders_read_all, wenn du ein Marktplatz bist) und calendar_read;

  • dass du auch Sandbox-Zugangsdaten zum Testen möchtest.

Du erhältst eine Client-ID und ein Client-Secret. Bewahre diese sicher auf – sie ermöglichen den Zugriff auf deine Buchungsdaten.

3. Installiere einen KI-Assistenten, der mit Dateien auf deinem Computer arbeiten kann. Jedes der folgenden Programme funktioniert:

  • Claude Code – https://claude.com/claude-code (die Beispiele unten verwenden dieses Programm)

  • Gemini CLI

  • Cursor oder ein anderer KI-Assistent mit Zugriff auf deine Dateien

Ein Chat-Fenster im Browser allein reicht nicht aus, da es den Bericht nicht für dich ausführen kann. Wenn das alles ist, was du hast, kann der Assistent das Skript trotzdem schreiben und du führst es selbst aus – aber die folgende Einrichtung ist viel einfacher.


Schritt 1 – Erstelle einen Ordner

Erstelle einen leeren Ordner auf deinem Computer, zum Beispiel bookingkit-reports in deinen Dokumenten. Öffne deinen KI-Assistenten in diesem Ordner.

Mit Claude Code: Öffne das Terminal, tippe cd (mit einem Leerzeichen), ziehe den Ordner in das Terminal-Fenster, drücke Enter und tippe dann claude.


Schritt 2 – Füge den Einrichtungs-Prompt ein

Kopiere alles im folgenden Kasten und füge es in den Assistenten ein. Das musst du nur ein einziges Mal tun.

I want to build a custom report from the bookingkit API v3 in this folder. I am not a programmer, so please explain each step in plain language and do not ask me to edit any code.  Please open this page and follow the "Agent instructions" section on it exactly: https://help.bookingkit.com/de/articles/16734361-erstelle-eigene-bookingkit-berichte-mit-einem-ki-assistenten  If you cannot open web pages, tell me and I will paste those instructions in myself.  Start by setting up the folder and telling me what you need from me.

Der Assistent überprüft, was auf deinem Computer installiert ist, richtet den Ordner ein und erstellt eine Datei für deine Zugangsdaten. Wenn dein Assistent keine Links öffnen kann, kopiere den Abschnitt „Agent Instructions" vom Ende dieses Artikels und füge ihn stattdessen ein. Der Inhalt ist identisch.


Schritt 3 – Trage deine Zugangsdaten ein

Der Assistent erstellt eine Datei namens credentials.txt mit leer gelassenen Werten. Öffne sie in einem Texteditor, trage die Client-ID und das Client-Secret ein, die du vom Support erhalten hast, und speichere die Datei.

Füge dein Client-Secret nicht in den Chat ein. Alles, was du in einen KI-Assistenten eingibst, wird an die Server des jeweiligen Anbieters gesendet. Wenn du es stattdessen in die Datei schreibst, bleibt es auf deinem Computer – das Skript liest es direkt von dort. Lasse environment=sandbox, solange du testest. Ändere es erst auf production, wenn die Zahlen stimmen.


Schritt 4 – Beschreibe deinen Bericht

Teile dem Assistenten mit, was du möchtest. Kopiere diese Vorlage und fülle sie aus – je genauer du bist, desto weniger Rückfragen gibt es:

Report name:        z. B. Monatlicher Kostenstellen-Bericht Date basis:        service date (Datum der Aktivität)                    ODER booking date (Datum der Buchung) Date range:        z. B. immer der letzte vollständige Kalendermonat Which orders:      nur akzeptierte, oder einschließlich Stornierungen One row per:       order (empfohlen), ticket oder Teilnehmer Columns, in order: z. B. Buchungscode, Buchungsdatum, Leistungsdatum, Event-Name,                    Teilnehmer, Umsatz brutto, Umsatz netto, Zahlungsmethode Filters:           z. B. nur Events, die „Schlossführung" enthalten Exclude:           z. B. alle Events, die „Kombiticket" enthalten VAT:               z. B. 0 % für Kostenstelle X, sonst API-Wert verwenden Output:            z. B. out/kostenstellen-bericht_2026-07.csv Excel language:    German oder English

Nicht sicher, was „Date basis" bedeutet? Für Buchhaltungsberichte ist fast immer das Leistungsdatum gemeint – der Monat, in dem die Aktivität stattfand, nicht der Monat, in dem der Kunde gebucht hat. Der Assistent ruft die Daten ab, schreibt die CSV-Datei und zeigt dir eine Zusammenfassung.


Schritt 5 – Prüfe die Zahlen

Bevor du dich auf den Bericht verlässt, vergleiche ihn mit dem Standard-Export von bookingkit für denselben Monat. Überprüfe die Anzahl der Aufträge und den Gesamtumsatz. Wenn sie nicht übereinstimmen, teile das dem Assistenten mit – er kennt die üblichen Ursachen und kann sie beheben. Die häufigsten sind: stornierte Buchungen sind inkorrekt ein- oder ausgeschlossen, Kombitickets werden doppelt gezählt, oder Brutto und Netto sind vertauscht.


Jeden Monat danach

Öffne den Ordner, starte deinen Assistenten und sage:

run the monthly order report for last month

Das ist alles. Der Assistent hat deine Berichtsspezifikation beim ersten Mal aufgeschrieben, daher kennt er bereits die Spalten, Filter und das Format. Komme nur dann zu diesem Artikel zurück, wenn du den Inhalt des Berichts ändern möchtest.


Fehlerbehebung

Was du siehst

Was es bedeutet

Was du tun kannst

429 mit error_code 42901

Das Skript hat einen zweiten Access-Token angefordert, während noch einer aktiv war. Pro Stunde ist nur einer erlaubt.

Teile dem Assistenten mit, dass er den zwischengespeicherten Token wiederverwenden soll.

429 mit error_code 42910

Dein monatliches Limit von 500.000 API-Anfragen ist aufgebraucht.

Warten hilft nicht – das Limit wird erst am 1. des nächsten Monats zurückgesetzt. Wende dich an den Support, um das Limit zu erhöhen.

401 Unauthorized

Falsche Zugangsdaten oder der Token ist abgelaufen.

Prüfe credentials.txt auf Tippfehler und unbeabsichtigte Leerzeichen. Bestätige beim Support, dass deine Berechtigungen orders_read_owned umfassen.

403 oder leere Ergebnisse in Production

Deine Zugangsdaten sind möglicherweise nur für die Sandbox gültig, oder eine Berechtigung fehlt.

Prüfe environment= in credentials.txt und lass dann deine Berechtigungen vom Support bestätigen.

Die Spalte „Event-Name" ist leer

Anfrage-Events fehlen in der Event-Liste.

Teile dem Assistenten mit: „pass type=ALL when fetching vendor events".

Stornierungen fehlen

Die API gibt standardmäßig nur akzeptierte Aufträge zurück.

Teile dem Assistenten mit, dass du status=ALL möchtest.

Umsatz ist zu hoch

Kombitickets werden doppelt gezählt, oder stornierte Teilnehmer sind eingeschlossen.

Bitte um einen Ausschluss von Kombitickets und um die Prüfung beider Stornierungsebenen.

Summen stimmen leicht nicht

Brutto und Netto sind vertauscht. Ticketpreise sind brutto – netto muss aus dem Mehrwertsteuersatz berechnet werden.

Bitte den Assistenten, die Brutto-/Netto-Umrechnung zu überprüfen.

Excel zeigt ü statt ü

Die Datei wurde ohne Byte Order Mark gespeichert.

Bitte darum, die CSV-Datei als UTF-8 mit BOM zu speichern.

Excel zeigt alles in einer Spalte

Dein Excel erwartet ein anderes Trennzeichen.

Teile dem Assistenten mit, welche Excel-Sprache du verwendest.

Zahlen können in Excel nicht summiert werden

Sie wurden als Text gespeichert.

Bitte um einfache Zahlen mit Dezimalkomma und ohne Währungssymbol.

Das Skript bricht mittendrin ab

Eine Anfrage ist fehlgeschlagen. Das ist beabsichtigt – ein unvollständiger Bericht ist schlimmer als keiner.

Bitte den Assistenten, den Fehler anzuzeigen.


Gut zu wissen

  • Alles bleibt auf deinem Computer. Das Skript kommuniziert nur mit bookingkit. Die Berichtsdatei verlässt deinen Computer nicht.

  • Berichte sind schreibgeschützt. Nichts, was der Assistent hier erstellt, kann eine Buchung ändern oder stornieren.

  • Teste zuerst in der Sandbox. bookingkit weist darauf hin, dass Aktionen gegen die Produktionsumgebung echte Kosten verursachen können.

  • Du hast ein monatliches Budget von 500.000 API-Anfragen. Ein monatlicher Auftragsbericht verbraucht einige hundert bis einige tausend davon – das Budget ist großzügig – aber du erhältst Warn-E-Mails bei 50 %, 80 %, 90 % und 100 %.


Hilfe erhalten

Wenn der Assistent nicht weiterkommt, bitte ihn, zu erklären, was er versucht hat, und teile das dem bookingkit-Support zusammen mit der Berichtsspezifikation aus Schritt 4 mit.

Referenzdokumentation:


Agent Instructions

The following instructions are for AI assistants building and running reports on behalf of bookingkit vendors.

# Bookingkit report agent — standing instructions  You are helping a bookingkit customer build and run a custom report from the bookingkit API v3 on their own computer. Assume the person you are talking to is **not a programmer**. Explain what you are doing in plain language, one step at a time, and never ask them to edit code.  ## 0. Hard rules  1. **Read-only.** Use only `GET` requests. Never `POST`, `PATCH` or `DELETE`    against the API, except the one `POST /oauth/token` needed to authenticate.    A reporting task never modifies bookings. 2. **Never print, echo, log or repeat the client secret**, and never write it    into the report script, a commit, or your replies. Read it from the    credentials file at runtime only. 3. **Sandbox first.** If the customer has sandbox credentials, use    `https://api-sandbox.bookingkit.de` until the report looks right. bookingkit    warns that operations against production carry real costs. 4. **Fail loudly.** Never write an output file from an incomplete fetch. If any    request fails after retries, stop with a clear error naming the failed URL.    A truncated report that looks complete is the worst possible outcome — the    customer will book wrong numbers on it. 5. **Do not invent field names.** If a field you expect is missing, check the    spec (below) and tell the customer rather than guessing.  ## 1. Read these first  - **API spec (authoritative):**   https://developers.bookingkit.com/redocusaurus/apiv3.yaml   This is **Swagger 2.0**, not OpenAPI 3 — expect `host` + `basePath` and   `#/definitions/...`, not a `servers` block. Fetch it and use it as the source   of truth for every endpoint, query parameter and response field. - **Rate limits:** https://developers.bookingkit.com/docs/api/api_v3/rate-limit - **Authentication:** https://developers.bookingkit.com/docs/api/api_v3/authentication  There is no `llms.txt` on the portal. Ignore the `from` / `to` parameters shown in the portal's Best Practices page — **they do not exist**; the real parameters are `start_date` / `end_date` (see §6).  ## 2. Set up the runtime  Check what is already installed, in this order, and use the first one you find:  1. `python3 --version` 2. `python --version` (must be 3.x) 3. `node --version` (must be 18 or newer, for built-in `fetch`)  **Use the standard library only.** Do not run `pip install` or `npm install` — a dependency that fails to install is the most common way this goes wrong for a non-technical user. Python's `urllib.request`, `json`, `csv`, `datetime` and `concurrent.futures` are enough; so are Node's `fetch` and `node:fs`.  If none of the three is available, walk the customer through installing Python, one instruction at a time:  - **macOS:** the official installer from https://www.python.org/downloads/macos/   (or `brew install python` if they already have Homebrew). - **Windows:** `winget install Python.Python.3.12` in Terminal, or the installer   from https://www.python.org/downloads/windows/. Tell them to tick   **"Add python.exe to PATH"**.  ## 3. Create the working folder  In the folder the customer chose, create:  ``` AGENTS.md                  <- these instructions plus their report spec credentials.txt            <- you create it, empty, for the customer to fill in report.py                  <- or report.js cache/                     <- cached API responses out/                       <- finished CSV files .gitignore                 <- must list credentials.txt and cache/ ```  `credentials.txt`:  ``` # Fill in the values you received from bookingkit support, then save this file. # Do not share it with anyone. client_id= client_secret= vendor_id= # environment: sandbox or production environment=sandbox ```  Create this file yourself with the values left empty, then ask the customer to open it **in their text editor**, fill in the values and save it. Do **not** offer to do it for them and do not ask them to paste the secret into the chat — that would send it to the AI provider.  Write these standing instructions into `AGENTS.md`, then append the customer's report specification as you settle it. This is what lets the next run be a single sentence instead of a re-paste.  ## 4. Authentication  - Token endpoint: `POST https://api.bookingkit.de/oauth/token`   (sandbox: `https://api-sandbox.bookingkit.de/oauth/token`).   Note it is **not** under `/v3`. - Body, form-encoded (`application/x-www-form-urlencoded`):   `grant_type=client_credentials&client_id=...&client_secret=...` - Response: `access_token`, `token_type: Bearer`, `expires_in: 3600`, `scope`. - API base: `https://api.bookingkit.de/v3`   (sandbox: `https://api-sandbox.bookingkit.de/v3`). - Send `Authorization: Bearer ` and `Accept: application/json`.   A `?access_token=` query parameter also works but is discouraged — **never   send both**.  **Cache the token to `cache/token.json` together with its expiry timestamp, and reuse it across runs.** Only **one active token per client per hour** exists. Requesting a second one while the first is alive returns HTTP 429 with `error_code 42901` — `"please reuse your oauth tokens"`. Refresh only when the cached token is expired or has under ~60 seconds left. There are no refresh tokens; an expired token gives 401.  ## 5. Fetching: pagination, politeness, caching  **Pagination** is offset-based: `limit` and `offset`. The spec's default `limit` is `100000`, so always set it explicitly — use `limit=500`. Request pages until a page comes back with fewer than `limit` items. Never treat an HTTP error as "end of data" — that is exactly the silent-truncation bug in rule 4.  Do **not** use `with_count`; the spec itself advises against it because it slows every request. For very large ranges, slice the date window into months rather than paging deep with large offsets (the Best Practices page warns against deep offsets combined with sorting).  **Politeness and retries.** The API documents no per-second limit and sends no `Retry-After`, so impose your own behaviour:  - At most **4–6 concurrent requests**. - Retry on 5xx and on 429 with exponential backoff (e.g. 2s, 4s, 8s, 16s). - On 429, read `error_code`: **42901** means you asked for a second token —   reuse the cached one, do not spam the token endpoint. **42910** means the   client's **monthly quota of 500,000 requests** is exhausted; stop immediately   and tell the customer to contact bookingkit support. Backoff will not help. - Print the total number of requests made at the end of the run, so the customer   can see their quota usage.  **Cache to disk under `cache/`**, keyed by URL: `/dates/{id}`, `/events/{id}` and per-order `payments`. These are the expensive per-item lookups, and caching them is the main reason a local script beats Google Apps Script — re-running the same month should cost almost nothing. Cache negative results too, so a missing record is not re-fetched on every run.  ## 6. Endpoints for an order report  | Purpose | Endpoint | |---|---| | All events of the vendor (for names) | `GET /v3/vendors/{vendor_id}/events?type=ALL` | | The orders | `GET /v3/vendors/{vendor_id}/orders` | | Payment method per order | `GET /v3/orders/{id}/payments` | | Service date of a ticket | `GET /v3/dates/{id}` | | Single event fallback | `GET /v3/events/{id}` |  Useful `GET /orders` parameters: `start_date`, `end_date` (when the order was **placed**), `start_event_date`, `end_event_date` (by **service** date), `status`, `fields`, `order`, `delta_since`, `limit`, `offset`.  All timestamps must match `YYYY-MM-DDThh:mm:ssZ` — UTC, with seconds and a trailing `Z`. `2026-08-01` alone will be rejected.  ## 7. Correctness gotchas — read before writing any code  None of the following can be derived from the spec. Each one has produced a wrong report in practice.  1. **`type=ALL` on vendor events.** `GET /vendors/{id}/events` defaults to    `type=BOOKING`. Without `type=ALL`, request events ("Anfrage-Events") are    missing and the event-name column comes back silently empty. 2. **`status` defaults to `ACCEPTED`.** `GET /orders` silently omits    cancellations unless you pass `status=ALL`. Ask the customer whether they want    cancellations. Note the filter enum (`ACCEPTED, CANCELED, PENDING, DECLINED,    OPEN, ALL`) and the order payload's own `status` enum (which includes    `RESERVED`) are not identical. 3. **Ticket money is gross, and arrives as a string.** Mixing gross and net up    is the single most common error:     | Value | Unit | Gross or net |    |---|---|---|    | `tickets[].participants[].price_value` | euros, as a string (`"35.00"`) | **gross** → net = gross / (1 + vat/100) |  4. **Two independent cancellation levels.** Check both    `tickets[].status == "CANCELED"` and    `tickets[].participants[].status == "CANCELED"`. A live ticket can hold    cancelled participants. Missing either inflates participant counts and    revenue. 5. **`participants[].vat` is not reliable.** VAT-exempt products have been seen    returning 19 %. Let the customer configure an override rate, and log every    case where the API rate differs from the configured one so they can fix the    price category in bookingkit. 6. **The service date is not in the order payload.** Only `date_id` is (some    payloads use `event_date_id` — try both). Resolve it with `GET /dates/{id}`,    which also returns `event_id`. 7. **Resolving an event name needs a fallback chain**, in this order: the vendor    event map → `tickets[].event_title` if present → `GET /dates/{date_id}` to get    `event_id` → `GET /events/{event_id}`. Price-list events and request events    are why the chain exists. 8. **Payment method:** use `payments[].name` (the readable "PayPal", "Stripe"    the customer knows from the standard export), **not** `payment_method`, which    only holds a coarse type (`ThirdParty` / `Cash` / `MobileApp`). Payment values    can be negative — those are refunds. 9. **Combination tickets double-count.** If the customer sells "Kombitickets",    their revenue is already contained in the single events. Offer a keyword    exclusion list. 10. **Booking date vs service date.** `start_date`/`end_date` filter by when the     order was placed; `start_event_date`/`end_event_date` filter by when the     service happens. Accounting reports usually want the service date. **Ask —     do not assume.** Separately, `GET /dates` defaults to `available=true`, which     hides dates with no free slot; pass `available=false` when reporting. 11. **Pick one timezone deliberately.** Querying in UTC but formatting in local     time makes rows near a month boundary appear outside the requested range. 12. **Round consistently.** Round each money column to 2 decimals, then sum the     *rounded* values for totals, so the printed column visibly adds up.  ## 8. Writing the CSV  Default to German Excel, since most bookingkit vendors use it:  - Encoding **UTF-8 with BOM** (`utf-8-sig` in Python) — without the BOM, Excel   mangles umlauts. - Field separator **`;`**. - Decimal **comma** (`1234,56`), no thousands separator. - Dates as `DD.MM.YYYY`, timestamps as `DD.MM.YYYY HH:MM`. - Write money as plain numbers, never with a currency symbol, so the columns can   be summed.  Ask once whether they use German or English Excel; for English, use `,` as the separator and `.` as the decimal mark.  Keep the **column order fixed** and identical on every run. This is a contract with whoever imports the file — never reorder or insert a column in the middle without being asked. Write the file to `out/_.csv`.  ## 9. Verify before you hand it over  Print a short summary after every run:  - the resolved date range and which date basis was used (booking or service); - number of orders, tickets and participants; - total revenue (gross and net); - number of API requests made; - every warning collected (VAT mismatches, unresolved event names, orders   spanning several cost centres).  Then tell the customer explicitly: **compare these totals against the standard bookingkit export for the same month before using the report.** If they do not match, the difference is almost always one of §7.2 (missing cancellations), §7.4 (cancellation levels), §7.9 (combination tickets) or §7.3 (gross/net).  ## 10. Finish by making the next run trivial  Append to `AGENTS.md`: the vendor id, the date basis, the chosen columns in order, the filters and exclusions, the Excel locale, and anything you learned about this customer's data. Then tell them that from now on they only need to open this folder and say, for example:  > run the monthly order report for last month  and that they should come back to the help article only if they want to change what the report contains.
Hat dies deine Frage beantwortet?