openapi: 3.1.0
info:
  title: Kasseneck API
  version: "3.0.0"
  summary: Austrian fiscal cash register (RKSV) API for receipts, invoices and inventory, and for partners who sign up businesses.
  description: |
    The **Kasseneck API** is an HTTPS interface for Austrian fiscal cash registers
    (Registrierkassen) under the **RKSV** (Registrierkassensicherheitsverordnung, the
    Austrian regulation on fiscal cash registers; BAO § 131). It has four parts:

    - **Receipts** (tag *Receipts*): create signed receipts (Belege), cancel them, fetch
      them, send and download them as PDF, reports and payment terminals. Called by cash
      registers and POS systems with the API key of a business and the token of one of its
      cash registers.
    - **Invoices** (tag *Invoices*): issue invoices under § 11 UStG (not receipts) from a
      shop, accounting or industry software, with customers, credit notes, PDF and
      e-invoice XML. Called with the API key of the business, without a cash register.
    - **Inventory** (tag *Inventory*): read articles, locations, stock levels and stock
      movements, create and change articles, book goods receipts, transfers and losses,
      reserve stock for orders, group articles into variants (size, colour, …), and
      subscribe to webhooks for stock, article, reservation and variant changes, for
      example to keep an online shop in step with the shop floor.
      Called with the API key of the business; `/v3` only.
    - **Partner API** (tag *Partner*): for the servers of Kasseneck partners (software
      vendors, tax advisors, resellers) who sign up businesses, request their signature
      creation unit, create and activate their cash registers and receive webhooks.
      Called with a partner key (`pk_live_…` / `pk_test_…`).

    Some terms are Austrian legal terms; they stay German and are explained at first
    mention and in the glossary of the *Partner* section. Error *messages* are German;
    integrate against the stable `code`.

    Official packages: [`kasseneck_api`](https://pub.dev/packages/kasseneck_api) for
    Dart/Flutter on pub.dev and
    [`@kreiseck/kasseneck-api`](https://www.npmjs.com/package/@kreiseck/kasseneck-api) for
    JavaScript/TypeScript on npm.

    ## Response format
    Every JSON endpoint answers with HTTP 200 and an envelope:
    `{ "status": "success" | "error", "message": string, "data": object }`.
    Errors also come with HTTP 200 and `status: "error"`, their code in `code` and
    `data.code`. Every endpoint lists its own codes; the codes that any call with an API key
    can return (authentication and the `/v3` edge) are in `CommonErrorCode`.

    ## Receipts: authentication and environments
    - `Authorization: Bearer <api_key>`: the API key of the business (`kr_live_…`, or
      `kr_test_…` for the test environment).
    - `cashregister-token: <token>`: the token of the cash register (`cb_live_…` /
      `cb_test_…`).

    Live keys create real, legally valid RKSV receipts. Test keys work in a sandbox with a
    test signature (`production: false`): structurally valid, but **not valid RKSV
    receipts**.

    ## Versions
    **`/v3` is the current version of every endpoint** (`https://api.kasseneck.at/v3/<name>`):
    every parameter name, response field, enum value, error code and webhook payload is
    English. Human-readable texts (`message`, `note`, `nextSteps`, `issues`, `statusText`
    and similar) stay German, as do the BMF/FinanzOnline terms in the glossary and the
    fields of `financeWebService`, which follow the official BMF schema. Error codes under
    `/v3` are lowercase `snake_case`. Under `/v3` a German field name or value from `/v1`
    is rejected as `validation`, not silently translated.

    `/v1` (and `/v2`, which only receipts ever had) keep working unchanged, byte for byte,
    and are deprecated: every response of a public endpoint on `/v1` and `/v2` carries
    `Deprecation: @1790294400` (RFC 9745, Unix seconds for 2026-09-25T00:00:00Z),
    `Sunset: Thu, 30 Sep 2027 00:00:00 GMT` and
    `Link: <https://api.kasseneck.at/v3/<name>>; rel="successor-version"` (also exposed to
    browsers via `Access-Control-Expose-Headers`). `/v1` is switched off only once
    monitoring shows zero calls for at least 30 days; until then the `Sunset` date moves
    rather than the endpoint disappearing under you. Monitoring counts only calls through
    `api.kasseneck.at`, so always use that address. The official packages still call `/v1`
    for now and move to `/v3` in a later release.

    What changed from `/v1` to `/v3` is listed per part under *Migrating from v1* in the
    tags *Receipts*, *Invoices* and *Partner*. The deprecated shape is kept, unchanged, in
    [`openapi-v1.yaml`](openapi-v1.yaml).

    ## Links into the customer area
    Your software can open the Kasseneck customer area (`https://mein.kasseneck.at`) at a given place, for example the receipts of a day or one receipt. The user signs in if needed and lands on that place. The customer area is German, and so are its paths and link parameters. Unknown or invalid values are ignored: the page then opens as it normally would.

    - Receipts of a day: `https://mein.kasseneck.at/kasse/belege-berichte?ansicht=belege&datum=2026-12-31`.
    - Receipts of a period: `https://mein.kasseneck.at/kasse/belege-berichte?ansicht=belege&von=2026-12-01&bis=2026-12-31` (both days, `von` not after `bis`), or `zeitraum=woche` for this week.
    - One receipt: `https://mein.kasseneck.at/kasse/belege-berichte?beleg=KECK-1-ID-123` (the `receiptId` from createReceipt) opens it; the list behind it shows the day of the receipt. A receipt entered after an outage of the cash register (Nacherfassung of a handwritten receipt) carries the date it was entered, so link to the receipt, not to the day of the handwritten one.
    - Reports: `https://mein.kasseneck.at/kasse/belege-berichte?monat=2026-12` for a month, `jahr=2026` for a year, `datum=2026-12-30` for a day and its daily report.
    - Revenue overview: `https://mein.kasseneck.at/kasse/auswertung?zeitraum=letzter_monat` (`woche`, `monat`, `letzter_monat`, `jahr`), or `datum`, or `von` and `bis`.
    - Cash register: add `kasse=<cashregisterId>` to a `/kasse/...` link to show one cash register instead of all.
    - Invoices: `https://mein.kasseneck.at/rechnungen?rechnung=<invoiceId>` opens an invoice (a draft opens in the editor), `https://mein.kasseneck.at/rechnungen?neu=1` the form for a new one.
    - Income and expenses: `https://mein.kasseneck.at/einnahmen-ausgaben?neu=einnahme` (or `neu=ausgabe`) opens the form for a new entry, `https://mein.kasseneck.at/einnahmen-ausgaben?monat=2026-12` a month, `jahr=2026` a year.
    - Environment: add `umgebung=test` (or `live`) to any link to open the test environment that matches a `kr_test_` key. Without it the customer area opens in the environment last chosen in that browser.

    On the `/kasse/...` pages the address follows what the user picks, so a reload or a copied link shows the same view. The other links open once; their parameters then leave the address.
  contact:
    name: Kasseneck
    url: https://api.kasseneck.at
    email: hello@kasseneck.at
  license:
    name: Proprietary
    identifier: LicenseRef-Proprietary
servers:
  - url: https://api.kasseneck.at
    description: Production (live and test keys)
externalDocs:
  description: Official packages for Dart/Flutter (pub.dev) and JavaScript/TypeScript (npm)
  url: https://api.kasseneck.at/#pakete
tags:
  - name: Receipts
    description: |
      Create signed receipts, cancel them, fetch them, send and download them as PDF, fetch
      report data and PDFs, and drive payment terminals. Called with the API key of the
      business (`Authorization: Bearer kr_live_…` / `kr_test_…`) and, where stated, the
      `cashregister-token` of the cash register.

      ### Versions

      `/v3` is the current version (`https://api.kasseneck.at/v3/<name>`): English field
      names, values and error codes; `message` and the printed texts stay German. **Payments
      are a list:** `createReceipt` takes `payments[]` instead of one `paymentMethod`, and
      under `/v3` the list is required for every sale. `/v1` and `/v2` answer unchanged, byte
      for byte, and are deprecated with the `Deprecation`, `Sunset` and `Link` headers
      described above. The fields of `financeWebService` stay in the official BMF schema on
      every version; only the receipt that `create_start_receipt` returns is translated.

      ### Migrating from v1

      2026-09-26: receipts are available under `/v3`; `/v1` and `/v2` unchanged.

      Everything not listed here (endpoint names, the RKSV fields of a receipt such as
      `receiptId`, `counter`, `sig`, `qr`, `fullReceiptId`, and the Stripe and hobex fields)
      is the same under `/v3`.

      | v1 / v2 | v3 |
      |---|---|
      | `createReceipt` `paymentMethod` (with `creditCardProvider`, `cardPaymentId`, `cardPaymentData`) | `payments[]`, required for `standard` and `training` (`payments_required`); `paymentMethod` or a card field is `payment_method_not_supported` |
      | `createReceipt` with `receiptType: "cancellation"` | `cancelReceipt` (`createReceipt` answers `payments_not_allowed`) |
      | Response `taxnr` (also `metadata.taxnr` of `getReportV2`) | `taxNumber` |
      | Response `uid`, the VAT ID (also `metadata.uid` of `getReportV2`) | `vatId` |
      | `kopfId` (response and receipt) | `headerVersionId` |
      | Receipt `layoutRegeln` | `layoutRuleset` |
      | `pruefangaben` `{ karteRegistriertAm, kasseRegistriertAm }` (response and receipt) | `registrationInfo` `{ cardRegisteredAt, cashregisterRegisteredAt }` |
      | `testKasse` / `testSignatur` | `testCashregister` / `testSignature` |
      | `logo_skala` | `logo_scale` (the other snake_case fields such as `is_small_business`, `logo_url`, `thanks_message` stay) |
      | `layout.regelwerk`, `layout.lines[].ton`: `belegart` / `warnung` | `layout.ruleset`, `layout.lines[].tone`: `receipt_type` / `warning` |
      | `tip.sofortErhalten`, `items[].sofortErhalten` | `receivedImmediately` |
      | `cancelReceipt` `reason` and receipt `cancellationReason`: `fehleingabe` / `kunde_storniert` / `falsche_zahlart` / `doppelt_erfasst` / `sonstiges` | `input_error` / `customer_cancelled` / `wrong_payment_method` / `duplicate` / `other` |
      | `sendReceiptEmail` parameter `sprache` | `language` |
      | `sendReceiptEmail` `via`: `eigen` / `plattform` / `plattform-fallback` | `own` / `platform` / `platform_fallback` |
      | `payments[].providerPaymentId`, `payments[].providerData`, receipt `cardPaymentId` / `cardPaymentData` in responses | returned to the business itself (its API key or a register sign-in), never to a partner access (`provider` and `creditCardProvider` always stay) |
      | `downloadReport` file name `kasseneck monatsbericht_<cashregisterId>_<month-year>.pdf` (month name in German, e.g. `september-2026`) | `monthly-report_<cashregisterId>_<YYYY-MM>.pdf` |
      | `downloadDailyReport` file name `kasseneck tagesbericht_<cashregisterId>_<DD.MM.YYYY>.pdf` | `daily-report_<cashregisterId>_<YYYY-MM-DD>.pdf` |
      | `downloadReceipt`: `/v1/downloadReceipt?fullReceiptId=<token>` or `/v2/…` | `/v3/downloadReceipt?fullReceiptId=<token>`, token in the query only. Receipt links `https://beleg.kasseneck.at/<token>` keep working unchanged and are not deprecated |

      Error codes: German codes are English under `/v3`, and the uppercase payment and
      cancellation codes are lowercase: `beleg_nicht_gefunden` → `receipt_not_found`,
      `belegart_nicht_stornierbar` → `receipt_type_not_cancellable`, `trainingsbeleg` →
      `training_receipt`, `bereits_storniert` → `already_cancelled`, `position_ungueltig` →
      `invalid_line`, `menge_ueber_rest` → `quantity_exceeds_remaining`, `grund_unbekannt` →
      `unknown_reason`, `anmerkung_zu_lang` → `note_too_long`, `items_ungueltig` →
      `invalid_items`, `kasse_nicht_zugewiesen` → `cashregister_not_assigned`,
      `keine_berechtigung` → `not_permitted`, `nur_eigene_belege` → `own_receipts_only`,
      `kasse_unvollstaendig` → `cashregister_incomplete`, `storno_fehlgeschlagen` →
      `cancellation_failed`, `adresse_ungueltig` → `invalid_address`, `zu_oft` →
      `too_many_requests`, `versand_fehlgeschlagen` → `send_failed`; `STORNO_PAYMENTS_REQUIRED`,
      `STORNO_REFUND_EXCEEDS_PAYMENT`, `STORNO_REFUND_REFERENCE_REQUIRED`,
      `STORNO_REFUND_REFERENCE_UNKNOWN`, `STORNO_OUTCOME_UNKNOWN` →
      `cancellation_payments_required`, `cancellation_refund_exceeds_payment`,
      `cancellation_refund_reference_required`, `cancellation_refund_reference_unknown`,
      `cancellation_outcome_unknown`; every `PAYMENT…`, `PAYMENTS…` and `TIP…` code →
      the same words in lowercase (e.g. `PAYMENTS_SUM_MISMATCH` → `payments_sum_mismatch`).
      The codes of the receipt endpoints, with the endpoints that send them, are
      `ReceiptErrorCode`; the codes of authentication and of the `/v3` edge, which every call
      can return, are `CommonErrorCode`. [`fehlercodes.json`](fehlercodes.json) maps each
      `/v1` code to its `/v3` code (map `v3`).

      ### Deposit (Pfand) and empties

      A business that sells deposit goods (single-use deposit of 0.25 EUR, reusable bottles
      and crates) switches "Pfand & Leergut" on in the customer area (mein.kasseneck.at). There it
      also sets up the deposit types; **setting them up stays there**, the API only reads them.

      1. Call `listDepositTypes` (API key only, no `cashregister-token`) once and whenever the
         business may have changed its deposit types. `data.deposit` is `null` when deposit is
         switched off. That is not an error: send no `deposit` or `deposit_return` lines then
         (`deposit_not_enabled`); `autoDeposits` and `onPremises` alone are ignored by the server. Otherwise it lists the active deposit types
         with `id`, `kind` (`single_use`, `reusable`), `name`, `amounts` (amount in cents per
         valid-from day) and `returnRate`. The single-use type has the fixed `id` `einweg`.
      2. **Sell deposit.** Either let the server derive it: send `autoDeposits: true` and give
         each article its deposit rule (`deposits` of the article, see `createArticle`); the server
         inserts the deposit lines right behind the line that triggers them, with amount, VAT rate
         and quantity set by itself. A line of your own for a main line the server deposits
         itself (`autoDeposits` set and the article or its group has an effective deposit rule) is
         `deposit_set_by_server`. Own lines are allowed for every main line the server does not
         deposit itself (no `autoDeposits`, or an article without a rule, or goods without
         `articleId`): `{ "kind": "deposit", "depositTypeId", "depositFor": <index of the main
         line> }` plus `name`, `quantity` (a multiple of the quantity of the main line, whole
         numbers only: `invalid_deposit_quantity`), `unitPriceCents` and `vatRate`; the server
         replaces amount and rate by those of the deposit type on the day of the receipt. A
         `deposit` line with an `articleId` is `invalid_deposit`. For plain REST calls `name`,
         `unitPriceCents` and `vatRate` are optional on `deposit` and `deposit_return` lines (the
         server sets them); the npm package requires them in its item shape.
      3. `onPremises: true` marks goods consumed on the premises (the receipt shows it only if it carries a deposit or empties line); only the single-use deposit
         the server derives is left out then. Lines you send yourself are never dropped; leave
         them out. Without it the default of the cash register applies.
      4. **Take empties back.** `{ "kind": "deposit_return", "depositTypeId", "quantity" }` plus
         `name`; the server sets the negative amount. `quantity` is a whole number from 1 to 1000
         (else `invalid_deposit`); optional `codes` `{ "<gtin>": pieces }` has at most 50 keys, valid GTINs, and its
         sum must equal `quantity`. The cash register must take empties back
         (`deposit_return_not_offered` otherwise), and reusable empties need a deposit type that was
         issued before (`deposit_type_not_issued`). Empties are either offset against a purchase
         (the total stays positive) or paid out: a receipt with empties and a negative total
         has exactly one negative `cash` payment without `tenderedCents` (else `payment_tendered_invalid`), at most the sum of the empties (more is `payments_due_negative`), and no tip.
      5. Every receipt with deposit or empties is signed like any other. Amounts are whole cents
         and are part of the receipt total, so `payments[]` must add up to goods plus deposit
         minus empties (`payments_sum_mismatch`). Cancel the main line with `cancelReceipt`;
         its deposit goes with it (`deposit_follows_item` for a deposit line on its own).

      The examples `sale_explicit_deposit`, `sale_auto_deposits`, `on_premises`,
      `empties_payout` and `empties_offset` of `createReceipt` show each case. Codes:
      `deposit_not_enabled`, `deposit_type_not_found`, `deposit_type_not_issued`,
      `deposit_set_by_server`, `invalid_deposit_quantity`, `deposit_return_not_offered`,
      `invalid_deposit`, `invalid_item_kind`, `deposit_follows_item` (see `ReceiptErrorCode`).

      ### Deposit on invoices

      Invoices carry deposit like receipts do, as lines of their own. Everything below needs
      "Pfand & Leergut" switched on for the account; without it a `deposit` on an invoice line is
      `deposit_not_enabled`, and an invoice without `deposit` lines is issued exactly as before.

      - **The server derives it.** A line with an `articleId` whose article (or article group)
        has a deposit rule gets its deposit lines right behind it when the invoice is issued, with
        quantity, amount and VAT rate set by the server. Nothing to send: no `autoDeposits`
        on invoices. A line of your own for such a main line is `deposit_set_by_server`.
      - **Lines of your own** for goods without `articleId`: a line with
        `deposit: { depositTypeId, depositFor, gtin?, ownFilling? }` is a deposit line for the line
        `depositFor` (index in `items`, 0 to 499). `quantity` is the quantity of the main line times
        the pieces per unit, whole numbers only (`invalid_deposit_quantity`). The server replaces
        amount and VAT rate by those of the deposit type on the day of the supply and never
        discounts a deposit line; `description`, `unitPriceCents` and `vatRate` are still required
        by the schema, but their values do not matter. Single-use deposit (`einweg`) carries
        `gtin` of the container (8 to 14 digits) and `ownFilling: true` if you fill it yourself
        (needed for the EWP report below).
      - **Amount and price mode.** The amount of a deposit type is a face value. It counts as a
        price in the price mode of the invoice: net on a net invoice (VAT comes on top), gross on
        a gross invoice. Single-use deposit is always 0.25 EUR at 0 % and not subject to VAT: it
        gets a row of its own in the VAT table and a category `E` line in the e-invoice (reason:
        "Pfand Einweg, nicht steuerbar (UStR Rz 8)"). Reusable deposit carries the VAT rate of
        its main line.
      - **No single-use deposit outside Austria.** If the recipient's country is not `AT`, or the
        tax scheme is `intraCommunitySupply` or an export, the server derives no single-use
        deposit, and an explicit single-use (`einweg`) deposit line for such a recipient is
        `invalid_deposit`. The foreign count in the EWP report applies only to lines with own
        filling and a `gtin` (otherwise `foreign_not_reportable`). Reusable deposit follows the
        main line in every tax scheme.
      - **Credit notes.** `createCreditNote` takes the same `deposit` lines and derives deposit for
        lines with `articleId` from today's master data. Unlike the customer area, a partial credit
        note through the API has no link from its lines to the lines of the invoice: deposit is
        never copied from the invoice. Only `cancelInvoice` (full cancellation) copies the deposit
        lines of the invoice unchanged.
      - `getInvoice` shows `deposit` (`depositTypeId`, `depositKind` `single_use` or `reusable`,
        `depositFor`, `gtin`, `ownFilling`) on every deposit line and nowhere else.

      The examples `issue_invoice_auto_deposit` and `issue_invoice_explicit_deposit` of
      `issueInvoice` and `credit_note_deposit` of `createCreditNote` show each case. Codes:
      `deposit_not_enabled`, `deposit_type_not_found`, `deposit_set_by_server`,
      `invalid_deposit_quantity`, `invalid_deposit` (see `InvoiceErrorCode`; `index` names the line).

      ### EWP monthly report (fillers)

      A business that fills its own single-use containers reports the quantity per GTIN to the
      deposit system (EWP, Einwegpfand-Meldung) by the 5th of the following month. The report
      is for accounts with the filler role (`filler_role_required` otherwise), needs
      "Pfand & Leergut" switched on, and is called with the API key only (no `cashregister-token`,
      no register user: `register_user_not_allowed`). The test key reports the test environment
      (`test: true`, file name starts with `TEST-`).

      1. **`getEwpReport`** with `month` (`YYYY-MM`, from `2025-01`, not after the current month in
         Vienna) returns `lines[]`: one per GTIN registered for the business (also with 0 pieces),
         with `domestic` and `foreign` pieces and `sources` (`register`, `invoices`,
         `deliveryNotes`, `extra`). Counted are only single-use deposit lines with `ownFilling: true`
         and a `gtin`: receipts by Vienna day, invoices by invoice date (a credit note subtracts, a
         cancelled invoice still counts), delivery notes by the day they were issued (a cancellation
         subtracts in the month it happens). Lines that came from a delivery note count once, at the
         delivery note. The current month is `provisional`.
      2. **Foreign quantity.** A line to a recipient outside Austria counts as `foreign`, but only
         for international GTINs and only for the countries the deposit system lists as relevant
         (EU without Austria, Switzerland, Liechtenstein, Norway and the Western Balkans, among
         others). Everything else is a warning `foreign_not_reportable`, not part of the file.
      3. **`warnings[]`** never block anything: `gtin_not_registered` (a GTIN sold with
         `ownFilling` that is not registered; its quantity is not in `lines` and not in the file),
         `foreign_not_reportable`, `master_data_missing` (`fields`), `negative_quantity`,
         `invalid_posting`.
      4. **Returns are a negative quantity.** Containers that come back, or were found again, go
         in as an extra quantity with a negative number (reason `return` or `stocktake`).
         Consumption of your own, samples, donations and the like are extra quantities with a
         positive number and their reason. **`setEwpExtraQuantities`** with `month` and
         `extraQuantities` replaces all extra quantities of the month (at most 500; an empty list
         clears them; entries that stay the same keep `at` and `by`) and returns the recalculated
         report. Quantities are whole pieces from -1,000,000 to 1,000,000; `text` has at most 200
         characters. On receipts, own containers served on the premises (`onPremises`) count as
         domestic automatically; on invoices and hand receipts they do not, so report them as an
         extra quantity.
      5. **The file.** `getEwpReport` with `format: "csv"` returns `{ csv, filename, contentType }`
         instead of the report: UTF-8 without BOM, columns separated by `;`, lines by CRLF, one
         line per registered GTIN, in the layout of the sample file of the deposit system:
         `Mont_of_reference` (sic), `Barcode_type`, `Unit_barcode`, `Product_name`,
         `Product_origin`, `Volume_inland_standard`, `Volume_ausland_standard`,
         `Volume_inland_no_submission` and `Volume_ausland_no_submission` (both empty),
         `Reported_date` (`DD.MM.YYYY`, the day of the call), `Deposit_fee`, `Producer_fee`,
         `Eco_impact` and `int_barcode_usage`. The codes in the file (`Austria`, `International`,
         `D1`, `PF1`, `EFP1`, `PFI1`, ...) are the codes of the deposit system and stay as they
         are. The CSV of a closed month counts as downloaded (`downloadedAt`); a month in progress
         never does.

      The examples `get_ewp_report`, `get_ewp_report_csv` and `set_ewp_extra_quantities` show the
      calls. Errors: `filler_role_required`, `deposit_not_enabled`, `invalid_deposit` (month,
      format or extra quantities invalid), `register_user_not_allowed`.
  - name: Invoices
    description: |
      Issue invoices under § 11 UStG (Umsatzsteuergesetz, the Austrian VAT act), **not
      receipts**, from a shop, accounting or industry software. An invoice is **fixed** after
      the call: it carries its sequential number, cannot be changed and can only be corrected
      by a credit note.

      | | |
      |---|---|
      | Base URL | `https://api.kasseneck.at/v3/<endpoint>` |
      | Method | always `POST`, body `{ "params": { … } }` |
      | Authentication | `Authorization: Bearer kr_live_…` or `kr_test_…` (API key of the business), no `cashregister-token`. The module `rechnung` must be active (`module_inactive`). |
      | Live | only after Kasseneck released the invoice API for the account (`invoice_api_not_enabled`); the test environment needs no release |
      | Amounts | whole cents (`unitPriceCents: 5000` = 50.00 €); `unitPriceMicros` for prices below one cent, only once enabled |
      | Dates | `YYYY-MM-DD`, calendar day in Vienna; invoice date, number, status and totals are set by the server |
      | Errors | `code` from `InvoiceErrorCode`; `message` is German |

      Totals are computed per VAT rate, rounded half up, then summed. With `priceMode: gross`
      the gross amount is the agreed price and net and VAT are derived from it. Before the
      first invoice call `getInvoiceSetupStatus`. Every call that creates a numbered document
      (`issueInvoice`, `cancelInvoice`, `createCreditNote`) and `recordInvoicePayment` need
      an `idempotencyKey`.

      ### Versions

      `/v3` is the current version: every parameter name, response field, enum value and
      error code is English; `message`, `data.issues`, the `message` of a `notice` and
      everything printed stay German. `/v1` answers unchanged, byte for byte, and is
      deprecated with the `Deprecation`, `Sunset` and `Link` headers described above. Under
      `/v3` a `/v1` value such as `taxScheme: "igLieferung"` or `docType: "RE"` is rejected
      as `validation`.

      ### Migrating from v1

      2026-09-26: the invoice API is available under `/v3`; `/v1` unchanged.

      Everything not listed here (endpoint names, parameters, response fields, error codes) is
      the same under `/v3`.

      | v1 | v3 |
      |---|---|
      | `docType`: `RE` / `GU` (response field of every invoice view, parameter of `listInvoices`) | `invoice` / `credit_note` |
      | `taxScheme`: `igLieferung` (parameter of `issueInvoice`, response field, `data.expected` / `data.given` of `tax_scheme_mismatch`) | `intraCommunitySupply`; the other tax schemes are unchanged |
      | `writeOffReasonCode`: `uneinbringlich` / `verjaehrt` / `verzicht` / `bestritten` / `storniert_extern` / `andere` | `uncollectible` / `time_barred` / `waived` / `disputed` / `settled_externally` / `other` |
      | `einvoice.missing[]`, and `data.missing[]` of `einvoice_incomplete` / `invoice_requirements_missing`: `Name`, `Straße`, `PLZ`, `Ort`, `Land`, `UID-Nummer`, `Auftragsreferenz`, `Auftragsreferenz (Format)` | `name`, `street`, `zip`, `city`, `country`, `vat_id`, `order_reference`, `order_reference_format` |
      | `getInvoiceXml` `filename`: `rechnung-<number>.xml` | `invoice-<number>.xml` |

      A message that names a tax scheme names it the `/v3` way, and a `validation` error for
      an unknown `taxScheme` or `docType` lists the English values.
  - name: Inventory
    description: |
      Read and write the inventory of a business (articles, variants, locations, stock
      levels, stock movements, reservations, stocktakes) and get told about every change by webhook. Typical use: an
      online shop shows the stock of the shop floor, reserves the goods of an order, and the
      cash register sees what the shop sold. Selling goes through invoices (`issueInvoice`
      with `articleId`, `stockLocationId` and, for a reserved order, `reservationId`) or
      receipts; there is no separate "sell" call.

      | | |
      |---|---|
      | Base URL | `https://api.kasseneck.at/v3/<endpoint>`, **`/v3` only** (there is no `/v1` path for these endpoints) |
      | Method | always `POST`, body `{ "params": { … } }` |
      | Authentication | `Authorization: Bearer kr_live_…` or `kr_test_…` (API key of the business), no `cashregister-token`. The inventory module (Lager) must be active for the account (`module_inactive`). A key of a cash register user (device and PIN) is answered with `register_user_not_allowed`. |
      | Live | like every own software: only after Kasseneck released the API for the account (`api_not_approved`); `kr_test_…` always works and reads the test environment |
      | Quantities | integers in **thousandths** of the base unit: `1000` = 1 piece (or 1 kg, 1 l), `250` = 0.25 |
      | Money | integers: `…Cents` in cents, `purchasePriceMicros` and `averageCostMicros` in micro-euros (`1000000` = 1.00 €) |
      | Times | ISO 8601 in UTC (`2026-10-06T08:15:00.000Z`); calendar days (`viennaDay`) as `YYYY-MM-DD`, day in Vienna |
      | Errors | `code` from `InventoryErrorCode`; `message` is German |
      | Writing | only with „Lager-API schreiben“ enabled for the account, and always with `idempotencyKey` (see *Writing* below) |

      **Purchase prices and stock values** (`purchasePriceMicros`, `values[]`, `valueCents`,
      `valueDeltaCents`, `consumedValueCents`, the values of the `receiveGoods` preview) are
      only present when Kasseneck has enabled „Einkaufswerte per API“ (purchase values via
      the API) for the account; without it the fields are missing altogether (not `null`).
      This also holds in the test environment. Webhook payloads never carry them. Writing
      `purchasePriceMicros` of an article needs the same switch (else
      `inventory_api_not_enabled`); prices of a goods receipt may always be sent.

      ### Writing

      Creating and changing articles (`createArticle`, `updateArticle`,
      `deactivateArticle`), variants (`createVariantGroup`, `updateVariantGroup`,
      `addVariant`), stock bookings (`receiveGoods`, `transferStock`, `recordStockLoss`,
      `changeStockCondition`, `reverseStockMovement`) and reservations
      (`createReservation`, `extendReservation`, `releaseReservation`) and stocktakes
      (`createStocktake`, `recordStocktakeCount`, `voidStocktakeCount`, `reviewStocktake`,
      `recountStocktake`, `closeStocktake`, `cancelStocktake`) need the switch
      „Lager-API schreiben“ (writing via the inventory API), which Kasseneck enables per
      account on request; without it they answer `inventory_api_not_enabled`. A `kr_test_…`
      key may always write, into the test environment. Reading, `getReservation`,
      `listReservations`, `getVariantGroup`, `listVariantGroups`, `listStocktakes`,
      `getStocktake`, `listStocktakeItems`, `listStocktakeCounts`, `getStocktakePdf` and
      managing webhooks need no switch.

      Every writing call needs `idempotencyKey` (1–120 characters, your own ID of the
      action, e.g. the order number): a repeat with the same key and the same parameters
      returns the stored answer byte for byte and books nothing twice; the same key with
      other parameters is `idempotency_conflict`. After a timeout or a `server_error`,
      repeat with the **same** key. Keys are separate per endpoint.

      Bookings are written in one transaction with the source `api` (`source.type: "api"`
      in `listStockMovements`, filter `source: api`). Transfers, losses and condition
      changes never overdraw the stock (`exceeds_stock`, nothing is booked). A booking
      answers `{ operationId, movementIds, lotIds, warnings }`; `warnings` are notices
      (`InventoryWarningCode`), not errors: the booking went through.

      ### Reservations

      A reservation holds stock for an order between checkout and invoice:

      1. `createReservation` with the lines of the order and your order number as
         `reference`. All or nothing: if `available` does not cover a line, nothing is
         reserved (`insufficient_available` with `data.details`). `reserved` grows,
         `available` shrinks, and both the panel and the cash register see it.
      2. When the order is paid, `issueInvoice` with `stockLocationId` and, on each line,
         `articleId` and `reservationId`. The invoice is checked right away
         (`reservation_not_found`, `reservation_not_active`, `reservation_mismatch` for
         another article or location; an expired reservation is no error but the notice
         `reservation_expired`, and the line is sold like one without reservation). When the
         invoice is booked in the stock (seconds later), the reservation is redeemed: the
         reserved quantity becomes the sale, a smaller invoiced quantity gives the rest
         back, a larger one is sold all the same. `reservation.redeemed` follows.
      3. If the order is cancelled, `releaseReservation` (all or per line). Otherwise the
         reservation expires at `expiresAt` (`expiresInMinutes` 5–43 200, default from the
         account, else 7 days) and sends `reservation.expired`. `extendReservation` moves
         the expiry while it is active.

      Credit notes never touch a reservation. With the inventory module switched off, an
      invoice books no stock and its reservations stay until they expire.

      ### Variants

      A variant group bundles articles that differ only in up to three attributes, e.g. an
      apron („Schürze“) in sizes and colours. **Every variant is an ordinary article** with
      `variantGroupId` and `variantAttributes` (e.g. `{ "farbe": "rot", "groesse": "M" }`):
      it has its own code, price, `externalIds` and stock, is booked, reserved and sold like
      any other article, and is a tile of its own at the cash register. `getArticle`,
      `lookupArticleByCode` and the `article.*` webhooks show it as usual;
      `listArticles` with `variantGroupId` lists the variants of one group.

      A typical shop flow:

      1. `createVariantGroup` with the attributes in the order you want them shown,
         `defaults` for what all variants share (e.g.
         `{ "unitPriceCents": 2490, "vatRate": 20, "stockTracked": true }`; without
         `stockTracked: true` the variants keep no stock, as with `createArticle`) and
         `variants[]` with **only the combinations you carry**, each with its own
         `externalIds` (e.g. `{ "shop": "3001-M-rot" }`). `createMatrix: true` instead
         creates every combination. The answer is the group with
         `variants[{ articleId, variantAttributes }]`, not the full articles: read them with
         `listArticles { variantGroupId }`, or find each one by its `externalIds` with
         `lookupArticleByCode`.
      2. A new size: `updateVariantGroup` with `addAttributeValues: { "groesse": ["XL"] }`,
         then `addVariant` for each new combination you carry. Values the group already has
         are skipped silently (also in other upper/lower case), so you may always send all
         your values; without anything new the group is not written and no event is sent.
      3. A variant you no longer sell: `deactivateArticle`; its combination becomes free and
         can be created again with `addVariant`. The whole group: `updateVariantGroup` with
         `active: false` deactivates the group and every variant in it (their codes and
         `externalIds` become free). There is no way back.

      `defaults` fill only the fields a variant does not send, and only when it is created;
      a later change of the group's `name` or `defaults` leaves existing variants as they
      are (change them with `updateArticle`). A variant's `name` defaults to
      „<group> <value 1> <value 2> …“ in the order of the attributes (e.g. „Schürze M rot“).
      `variantGroupId` and `variantAttributes` are set only by `createVariantGroup` and
      `addVariant`: `createArticle` and `updateArticle` reject them (`validation`), and an
      existing article cannot be moved into a group.

      **Order of the attributes.** `variantAttributes` always come with their keys sorted
      alphabetically (articles, groups and webhooks alike), whatever order you sent; the
      order of the attributes is the order of `attributes` in the group. Build labels such
      as „M · rot“ from `attributes`, not from the order of the keys.

      **Limits.** 1–3 attributes per group; `key` matches `^[a-z0-9_]{1,32}$` and is unique
      (keys of the form `__…__` are reserved), `label` 1–40 characters, 1–30 values per
      attribute of 1–30 characters each (trimmed, unique ignoring case; values can be added,
      never removed; attributes cannot be added later). Values are compared exactly, after
      Unicode NFC normalisation. `createMatrix` at most 100 combinations, `variants[]` at
      most 100 per call, at most 250 active variants per group (`variant_limit`). Each call
      is one transaction of at most 490 writes (each variant with its code and each of its
      `externalIds` counts); above that it is `too_many_positions` with `data.field` and
      nothing is written. A matrix of 100 always fits, 100 variants fit with up to 187
      `externalIds` together; create the rest with `addVariant`.

      **Repeating.** The three writing variant calls need `idempotencyKey` like every
      writing call. After a timeout, a `server_error`, or when an official package reports
      `outcome: 'unknown'`, send the **same** request with the **same** key again: it
      returns the stored answer or does the work exactly once. A new key would create a
      second group (`createVariantGroup`) or end in `variant_already_exists`
      (`addVariant`). Repeating `updateVariantGroup { active: false }` also finishes a
      deactivation that was interrupted.

      **Events.** `variant_group.created` when a group is created, `variant_group.updated`
      when something the API shows changed (name, defaults, values, `active`, the list of
      variants); the payload is the group as `getVariantGroup` returns it. `addVariant`
      sends `article.created` and `variant_group.updated`; deactivating a group sends one
      `variant_group.updated` and one `article.deactivated` per variant.

      ### Stocktake

      A stocktake (Inventur) counts the goods at **one** location and books the differences
      once, with a record (PDF) that cannot change afterwards. At most one open stocktake per
      location (`stocktake_location_busy`). The flow:

      1. `createStocktake` with location, scope (`all`, `groups` or `articles`) and type
         (`key_date` with `keyDate`, or `perpetual`). The items are frozen at this moment
         (at most 5000); status `counting`.
      2. Count with `recordStocktakeCount`, from as many devices as you like (also the
         Kasseneck cash register and the panel). Counts of the same item add up; `quantity: 0`
         is „counted empty“. `voidStocktakeCount` voids a count with a reason.
      3. `reviewStocktake`: counting stops and the expected quantities are computed in the
         background (`review.complete`). The items now carry `expectedQuantity`,
         `differenceQuantity` and `needsCheck` with `checkReasons`.
      4. Optionally `recountStocktake` for items that look wrong, count them again and call
         `reviewStocktake` once more.
      5. `closeStocktake` books every difference as a movement of type `stocktake`
         (`stock.changed` with `cause: stocktake` follows) and writes the record:
         `getStocktakePdf`. `cancelStocktake` instead ends it without booking.

      **Blind counting.** Before `review` nothing about the book stock leaves the server: no
      expected quantity, no difference, no value, not in errors, not in webhooks (there is no
      `stocktake.*` event). With `blind: false` the counters see today's book stock
      (`bookStockNow`) while counting, never the expected quantity at the reference time. From
      `review` on the API sees expected quantities and differences; values only with purchase
      values enabled.

      **Reference time.** The expected quantity of an item is the book stock **at the time of
      its last active count** (`referenceTime`, server time), not at the time of the review:
      sales after that moment do not count as missing goods. A sale whose receipt time lies
      before the reference time but is booked after it (a cash register that was offline, a
      receipt booked a few seconds later) still counts in, for up to 3 days. Example,
      Bäckerei Kornblum: 40 Kornspitz in the book, a sale of 3 at 10:00:00 is booked at
      10:00:03, the count at 10:00:02 finds 37 → expected 37, difference 0. If the 3 are only
      sold at 10:00:05, after the count, the 37 counted mean that 3 are missing → expected
      40, difference −3; the closing books −3 on today's stock (37 after the sale) → 34.
      Every piece is taken off exactly once.
      Items with stock movements between their first and last count, or (with `key_date`)
      a count more than 10 days from the key date, are marked `needsCheck`.

      **Closing in parts.** `closeStocktake` answers at once with status `closing`. The
      differences are booked in the background in parts of at most 40 items
      (`closing.parts`, `closing.bookedParts`), each part is one operation
      `inventur_<stocktakeId>_<part>` in `listStockMovements`. They apply to **today's**
      stock: sales after the count stay. Then totals, inventory values, the seal status of
      the stock ledger, the checksum and both PDFs are written, and the status turns
      `closed` (`closing.completedAt`). Poll `getStocktake` (every few seconds is enough). A
      part that cannot be booked as planned (a serial number sold in the meantime) is planned
      once more from today's stock; what is still impossible stays as `notBooked` on the item
      and in the record, never silently. Calling `closeStocktake` again during `closing` is
      safe and restarts the background work. Items never counted are booked only with
      `uncountedAsZero: true`; items ordered for recount and not counted again never.

      **Inventory list.** After the closing each item carries `inventory`: the quantity (with
      `key_date` and a closing after the key date carried forward or back to the end of the
      key date, `inventoryAsOf: key_date`; else at the count, `count_date`), the book value
      per unit after the closing (`unitValueMicros`, by the valuation method of the account)
      and the total (`valueCents`).

      ### Pages and synchronisation

      Lists take `limit` (1–200, default 50) and `cursor` (opaque; pass the `nextCursor` of
      the previous answer). `nextCursor: null` means the end. A page can hold fewer than
      `limit` entries although more follow (filters are applied while reading): always
      continue until `nextCursor` is `null`. A damaged cursor is `invalid_cursor`.
      `listStocktakeItems` and `listStocktakeCounts` page in a fixed order (items by ID,
      counts newest first).

      `listArticles`, `listVariantGroups` and `listStocktakes` with `updatedSince` and
      `listStock` with `changedSince` are sorted by `updatedAt` ascending and the bound is **inclusive**
      (`>=`): repeat the call with the
      `updatedAt` of the last entry you saw and nothing is lost, at the price of seeing that
      entry again. That makes them the safety net next to the webhooks: after a downtime of
      your server, catch up from your last known `updatedAt`.

      ### Rate limit

      About 20 calls per second per account, short bursts up to 40. Above that the answer is
      `rate_limited` with `data.retryAfterSec` and the header `Retry-After` (seconds); wait
      that long and repeat. The limit protects against overload and is not an exact quota.
      `sendWebhookTest` has its own daily limit (see *Webhooks* below).

      ### Webhooks

      Register an HTTPS address with `createWebhook` (at most 5 per account) and choose
      events; Kasseneck then sends a `POST` with a JSON body for every event (see the
      *Webhooks* section of this reference). Every account can manage webhooks, no module is
      needed for that. An event can only be subscribed while its module is active:
      `receipt.*` needs the cash register module (Registrierkasse), `stock.*`, `article.*`,
      `reservation.*` and `variant_group.*` the inventory module (Lager). Otherwise
      `createWebhook`/`updateWebhook` answer `webhook_event_not_available` (field `events`). If
      a module ends later, the webhook stays, but its events no longer fire.

      | Event | When | `data` |
      |---|---|---|
      | `stock.changed` | the stock of an article at a location changed (sale, invoice, goods receipt, transfer, …, also from the shop floor) | the stock level now, plus `cause` and `movementId` |
      | `stock.below_minimum` | `available` **falls** below the minimum stock set for the location (once per crossing; a reservation can trigger it) | `articleId`, `locationId`, `available`, `minStock` |
      | `article.created` | an article was created (panel, API, import) | the article as `getArticle` returns it, without purchase prices |
      | `article.updated` | a field of the article that the API shows changed (stock bookings alone do not count) | as above |
      | `article.deactivated` | an article was deactivated | as above |
      | `reservation.expired` | a reservation reached `expiresAt` with something still open | the reservation as `getReservation` returns it |
      | `reservation.released` | every `releaseReservation` that changes something, also a partial one | the reservation, with the status after it |
      | `reservation.redeemed` | an invoice redeemed a reservation, also partly | the reservation, with the status after it |
      | `variant_group.created` | a variant group was created (`createVariantGroup`) | the group as `getVariantGroup` returns it |
      | `variant_group.updated` | a field of the group that the API shows changed: name, defaults, new values, `active`, the list of variants (also by `addVariant` and by deactivating a variant) | as above |
      | `receipt.created` | every new signed receipt of any kind: sale, cancellation, start, zero, monthly, annual, final and training receipt; from the web register, the app and the API | `receipt` exactly as in `listReceipts` with `view: full` |
      | `receipt.cancelled` | in addition to `receipt.created` when the new receipt is a cancellation | `receipt`, plus `cancellationOf`, `cancelledItems` and `refunds` |

      **State, not change, and `sequence`.** `stock.changed` carries the complete stock level
      of one article at one location, not a delta. `sequence` grows with every write of that
      stock level; store it and only overwrite your state when the new `sequence` is
      **greater** than the stored one. Then duplicates, retries and deliveries in the wrong
      order never lead to a wrong stock.

      **Coalescing.** `stock.changed` comes at most once per article and location within
      about 10 seconds and then carries the newest state; five sales in a row are one
      event. `cause` names the last movement (`sale`, `invoice`, `credit_note`,
      `cancellation`, `goods_receipt`, `transfer`, `loss`, `condition`, `reversal`,
      `reservation`, `stocktake`, `takeover` (opening stock taken over, also by an import),
      or `other`, then with `movementId: null`).

      **Minimum stock.** `stock.below_minimum` uses the minimum stock set for the location
      (`minStockByLocation` of the article) and measures `available` (on hand minus
      reserved), the same rule as the warning `below_minimum` of a booking, the stock
      warnings in the panel and `listStock` with `belowMinimum: true`. A reservation alone
      can therefore trigger it, and a release or expiry can end it. The legacy field
      `minStock` of the article triggers nothing; `minStock` in the payload is exactly the
      threshold of the location. It fires right away and again only after `available` was
      back at or above the threshold.

      **Envelope, headers, signature.** Every delivery is
      `{ id, type, createdAt, accountId, test?, data }` (`createdAt` in Unix milliseconds,
      when the event occurred). Headers, signature and retries are the same as for partner
      webhooks: `X-Kasseneck-Event: <type>`, `X-Kasseneck-Delivery: <deliveryId>` (the same
      on every retry; the event ID is `id` in the body),
      `X-Kasseneck-Signature: t=<unix seconds>,v1=<hex>`,
      `User-Agent: Kasseneck-Webhooks/1`. You get the secret (`whsec_…`) once, from
      `createWebhook` or `rotateWebhookSecret`. The signature is
      `HMAC-SHA256(secret, "<t>.<body>")` as hex, computed over the **raw** body, byte for
      byte; reject timestamps that differ from your clock by more than 5 minutes. Code for
      Node.js and Python is in the *Partner* section, part *Webhooks*; it works unchanged.

      Answer with a 2xx status within 10 seconds; redirects count as a failure. Otherwise
      Kasseneck retries after about 1 minute, 5 minutes, 30 minutes, 2 hours and 12 hours
      (six attempts in total), then the delivery is `failed`. Deactivating or deleting a
      webhook drops its pending deliveries (`dropped`). Deliveries are kept for 90 days
      (`listWebhookDeliveries`). An event can arrive more than once and in another order
      than it occurred: deduplicate on `id`. `stock.changed` carries `sequence` for the
      order; for `article.*` and `variant_group.updated` keep only the payload with the
      newest `updatedAt` per article or group and ignore older ones.

      **Receipts without gaps.** Every cash register numbers its receipts consecutively
      (`counter`, in `receiptId` as `…-ID-<counter>`). If a number is missing on your side, fetch
      the period with `listReceipts` (`view: full`) for that register; the entries have the same
      form as `receipt` in the webhook. A webhook never slows down or blocks a sale: the receipt
      is stored and signed before the event exists. A receipt whose body would exceed about
      700 KiB goes out without `items`, with `truncated: true` and `hint`; `getReceipt` returns
      it in full.

      **Test deliveries** (`sendWebhookTest`) send the chosen event with recognisably
      invented values and carry `test: true` in the envelope; real events never do. At most
      20 test deliveries per account (live and test environment count separately) and
      calendar day in Vienna; after that `rate_limited` with `retryAfterSec` until midnight
      in Vienna and the header `Retry-After`.

      A `kr_test_…` key manages the webhooks of the test environment, which receive the
      events of the test environment only.
  - name: Signature cards
    description: |
      Order an activated signature card (a.sign RK) for **your own account** from the Kasseneck card pool. Kasseneck activates
      an empty card in its signing server for the tax number of the account (UID, else tax number, else GLN - never typed),
      then by default verifies it, registers it with FinanzOnline, assigns it to the cash registers you name, signs a zero
      receipt per register and, if asked, decommissions the old card. At most one open order per account and three per day.
      Partners keep ordering for their businesses with `requestCustomerSignature`.

      | | |
      |---|---|
      | Base URL | `https://api.kasseneck.at/v3/<endpoint>`, **`/v3` only** |
      | Errors | `validation` (also `account` / `account.email` when the account or its mail address is missing), `not_permitted`, `order_open` (with `data.orderId`), `card_pool_empty`, `card_pool_unavailable`, `tax_number_missing`, `test_environment`, `invalid_selection`, `order_not_found`, `too_many_orders`, `server_error` (see `/fehlercodes.json`, list `kartenbestellung`) |
  - name: Card terminals
    description: |
      Shared access to **Genius Pay** (the card terminal app on Android and iOS) for the payment apps of
      **your own business**. Kasseneck keeps the Genius Pay accounts and terminal IDs (TIDs) of the business and hands
      each device the login of one free TID; when Genius Pay asks for the one-time code, Kasseneck can fetch it from the
      mailbox of the account so the driver does not have to. Only businesses that Kasseneck has set up for Genius Pay
      get access (otherwise `terminal_not_enabled`).

      Flow of an app: `registerTerminalDevice` once per installation (keep `deviceSecret` in the secure storage of the
      device) -> `getTerminalAccess` at every start and at least once a day while the app runs (keeps the TID of the
      device, or assigns a free one; a TID whose device has not called for 7 days and without a card payment in the
      receipts of the business for 7 days becomes free again) -> sign in to
      Genius Pay with `username` and `password` -> when Genius Pay asks for the code and `autoCode` is true,
      `requestTerminalCode` and poll `getTerminalCode`; otherwise the driver types the code -> `reportTerminalLogin`
      after the sign-in, `reportTerminalReady` when Genius Pay is set up. Every answer with a login also lists the
      TIDs of the business (`terminals`: this device, free or in use, with their last device); `claimTerminal` takes
      one over (the other device loses it).

      A TID can be **fixed** to one device (`claimTerminal` with `fixed: true`, set by your support): it is never
      handed out automatically, other devices cannot take it over (`terminal_fixed`), and the device itself only moves
      to another TID with `fixed: true` (`terminal_device_fixed`). `unfixTerminal` removes the binding of a device.

      `deviceSecret`, `password` and `code` are secrets: never log them, never show the password.

      | | |
      |---|---|
      | Base URL | `https://api.kasseneck.at/v3/<endpoint>`, **`/v3` only** |
      | Authentication | `Authorization: Bearer kr_live_…` (API key of the business), no `cashregister-token`; every call except `registerTerminalDevice` also sends `deviceId` and `deviceSecret`. A `kr_test_…` key gets `terminal_test_environment`. |
      | Errors | `terminal_not_enabled`, `terminal_test_environment`, `terminal_device_unknown`, `terminal_device_blocked`, `invalid_terminal_device`, `too_many_terminal_devices`, `terminal_not_in_business`, `terminal_code_manual`, `terminal_code_rate_limited`, `terminal_not_assigned`, `terminal_fixed`, `terminal_device_fixed`, `server_error` (see `TerminalErrorCode` and `/fehlercodes.json`, list `genius`) |
  - name: Partner
    description: |
      The **Partner API** is for the servers of Kasseneck partners: software vendors who sign
      up businesses for Kasseneck from inside their own app, and tax advisors and resellers
      who set up businesses for their clients. Everything here also works in the partner
      portal (`https://partner.kasseneck.at`); API and portal run the same logic.

      ### Basics

      | | |
      |---|---|
      | Base URL | `https://api.kasseneck.at/v3/<endpoint>` |
      | Method | always `POST`, body `application/json` |
      | Body | `{ "params": { … } }`: all parameters go inside `params` |
      | Authentication | `Authorization: Bearer pk_live_…` or `pk_test_…` (partner key from the portal, Entwickler → API-Schlüssel, that is Developer → API keys). No `cashregister-token`. |
      | Response | always HTTP 200 with `{ "status": "success" \| "error", "message": "…", "data": { … } }` |
      | Encoding | UTF-8; timestamps are Unix milliseconds |

      The API is meant to be called from your server, not from a browser or a mobile app:
      the key is a secret. On `error`, `message` explains the problem in German for humans and
      `data.code` carries the machine-readable reason (schema `PartnerErrorCode`). The same
      code is also set as `code` next to `message`; `data.code` is the documented place.

      Parameters are checked first. A missing required parameter or a parameter of the wrong
      type (for example `"automatic": "yes"` instead of `true`) is answered with
      `status: "error"` and a German message, but **without** a code.

      Every business-related endpoint takes the `customerId` from `createPartnerCustomer`. A
      business of another partner and an unknown ID get the same answer: the message
      „Betrieb nicht gefunden.“ without a code.

      ### Versions

      `/v3` is the current version: every parameter name, response field and enum value is
      English (human-readable texts such as `message`, `note` and `statusText` stay German,
      as do the BMF/FinanzOnline terms in the glossary). Under `/v3` a German field name or
      value from `/v1` is rejected as `validation`, not silently translated: that covers a
      `/v1` parameter name sent where `/v3` expects its English counterpart (see the
      Partner API's migration table), and a German `/v1` value such as
      `legalForm: "einzel"` or `state: "wien"` (the error names the field, e.g.
      `business.legalForm`). Other unknown fields are ignored, same as on `/v1`.
      This check runs before authentication and only ever echoes back the caller's own
      input.

      `/v1` keeps answering unchanged, byte for byte. It is deprecated: responses of the
      Partner endpoints (like every public endpoint) on `/v1` carry `Deprecation: @1790294400` (RFC 9745, Unix seconds for
      2026-09-25T00:00:00Z), `Sunset: Thu, 30 Sep 2027 00:00:00 GMT` and
      `Link: <https://api.kasseneck.at/v3/<name>>; rel="successor-version"` (also exposed to
      browsers via `Access-Control-Expose-Headers`). `/v1` is switched off only once
      monitoring shows zero calls for at least 30 days (monitoring counts calls via
      `api.kasseneck.at/v1`, `/v2` and `/v3`; direct calls to the underlying Cloud
      Functions address are not counted, so always use `api.kasseneck.at`); until then the `Sunset` date moves
      rather than the endpoint disappearing under you. The deprecated shape is kept,
      unchanged, in [`openapi-v1.yaml`](openapi-v1.yaml). Error codes are documented under
      `PartnerErrorCode`; most were already English, the handful of German ones are
      translated for `/v3` (see the migration table below), `/v1` keeps returning them
      unchanged.

      ### Migrating from v1

      2026-09-26: /v3 error codes and error data are English (see the table below); /v1
      unchanged.

      Endpoint names, parameters and enum values that changed for `/v3` (everything else,
      such as `getPartnerInfo`, `customerId`, `webhookId` and cash register fields, stays the
      same):

      | v1 | v3 |
      |---|---|
      | Endpoint `reportCustomerVertrag` | `reportCustomerContract` (params `customerId`, `kind` (`avv`\|`terms`), `signerRole`, `acceptedAt`; response `contractId`, `confirmedAt`, `kind`, `version`) |
      | `entgelt` `{cents, rhythmus, test}` | `fee` `{cents, interval, test}` |
      | `rhythmus`: `monat` / `jahr` / `einmal` | `interval`: `monthly` / `yearly` / `once` |
      | `business.legalForm`: `einzel` / `verein` / `sonstige` | `sole_proprietor` / `association` / `other` (`eu`, `og`, `kg`, `gmbh`, `gmbhcokg`, `ag` unchanged) |
      | `business.state`: `wien`, `kaernten`, `niederoesterreich`, … | ISO 3166-2 `AT-1` (Burgenland) … `AT-9` (Wien) |
      | `contacts[].roles`: `geschaeftsfuehrung` / `buchhaltung` / `technik` / `kasse` | `management` / `accounting` / `technical` / `pos` |
      | `avv.mode`: `direkt` / `vollmacht` / `unterauftrag` | `direct` / `power_of_attorney` / `subprocessor` |
      | Signature `history[].reason`: `karte_eingetragen`, `fon` | `card_entered`, `finanzonline` |
      | Signature `history[].reason`: `vorrat_aktiviert`, `aktivierungslauf`, `fon_nachgeholt` | `card_pool_activated`, `activation_run`, `finanzonline_completed` |
      | `deletePartnerWebhook` data `geloescht: true` | `deleted: true` |
      | Webhook delivery status `zugestellt` / `offen` / `fehlgeschlagen` / `verworfen` | `delivered` / `pending` / `failed` / `dropped` |
      | Webhook event `customer.terms_accepted` data `kind: "nutzung"` | `kind: "terms"` |
      | Webhook event `source`: `einrichten` / `prozess` / `partner_vollmacht` / `admin_papier` / `papier_upload` | `setup_link` / `process_link` / `partner_power_of_attorney` / `admin_paper` / `paper_upload` |
      | Webhook event `signature.failed` / `cashregister.failed` data `code` | translated the same as the error codes below (governed by the webhook's own `apiVersion`, not the path you call) |
      | Error code `zugang_nicht_erlaubt` | `access_not_allowed` |
      | Error code `kennung_fehlt` | `tax_number_missing` |
      | Error code `vertrag_offen` | `contracts_pending` |
      | Error code `art_not_allowed` | `kind_not_allowed` |
      | Error code `modus_not_allowed` | `mode_not_allowed` |
      | Error code `vollmacht_fehlt` | `power_of_attorney_missing` |
      | Signature `error.code`: `kunde_nicht_gefunden` / `unvollstaendig` / `fon_fehler` | `customer_not_found` / `incomplete` / `finanzonline_error` |
      | `customer_exists` / `customer_conflict` data field for the tax number (shorter, German name on `/v1`) | `taxNumber` |
      | `requestCustomerSignature` validation field `art` | `kind` |
      | `module_inactive` data `modul` (value `registrierkasse`), and its `/v1` data field for the message | `module` (value `cash_register`), `detail` |
      | `reportCustomerContract` `already_accepted` data `vertragId` | `contractId` |
      | `reportCustomerContract` validation fields `art` / `funktion` / `akzeptiertAt` | `kind` / `signerRole` / `acceptedAt` |

      All other error codes were already English and stay the same under `/v3`; see
      `PartnerErrorCode` for the `/v3` code next to every one, including these.

      **Webhooks carry a version of their own** (`apiVersion`, `v1` or `v3`), independent of
      which path you call: a webhook created through `/v1` keeps sending German payloads
      even once you also call `/v3` elsewhere. Webhooks created through `/v3` default to
      `v3`. Switch an existing one with `updatePartnerWebhook` (called on `/v3`) and
      `patch: { "apiVersion": "v3" }`; there is no way back from `v3` to `v1` on purpose, so
      a partner cannot fall back to German payloads by accident. Webhook objects (from
      `listPartnerWebhooks`, `createPartnerWebhook`, `updatePartnerWebhook` and
      `rotatePartnerWebhookSecret`) show `apiVersion` (missing on old ones means `v1`);
      delivery objects carry no `apiVersion`.

      `apiVersion` decides the language of the webhook **payloads** only. The language of an
      **API response** follows the path you call: on `/v3` every status is English (for
      example `lastDelivery.status` and delivery `status`: `delivered`, `pending`, `failed`,
      `dropped`), whatever the webhook's `apiVersion`; on `/v1` the answer stays exactly as
      it was.

      ### Environments

      - **`pk_test_…`**: test environment, available right away. Businesses are created as
        test accounts (`customerId` starts with `ptest_`), receipts are not valid RKSV
        receipts and nothing is reported to FinanzOnline (the tax authority's online system).
        The whole chain runs without anyone at Kasseneck.
      - **`pk_live_…`**: live environment, available once Kasseneck has approved a version of
        your app and your terms (Konditionen, the commercial terms of your partner account)
        are on file. Businesses are created as real accounts that are **enabled immediately**
        and carry the module `registrierkasse` (fiscal cash register).

      A live key can also create test businesses (`env: "test"` in `createPartnerCustomer`);
      a test key never creates live ones.

      ### Scopes

      | Scope | Allows | Standard |
      |---|---|---|
      | `partner:read` | `getPartnerInfo` | yes |
      | `customers:read` | `listPartnerCustomers`, `getPartnerCustomer`, `getCustomerSignatureStatus`, `listCustomerCashregisters` | yes |
      | `customers:write` | `createPartnerCustomer`, `checkPartnerCustomerEmail`, `sendPartnerCustomerFonLink`, `requestCustomerSignature`, `createCustomerCashregister`, `activateCashregister` | yes |
      | `billing:read` | `getPartnerBilling`, `getPartnerBillingMonth` | yes (keys created earlier do not have it; create a new key) |
      | `webhooks:read` | `listPartnerWebhooks`, `listPartnerWebhookDeliveries` | yes |
      | `webhooks:write` | `createPartnerWebhook`, `updatePartnerWebhook`, `deletePartnerWebhook`, `rotatePartnerWebhookSecret`, `sendPartnerWebhookTest` | yes |
      | `credentials:read` | `getCustomerCredentials` | **no** |

      `credentials:read` is deliberately not in the standard set and is never added to
      existing keys: whoever holds a business's API key and cash register tokens can sign
      receipts in its name. Choose it explicitly when you create the key, ideally on a
      dedicated key. A missing scope is answered with `status: "error"` and the message
      „Partner-Schlüssel hat nicht die nötige Berechtigung (customers:write).“ (no code).

      ### Rate limits

      | Limit | Value | Answer |
      |---|---|---|
      | Calls per key | 600 per hour | `rate_limited` with `retryAfterSec` |
      | `checkPartnerCustomerEmail` | 60 per hour and key, on top of the 600 | `rate_limited` with `retryAfterSec` |
      | New businesses | 20 live and 100 test per partner and day (Europe/Vienna) | `customer_limit` with `max` and `resetAt` |
      | Setup links (`sendPartnerCustomerFonLink`) | 3 per business within 24 hours | `rate_limited` (without `retryAfterSec`) |
      | Signatures | 10 signature requests per business | `signature_limit` |
      | Cash registers | 20 per business | `cashregister_limit` |
      | Webhooks | 10 per partner | `webhook_limit` |

      ### The flow

      1. **Create the business (Betrieb)**: `createPartnerCustomer` with all required data in
         one call. Answer: `customerId`, status `created`.
      2. **Have FinanzOnline set up**: `sendPartnerCustomerFonLink` sends the business a link
         (`einrichten.kasseneck.at`) where it creates its FinanzOnline web service user and
         confirms its contracts with Kasseneck. Afterwards `getPartnerCustomer` shows
         `fon.configured: true`.
      3. **Request a signature**: `requestCustomerSignature` immediately creates a signature
         object with its own ID (`signatureRequestId`), even though the card does not exist
         yet. Kasseneck has the signature card issued for this business and registers the
         signature creation unit (Signaturerstellungseinheit) with FinanzOnline. Wait for
         `signature.ready`.
      4. **Create the cash register**: `createCustomerCashregister`. This may happen while the
         signature is still in progress, but not without one (`signature_missing`). The cash
         register stays `draft` and goes live by itself as soon as **its** signature is ready
         (`automatic`, on by default); otherwise use `activateCashregister`. Result: webhook
         `cashregister.live`.
      5. **Fetch the credentials**: `getCustomerCredentials` (scope `credentials:read`) returns
         `apiKey` and `cashregisterToken`; with them your app writes receipts through
         `createReceipt`.
      6. **Done**: nothing else is needed from Kasseneck. Billing runs through your partner
         contract.

      Steps 3 and 4 run in parallel on purpose. If a cash register goes live right when it is
      created, both webhooks still fire, in the same order as in the separate case: first
      `cashregister.created`, then `cashregister.live`. With a `pk_test_` key the signature
      request is fulfilled automatically within about five minutes (AT100 test card) and the
      activation skips the two FinanzOnline steps.

      ### Status of a business

      | Status | Meaning | Possible next |
      |---|---|---|
      | `created` | account created, data complete | any later status, `blocked` |
      | `fon_configured` | FinanzOnline web service user verified | `signature_requested`, `signature_ready`, `cashregister_created`, `live`, `blocked` |
      | `signature_requested` | signature request is with Kasseneck | `signature_ready`, `cashregister_created`, `live`, `blocked` |
      | `signature_ready` | signature creation unit ready | `cashregister_created`, `live`, `blocked` |
      | `cashregister_created` | at least one cash register created | `live`, `blocked` |
      | `live` | Kasseneck enabled live operation by hand (possible from any status) | `blocked` |
      | `blocked` | Kasseneck disabled live operation | back to any other status |

      Every change fires `customer.status_changed` (`from`, `to`, `reason`). The status names
      the **furthest milestone reached** and only moves forward; a cash register going live
      does not change it. Businesses created with a live key are enabled from the start
      (`liveEnabled: true`) and normally never pass through `live`. For the exact course
      listen for `signature.*` and `cashregister.*`. `customer.fon_verified` arrives exactly
      once per business, when its FinanzOnline access is verified through the setup link,
      whatever the status is at that moment. If the signature was requested before, the
      status stays `signature_requested` (it only moves forward), so there is no
      `customer.status_changed` for it, but `customer.fon_verified` still arrives.

      ### Contracts of the business

      A business created through you has two contracts with Kasseneck: the **data processing
      agreement** (Auftragsverarbeitungsvertrag, AVV, Art. 28 GDPR) and the **terms of use**
      (Nutzungsvertrag). The business confirms both itself through the setup link
      (`sendPartnerCustomerFonLink`). **Without both, no cash register goes live in the live
      environment** (`activateCashregister` answers `contracts_pending`, `vertrag_offen` on
      `/v1`). In the test environment contracts are not required. You see the state per business in `avv` and `terms`
      (schema `ContractState`); `avv.mode` says how your partner account handles the AVV:
      `direct`, `power_of_attorney` or `subprocessor`. The events `customer.avv_accepted` and
      `customer.terms_accepted` report the confirmation.

      ### Webhooks

      Register an HTTPS address and choose events; Kasseneck sends a `POST` with a JSON body
      for each event (see the *Webhooks* section of this reference for every event and its
      payload). Headers: `Content-Type: application/json`, `X-Kasseneck-Event: <type>`,
      `X-Kasseneck-Delivery: <deliveryId>` (the ID of the delivery, the same on every retry;
      the event ID is `id` in the body), `X-Kasseneck-Signature: t=<unix seconds>,v1=<hex>`,
      `User-Agent: Kasseneck-Webhooks/1`.

      **Verifying the signature:** when you create a webhook you get a secret (`whsec_…`)
      once. The signature is `HMAC-SHA256(secret, "<t>.<body>")` as hex, computed over the
      **raw** body, byte for byte (in Express bind the route with
      `express.raw({ type: 'application/json' })`, not `express.json()`). Reject timestamps
      that differ from your clock by more than 5 minutes.

      ```js
      const crypto = require('node:crypto');

      function signatureValid(secret, header, rawBody) {
        try {
          const parts = Object.fromEntries(String(header || '').split(',').map((p) => p.trim().split('=')));
          const t = Number(parts.t);
          if (!Number.isInteger(t) || Math.abs(Date.now() / 1000 - t) > 300) return false;
          const expected = Buffer.from(crypto.createHmac('sha256', secret).update(`${parts.t}.${rawBody}`).digest('hex'));
          const received = Buffer.from(String(parts.v1 || ''));
          // timingSafeEqual throws on different lengths, so compare the length first.
          if (expected.length !== received.length) return false;
          return crypto.timingSafeEqual(expected, received);
        } catch {
          return false;
        }
      }

      app.post('/kasseneck-webhook', express.raw({ type: 'application/json' }), (req, res) => {
        const raw = req.body.toString('utf8');
        if (!signatureValid(process.env.KASSENECK_WEBHOOK_SECRET, req.get('X-Kasseneck-Signature'), raw)) return res.sendStatus(401);
        const event = JSON.parse(raw);
        res.sendStatus(200);                          // acknowledge first, then work
        if (event.test) return;                       // test delivery
        // … event.type, event.data; deduplicate on event.id
      });
      ```

      ```python
      import hmac, hashlib, time

      def signature_valid(secret: str, header: str, raw_body: bytes) -> bool:
          try:
              parts = dict(p.strip().split("=", 1) for p in (header or "").split(","))
              t = int(parts["t"])
          except (KeyError, ValueError):
              return False
          if abs(time.time() - t) > 300:
              return False
          expected = hmac.new(secret.encode(), f"{t}.".encode() + raw_body, hashlib.sha256).hexdigest()
          return hmac.compare_digest(expected, parts.get("v1", ""))
      ```

      Answer with a 2xx status within 10 seconds; the body does not matter. Redirects are not
      followed and count as a failure. Otherwise Kasseneck retries after about 1 minute,
      5 minutes, 30 minutes, 2 hours and 12 hours (six attempts in total); after that the
      delivery counts as failed (portal under „Entwickler“, and
      `listPartnerWebhookDeliveries`). An event can arrive more than once: deduplicate on
      `id`. If a webhook is deactivated or deleted, its pending deliveries are dropped.

      **Test deliveries** (`sendPartnerWebhookTest`) carry `test: true` in the envelope; real
      events do not carry the field. `if (event.test) return;` keeps a test delivery from
      being taken for real.

      ### Requirements for your application

      Receipts that your application issues carry your name and must comply with the law.
      The simplest way is to print the line model delivered with every receipt (`layout`, 32
      or 48 characters) unchanged. The list is also an annex to the partner contract:

      - **Receipt data per § 132a (3) BAO**: business name, sequential receipt number assigned by the API, date, quantity and customary description of each line item, amount. (legal requirement)
      - **Cash register data per § 10 RKSV**: additionally cash register ID, date and time, amounts split by VAT rate, and the machine-readable code as a QR code, exactly as delivered and legible (at least 2 × 2 cm). (legal requirement)
      - **Invoice data per § 11 UStG**: name and address of the business, net amount, VAT rate and VAT amount per rate, and the business's VAT ID as soon as one is on file; from 400 euros gross the app can capture and print the buyer's name and address. (provider's requirement for release)
      - **All values from the API response**: amounts, VAT rates, receipt number, cash register ID, signature and QR code are printed exactly as delivered; your own calculation may verify but never print. (provider's requirement for release)
      - **Receipt types recognisable**: cancellation, training, start, monthly, yearly, zero and final receipts are marked as delivered; a cancellation names the cancelled receipt. (legal requirement)
      - **Signature outage**: a receipt with the note 'Sicherheitseinrichtung ausgefallen' is printed with that note; receipts keep being created through the API during the outage, never locally. (legal requirement, § 17 RKSV)
      - **Receipt is handed over**: printed or electronically as PDF; showing it on screen only is not enough. (legal requirement, § 132a (1) and (5) BAO)
      - **Delivered line model or identical own rendering**, **test receipts before release** and **following changes** within the communicated period. (provider's requirement for release, partner contract, section 3)

      ### Not available yet

      Taking a running cash register out of operation (decommissioning, Außerbetriebnahme,
      § 17 (8) RKSV) and replacing a defective card are done by Kasseneck, not through the
      Partner API. A customer-panel login for an existing business can only be added in the
      partner portal. Questions: hello@kasseneck.at.

      ### Glossary

      | German | English | Meaning |
      |---|---|---|
      | Beleg | receipt | a receipt issued by the fiscal cash register |
      | Startbeleg | start receipt | first receipt of a cash register; created and transmitted during activation |
      | Nullbeleg | zero receipt | receipt with amount 0, e.g. for checks |
      | Monatsbeleg | monthly receipt | zero receipt at the end of each month |
      | Jahresbeleg | annual receipt | the monthly receipt for December; it must be checked and reported |
      | Schlussbeleg | final receipt | last receipt when a cash register is decommissioned |
      | Storno | cancellation | reversal of a receipt |
      | Signaturerstellungseinheit | signature creation unit | the signature card that signs the receipts |
      | DEP (Datenerfassungsprotokoll) | data capture log (DEP) | the chained log of all receipts of a cash register |
      | Kassennachschau | cash register audit | inspection of a cash register by the tax authority |
      | Belegerteilungspflicht | obligation to issue receipts | the duty to hand every customer a receipt |
      | Registrierkasse | fiscal cash register | cash register under the Austrian RKSV rules |
      | Außerbetriebnahme | decommissioning | taking a cash register or signature creation unit out of operation |
      | Rechnung | invoice | |
      | USt | VAT | Umsatzsteuer |
      | Betrieb | business | a Kasseneck customer you create |
      | Konditionen | terms | commercial terms of your partner account |
      | Vertrag | contract | e.g. partner contract, data processing agreement |
      | RKSV | Registrierkassensicherheitsverordnung | the Austrian regulation on fiscal cash registers |
      | BAO | Bundesabgabenordnung | Austrian Federal Fiscal Code |
      | FinanzOnline, BMF | | the tax authority's online system and the Austrian Federal Ministry of Finance |
paths:
  /v3/createReceipt:
    post:
      operationId: createReceipt
      tags: [Receipts]
      summary: Create and sign a receipt
      description: |
        Creates a receipt and signs it (ES256, chained RKSV signature, written to the data
        capture log, DEP). **The first receipt of a cash register must be a `start` receipt**
        (start receipt, Startbeleg) and must be signed successfully; `standard` receipts and
        the others follow.

        **`payments` is required under `/v3`** for every receipt that moves money
        (`standard`, `training`): a list of the payments that settle the receipt, in whole
        cents. Their sum must equal the amount due, otherwise `payments_sum_mismatch` (with
        `data.expectedCents`), and no receipt number is used up. Several payment methods on
        one receipt make the stored `paymentMethod` `mixed`; the payments themselves are in
        `receipt.payments[]`. `start` and `zero` receipts carry no payments (leave
        `payments` out or send an empty list).

        | Request | Answer |
        |---|---|
        | `payments` missing on a `standard` or `training` receipt | `payments_required` |
        | `paymentMethod` (or `creditCardProvider`, `cardPaymentId`, `cardPaymentData`) sent | `payment_method_not_supported` |
        | `receiptType: "cancellation"` | `payments_not_allowed`: cancel through `cancelReceipt` |

        Under `/v1` and `/v2` the single `paymentMethod` stays valid; sending both
        `payments` and `paymentMethod` there is refused with the code `PAYMENTS_CONFLICT`
        (`payments_conflict` in `/v3` spelling), never one of them silently preferred.

        Requires the active module `registrierkasse` for the account (zero receipts are
        always allowed). `receiptId` and timestamp are assigned by the server.

        **Repeating safely: `idempotencyKey`.** Send your own ID of the receipt (1–120
        characters, for example the order number and a counter). If no clear answer arrives
        (timeout, network error, `receipt_outcome_unknown`, `server_error`), send the **same**
        request with the **same** key again: a receipt that was stored comes back unchanged,
        with `replayed: true`, and nothing is signed or numbered a second time; a receipt that
        was not stored is created now, once. The same key with other parameters is
        `idempotency_conflict` and writes nothing (the order of the fields does not matter).
        A key belongs to one cash register: the same key on two cash registers gives two
        receipts. Authentication, the cash register token, the module and the live and API
        release are checked before the key, also on a repeat. The plain codes of vouchers sold
        (`issuedVouchers`) come only with the first answer. Keys do not expire at the moment;
        rely on a repeat for 30 days at most. Without a key nothing changes: every request is
        a new receipt.

        **Vouchers** (`vouchers[]`): selling, redeeming and paying out vouchers with a code,
        and the older form without one, are described in `Voucher`. A sale answers with the
        plain codes in `issuedVouchers`, once.

        Errors: `code` from `ReceiptErrorCode` (column *Sent by* `createReceipt`) or from
        `CommonErrorCode`.
      security:
        - ApiKeyAuth: []
          CashregisterToken: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  $ref: '#/components/schemas/CreateReceiptParams'
            examples:
              start_receipt:
                summary: Start receipt (once, first)
                value: { params: { receiptType: start } }
              sales_receipt:
                summary: Standard sales receipt, paid in cash
                value:
                  params:
                    receiptType: standard
                    items:
                      - { name: "Kaffee", quantity: 2, unitPriceCents: 350, vatRate: 20 }
                      - { name: "Brot", quantity: 1, unitPriceCents: 220, vatRate: 10 }
                    payments:
                      - { method: cash, amountCents: 920, tenderedCents: 1000 }
              split_payment:
                summary: Two payments (card and cash), stored as paymentMethod mixed
                value:
                  params:
                    receiptType: standard
                    items:
                      - { name: "Torte", quantity: 1, unitPriceCents: 700, vatRate: 10 }
                    payments:
                      - { method: cash, amountCents: 200 }
                      - { method: creditCard, amountCents: 500, provider: sumup, providerPaymentId: "tx-4711" }
              with_idempotency_key:
                summary: Sales receipt that may be sent again after a timeout
                value:
                  params:
                    receiptType: standard
                    idempotencyKey: "order-4711-1"
                    items:
                      - { name: "Kaffee", quantity: 1, unitPriceCents: 350, vatRate: 20 }
                    payments:
                      - { method: cash, amountCents: 350 }
              sale_explicit_deposit:
                summary: Deposit (Pfand) - goods without articleId plus a single-use deposit line of your own
                value:
                  params:
                    receiptType: standard
                    items:
                      - { name: "Cola 0,5 l", quantity: 2, unitPriceCents: 350, vatRate: 20 }
                      - { kind: deposit, depositTypeId: einweg, depositFor: 0, name: "Pfand Einweg", quantity: 2, unitPriceCents: 25, vatRate: 0 }
                    payments:
                      - { method: cash, amountCents: 750, tenderedCents: 1000 }
              sale_auto_deposits:
                summary: Deposit (Pfand) - the server derives the deposit lines from the articles
                value:
                  params:
                    receiptType: standard
                    autoDeposits: true
                    items:
                      - { name: "Cola 0,5 l", quantity: 2, unitPriceCents: 350, vatRate: 20, articleId: beispiel_cola }
                    payments:
                      - { method: cash, amountCents: 750 }
              on_premises:
                summary: Deposit (Pfand) - consumed on the premises, single-use deposit does not apply
                value:
                  params:
                    receiptType: standard
                    autoDeposits: true
                    onPremises: true
                    items:
                      - { name: "Cola 0,5 l", quantity: 2, unitPriceCents: 350, vatRate: 20, articleId: beispiel_cola }
                    payments:
                      - { method: cash, amountCents: 700 }
              empties_payout:
                summary: Empties (Leergut) paid out in cash - one negative cash payment, no goods
                value:
                  params:
                    receiptType: standard
                    items:
                      - { kind: deposit_return, depositTypeId: kiste, name: "Leergut Kiste", quantity: 2, unitPriceCents: -300, vatRate: 20 }
                    payments:
                      - { method: cash, amountCents: -600 }
              empties_offset:
                summary: Empties offset against a purchase - the total stays positive
                value:
                  params:
                    receiptType: standard
                    items:
                      - { name: "Cola 0,5 l", quantity: 2, unitPriceCents: 350, vatRate: 20 }
                      - { kind: deposit_return, depositTypeId: flasche, name: "Leergut Flasche", quantity: 3, unitPriceCents: -20, vatRate: 20 }
                    payments:
                      - { method: cash, amountCents: 640 }
              sell_voucher:
                summary: Sell a value voucher of a voucher type (the code comes in issuedVouchers)
                value:
                  params:
                    receiptType: standard
                    vouchers:
                      - { action: sell, typeId: "vt_gift", amountCents: 5000 }
                    payments:
                      - { method: cash, amountCents: 5000 }
              redeem_voucher:
                summary: Redeem part of a multi-purpose voucher
                value:
                  params:
                    receiptType: standard
                    items:
                      - { name: "Blumenstrauß", quantity: 1, unitPriceCents: 2240, vatRate: 10 }
                    vouchers:
                      - { action: redeem, type: multi_purpose, code: "KRNB-7Q4M-XW3Y", amountCents: 1750 }
                    payments:
                      - { method: cash, amountCents: 490 }
      responses:
        "200":
          description: |
            Envelope with the signed receipt, or an error (`code` from `ReceiptErrorCode` or
            `CommonErrorCode`). A repeat with the same `idempotencyKey` answers with the stored
            receipt and `replayed: true`; a sale of vouchers with a code adds `issuedVouchers`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReceiptEnvelope'
  /v3/getReceipt:
    post:
      operationId: getReceipt
      tags: [Receipts]
      summary: Fetch a receipt
      description: |
        Returns a previously created receipt of the cash register by its `receiptId`, in the
        same shape as `createReceipt`. A receipt that was cancelled carries its
        `cancellations[]`. Next to it `outputs`: the newest 20 entries of the log of what was
        printed, sent and opened (`ReceiptOutput`). Errors: `receipt_not_found` and the codes of
        `CommonErrorCode`.
      security:
        - ApiKeyAuth: []
          CashregisterToken: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [receiptId]
                  properties:
                    receiptId:
                      type: string
                      description: ID of the receipt (from the createReceipt response).
            examples:
              fetch:
                value: { params: { receiptId: "abc123" } }
      responses:
        "200":
          description: Envelope with the receipt, or an error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReceiptEnvelope'
  /v3/listDepositTypes:
    post:
      operationId: listDepositTypes
      tags: [Receipts]
      summary: List the deposit types of the business
      description: |
        Deposit (Pfand) and empties: reads the active deposit types of the business, so that a
        merchandise system knows which `depositTypeId` it may use on `createReceipt` lines and
        in the `deposits` of articles. Only on `/v3`. Takes no parameters (`{ "params": {} }`).
        The same data as the `deposit` block of `getKasseSettings`.

        `data.deposit` is `null` when deposit is switched off for the business; that is not an
        error. Only active deposit types are listed. The single-use type always has the `id`
        `einweg`; reusable types (bottle, crate, keg, ...) have the ID the business's deposit
        setup gave them.

        Called with the API key of the business (`kr_live_…` or `kr_test_…`); no
        `cashregister-token`. A session of a register user (device and PIN) is not allowed
        (`register_user_not_allowed`). The test key reads the deposit types of the test
        environment. **Setting up deposit types (create, change, switch off) stays in the customer area
        (mein.kasseneck.at); this call only reads.**
      security:
        - ApiKeyAuth: []
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                params: { type: object, additionalProperties: false }
            examples:
              read:
                value: { params: {} }
      responses:
        "200":
          description: "`data: { deposit }`, or an error."
          content:
            application/json:
              schema:
                type: object
                properties:
                  status: { type: string, enum: [success, error] }
                  message: { type: string, description: German text for humans. }
                  code:
                    anyOf:
                      - type: string
                        enum: [register_user_not_allowed, server_error]
                      - $ref: '#/components/schemas/CommonErrorCode'
                  data:
                    type: object
                    properties:
                      deposit:
                        $ref: '#/components/schemas/DepositSettings'
              examples:
                deposit_on:
                  summary: Deposit switched on (Max Hollerer GmbH)
                  value:
                    status: success
                    data:
                      deposit:
                        singleUse: true
                        reusable: true
                        depositTypes:
                          - { id: einweg, kind: single_use, name: "Pfand Einweg", type: null, amounts: [{ from: "2025-01-01", cents: 25 }], returnRate: 0, used: true }
                          - { id: flasche, kind: reusable, name: Mehrwegflasche, type: bottle, amounts: [{ from: "2025-01-01", cents: 20 }], returnRate: 20, used: true }
                          - { id: kiste, kind: reusable, name: Getränkekiste, type: crate, amounts: [{ from: "2025-01-01", cents: 300 }], returnRate: 20, used: true }
                          - { id: harasse, kind: reusable, name: Bierharasse, type: crate, amounts: [{ from: "2025-01-01", cents: 350 }], returnRate: null, used: false }
                deposit_off:
                  summary: Deposit switched off - not an error
                  value: { status: success, data: { deposit: null } }
  /v3/getEwpReport:
    post:
      operationId: getEwpReport
      tags: [Receipts]
      summary: EWP monthly report of the single-use deposit (fillers)
      description: |
        The monthly report of the single-use containers a business fills itself, per GTIN, for the
        deposit system (EWP). Only on `/v3`, with the API key of the business (no
        `cashregister-token`; a register user gets `register_user_not_allowed`). Only for accounts
        with the filler role (`filler_role_required`) and deposit switched on
        (`deposit_not_enabled`). The test key reports the test environment.

        `month` is `YYYY-MM`, from `2025-01` up to the current month in Vienna (`invalid_deposit`
        otherwise). Without `format` or with `format: "json"` the answer is the report
        (`EwpReport`); with `format: "csv"` it is the file for the upload,
        `data: { csv, filename, contentType }`. Calling the CSV of a closed month marks it as
        downloaded (`downloadedAt`); the current month is `provisional` and never marked. Calling
        it again is harmless. Setting up the GTINs (registration, master data) stays in the
        customer area; this call only reads. What counts, the foreign rule, the warnings and the
        file layout are described under "EWP monthly report (fillers)" at the tag *Receipts*.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [month]
                  properties:
                    month: { type: string, pattern: '^\d{4}-\d{2}$', description: "Report month, `YYYY-MM`." }
                    format: { type: string, enum: [json, csv], default: json }
            examples:
              get_ewp_report:
                summary: Report of November 2026
                value: { params: { month: "2026-11" } }
              get_ewp_report_csv:
                summary: The file for the upload
                value: { params: { month: "2026-11", format: csv } }
      responses:
        "200":
          description: "`data: EwpReport`, with `format: csv` `data: { csv, filename, contentType }`, or an error."
          content:
            application/json:
              schema:
                type: object
                properties:
                  status: { type: string, enum: [success, error] }
                  message: { type: string, description: German text for humans. }
                  code:
                    anyOf:
                      - type: string
                        enum: [register_user_not_allowed, filler_role_required, deposit_not_enabled, invalid_deposit, server_error]
                      - $ref: '#/components/schemas/CommonErrorCode'
                  data:
                    oneOf:
                      - $ref: '#/components/schemas/EwpReport'
                      - type: object
                        required: [csv, filename, contentType]
                        properties:
                          csv: { type: string }
                          filename: { type: string, description: "`EWP-Meldung-YYYY-MM.csv`, with `TEST-` in front for the test key." }
                          contentType: { type: string, example: "text/csv; charset=utf-8" }
              examples:
                report:
                  summary: November 2026 of Bäckerei Kornblum (two registered GTINs)
                  value:
                    status: success
                    data:
                      month: "2026-11"
                      dueDate: "2026-12-05"
                      provisional: false
                      test: false
                      lines:
                        - gtin: "9012345000011"
                          name: "Lager Dose 0,5 l"
                          masterData: { barcodeType: International, productOrigin: "Produced in Austria", depositFee: D1, producerFee: PF1, ecoImpact: EFP1, intBarcodeUsage: PFI1 }
                          domestic: 72
                          foreign: 48
                          sources: { register: 12, invoices: 96, deliveryNotes: 0, extra: 12 }
                        - gtin: "9012345000028"
                          name: "Radler Dose 0,33 l"
                          masterData: { barcodeType: Austria, productOrigin: "Produced in Austria", depositFee: D1, producerFee: PF1, ecoImpact: EFP2, intBarcodeUsage: "" }
                          domestic: 0
                          foreign: 0
                          sources: { register: 0, invoices: 0, deliveryNotes: 0, extra: 0 }
                      warnings:
                        - { code: gtin_not_registered, gtin: "9012345000035", quantity: 6 }
                      extraQuantities:
                        - { gtin: "9012345000011", domestic: 12, foreign: 0, reason: own_consumption, text: "Betriebsfeier", at: 1793300000000, by: api }
                      downloadedAt: null
                csv:
                  summary: With format csv
                  value:
                    status: success
                    data:
                      csv: "Mont_of_reference;Barcode_type;Unit_barcode;Product_name;Product_origin;Volume_inland_standard;Volume_ausland_standard;Volume_inland_no_submission;Volume_ausland_no_submission;Reported_date;Deposit_fee;Producer_fee;Eco_impact;int_barcode_usage\r\nNov.26;International;9012345000011;Lager Dose 0,5 l;Produced in Austria;72;48;;;01.12.2026;D1;PF1;EFP1;PFI1\r\n"
                      filename: "EWP-Meldung-2026-11.csv"
                      contentType: "text/csv; charset=utf-8"
  /v3/setEwpExtraQuantities:
    post:
      operationId: setEwpExtraQuantities
      tags: [Receipts]
      summary: Set the extra quantities of an EWP month
      description: |
        Replaces the extra quantities of a month: the list you send is the whole list, an empty
        list clears them. Extra quantities are what the registers, invoices and delivery notes do
        not know: own consumption, samples, donations, theft, free goods, stocktake differences and
        returns (a **negative** quantity), or the quantities of a system that reports itself
        (`external_system`). Entries that stay the same keep `at` and `by`; new ones get the time
        and `by: "api"`. The answer is the recalculated report (`EwpReport`). Same access as
        `getEwpReport`; calling it again with the same list changes nothing.

        At most 500 entries; `gtin` valid, `domestic` and `foreign` whole pieces from -1,000,000
        to 1,000,000, `text` at most 200 characters; anything else is `invalid_deposit` and
        nothing is changed.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [month, extraQuantities]
                  properties:
                    month: { type: string, pattern: '^\d{4}-\d{2}$', description: "Report month, `YYYY-MM`." }
                    extraQuantities: { type: array, maxItems: 500, items: { $ref: '#/components/schemas/EwpExtraQuantityInput' } }
            examples:
              set_ewp_extra_quantities:
                summary: 12 cans own consumption, 6 cans returned (Bäckerei Kornblum)
                value:
                  params:
                    month: "2026-11"
                    extraQuantities:
                      - { gtin: "9012345000011", domestic: 12, foreign: 0, reason: own_consumption, text: "Betriebsfeier" }
                      - { gtin: "9012345000028", domestic: -6, foreign: 0, reason: return }
      responses:
        "200":
          description: "`data: EwpReport` (recalculated), or an error."
          content:
            application/json:
              schema:
                type: object
                properties:
                  status: { type: string, enum: [success, error] }
                  message: { type: string, description: German text for humans. }
                  code:
                    anyOf:
                      - type: string
                        enum: [register_user_not_allowed, filler_role_required, deposit_not_enabled, invalid_deposit, server_error]
                      - $ref: '#/components/schemas/CommonErrorCode'
                  data: { $ref: '#/components/schemas/EwpReport' }
  /v3/listReceipts:
    post:
      operationId: listReceipts
      tags: [Receipts]
      summary: List the receipts of a day or period
      description: |
        Lists the receipts of the cash register for one day (`date`) or a period (`from`, `to`),
        page by page. Only on `/v3`. Times are the local time in Vienna, like `timeStamp` on the
        receipt; a day is a calendar day, also on the days the clocks change. A period may be at
        most 31 days long; there is no limit into the past.

        Pages hold up to `limit` receipts (default 100, at most 500). While `hasMore` is true,
        send the same `date` (or `from`/`to`), `order` and `view` again together with
        `cursor: nextCursor`; `limit` may change between pages. A cursor belongs to one cash
        register and one query: any other use returns `invalid_cursor`.

        `view: summary` (default) returns a short line per receipt, amounts in cents.
        `view: full` returns per receipt what `getReceipt` returns, except the `outputs` log and
        the print `layout` (both only with `getReceipt`, for the receipt someone opens or
        prints): the stored receipt with `headerVersionId` (the header version that applies to
        it, also for old receipts without a stored one), `testSignature` and `registrationInfo`
        on zero receipts. The page carries `headers` (one entry per header version on the page,
        with the same header fields as `getReceipt`), `testCashregister` and `logo_scale`, and
        still `metadata` (today's business data). For printing take the entry of `headers`
        with the receipt's `headerVersionId`, not `metadata`; zero receipts are printed without
        a logo. Provider data of card payments (`payments[].providerPaymentId`,
        `providerData`) come with the business's own API key, never with a partner access.
        For the PDF use `downloadReceipt` with `fullReceiptId`.

        With `date`, the first page also carries `daySummary` from the daily statistics:
        `receiptCount` counts every receipt of the day (also zero, start and training
        receipts), `revenueCents` only standard and cancellation receipts, without employee
        tips and after promotion discounts. It is therefore not the sum of `totalCents` of the
        list. `null` when there are no statistics for the day.
      security:
        - ApiKeyAuth: []
          CashregisterToken: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  properties:
                    date: { type: string, format: date, description: "A day, `YYYY-MM-DD`. Either `date` or `from` and `to`." }
                    from: { type: string, description: "Start (inclusive), `YYYY-MM-DD` or `YYYY-MM-DDTHH:mm:ss`, local time in Vienna." }
                    to: { type: string, description: "End (exclusive), same format. A plain date means the start of that day. At most 31 days after `from`." }
                    limit: { type: integer, minimum: 1, maximum: 500, default: 100 }
                    order: { type: string, enum: [desc, asc], default: desc, description: "`desc`: newest first." }
                    view: { type: string, enum: [summary, full], default: summary }
                    cursor: { type: string, description: "`nextCursor` of the previous page." }
            examples:
              day:
                value: { params: { date: "2026-10-27" } }
              nextPage:
                value: { params: { date: "2026-10-27", cursor: "eyJ2IjoxLCJrIjoi…" } }
              period:
                value: { params: { from: "2026-10-01", to: "2026-11-01", view: full, order: asc, limit: 500 } }
      responses:
        "200":
          description: "`data: { receipts, hasMore, nextCursor, daySummary? }`, or an error."
          content:
            application/json:
              schema:
                type: object
                properties:
                  status: { type: string, enum: [success, error] }
                  message: { type: string, description: German text for humans. }
                  code:
                    anyOf:
                      - type: string
                        enum: [invalid_date, invalid_range, range_too_long, invalid_limit, invalid_order, invalid_view, invalid_cursor, server_error]
                      - $ref: '#/components/schemas/CommonErrorCode'
                  data:
                    type: object
                    properties:
                      receipts:
                        type: array
                        items:
                          oneOf:
                            - $ref: '#/components/schemas/ReceiptSummary'
                            - $ref: '#/components/schemas/ListedReceipt'
                      hasMore: { type: boolean }
                      nextCursor: { type: [string, "null"] }
                      headers:
                        type: array
                        description: "Only with `view: full`: the header versions of the receipts on this page, each once, oldest first. A receipt's `headerVersionId` names its entry. `headerVersionId: null` only for an account without any header version (today's data)."
                        items:
                          type: object
                          properties:
                            headerVersionId: { type: [string, "null"] }
                            company: { type: [string, "null"] }
                            street: { type: [string, "null"] }
                            zip: { type: [string, "null"] }
                            city: { type: [string, "null"] }
                            phone: { type: [string, "null"] }
                            vatId: { type: [string, "null"] }
                            taxNumber: { type: [string, "null"] }
                            is_small_business: { type: [boolean, "null"] }
                            footer1: { type: [string, "null"] }
                            footer2: { type: [string, "null"] }
                            footer3: { type: [string, "null"] }
                            footer4: { type: [string, "null"] }
                            thanks_message: { type: [string, "null"] }
                            kreiseck_logo: { type: [boolean, "null"] }
                            logo_url: { type: [string, "null"], description: "Logo of this version. Zero receipts are printed without a logo." }
                      testCashregister: { type: boolean, description: "Only with `view: full`: cash register of the test environment, like `getReceipt`." }
                      logo_scale: { type: string, enum: [S, M, L, XL], description: "Only with `view: full`: size step of the logo, like `getReceipt`." }
                      metadata:
                        type: object
                        description: "Only with `view: full`: the business data for the receipt header, same fields as `metadata` of `getReportV2` (missing values are null)."
                        properties:
                          label: { type: [string, "null"], description: Name of the cash register. }
                          taxNumber: { type: [string, "null"] }
                          vatId: { type: [string, "null"] }
                          is_small_business: { type: [boolean, "null"] }
                          company: { type: [string, "null"] }
                          phone: { type: [string, "null"] }
                          street: { type: [string, "null"] }
                          zip: { type: [string, "null"] }
                          city: { type: [string, "null"] }
                          footer1: { type: [string, "null"] }
                          footer2: { type: [string, "null"] }
                          footer3: { type: [string, "null"] }
                          footer4: { type: [string, "null"] }
                          logo_url: { type: [string, "null"] }
                          thanks_message: { type: [string, "null"] }
                          kreiseck_logo: { type: boolean }
                      daySummary:
                        type: [object, "null"]
                        properties:
                          date: { type: string, format: date }
                          receiptCount: { type: integer }
                          revenueCents: { type: integer, description: "Rounded once from the exact daily total, like the daily report." }
                          revenueByRate:
                            type: array
                            description: "Per VAT rate, highest first, rates without revenue left out. Each row is rounded on its own, so the rows can differ from `revenueCents` by a cent." 
                            items:
                              type: object
                              properties:
                                rateBp: { type: integer, description: "VAT rate in basis points, e.g. 2000 = 20 %." }
                                grossCents: { type: integer }
  /v3/createDepExport:
    post:
      operationId: createDepExport
      tags: [Receipts]
      summary: Start a DEP export for the cash register inspection
      description: |
        Starts the export of the data capture log (DEP) of the cash register for a tax
        inspection (Kassennachschau). Only on `/v3`. The export is built in the background:
        a new export answers `status: running`; poll `getDepExport` until `done` or `failed`.

        Legal basis: Erlass BMF-AV Nr. 2/2026, section 3.2.1.3: the data carrier is the normal
        case; handing over the access data of an external server, or an export via the
        internet, is permitted. Under § 19 para 2 RKSV the inspector sets the period and the
        data carrier is handed over. Offer the export as a download in your software and
        let the inspector name the period; for the handover use `createDepHandoverLink`
        or give the files on a data carrier.

        **Recommendation: only the owner (Chef) should be allowed to start exports.** The API
        cannot check who of your staff is pressing the button; limit the function in your own
        software.

        `from` and `to` are days (`YYYY-MM-DD`, Vienna), both optional; without them the
        whole DEP is exported. `from` must not lie in the future and `to` not before `from`
        (`invalid_period`). `requestId` (up to 64 characters of `A-Z a-z 0-9 _ -`) makes the
        call safe to repeat: the same `requestId` with the same period on the same cash
        register starts no second export but returns that export with its current `status`
        (`running`, `done` or `failed`, as `getDepExport` reports it). The same `requestId`
        with a different period is rejected with `idempotency_conflict`; use a new
        `requestId` for a new period.

        Limits: one running export per cash register (`export_running`; `data.exportId`
        names the running export), 20 exports per account and Vienna day
        (`too_many_exports`). An export that has not finished after 35 minutes counts as
        failed.
      security:
        - ApiKeyAuth: []
          CashregisterToken: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  properties:
                    from: { type: string, format: date, description: "First day, `YYYY-MM-DD`. Optional." }
                    to: { type: string, format: date, description: "Last day, `YYYY-MM-DD`. Optional." }
                    requestId: { type: string, maxLength: 64, pattern: '^[A-Za-z0-9_-]{1,64}$', description: "Idempotency key per cash register. The same value with the same period returns that export with its current status; with a different period `idempotency_conflict`." }
            examples:
              period:
                value: { params: { from: "2026-07-01", to: "2026-09-30", requestId: "nachschau-2026-10-30" } }
      responses:
        "200":
          description: "`data: { exportId, status, from, to }` (`status: running` for a new export, the current status on a repeat with the same `requestId`), or an error; `export_running` carries `data.exportId`."
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DepExportEnvelope'
  /v3/getDepExport:
    post:
      operationId: getDepExport
      tags: [Receipts]
      summary: Status and details of a DEP export
      description: |
        Returns the state of an export of this cash register: `running`, `done` or `failed`,
        the receipt count, the counter range, the SHA-256 and size of the DEP file, the
        findings of the check (counter gaps, chain breaks, receipts without counter or
        signature) and the handover links with their state. Only on `/v3`. An export of
        another cash register is answered like an unknown one (`export_not_found`).
        Poll every few seconds; large exports take minutes.
      security:
        - ApiKeyAuth: []
          CashregisterToken: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [exportId]
                  properties:
                    exportId: { type: string, example: "DEP-2026-10-30-0001" }
      responses:
        "200":
          description: "`data`: the export (see `DepExport`), or an error."
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DepExportEnvelope'
  /v3/getDepExportFile:
    post:
      operationId: getDepExportFile
      tags: [Receipts]
      summary: Download a file of a finished DEP export
      description: |
        Delivers one file of a finished export. Only on `/v3`. `file` is `dep` (the DEP as
        JSON, the file for the inspection tool), `protocol` (check protocol as PDF), `items`
        (the line items of all receipts as CSV, also receipts without signature) or `zip`
        (all files together, where the export has one).

        Up to 9 MiB the response is the file itself (binary, with `Content-Type` and
        `Content-Disposition`). Larger files come as JSON `data.download` with a signed
        `url` valid for 15 minutes, plus `size`, `sha256`, `fileName` and `contentType`;
        check the SHA-256 after the download. Compare it with `sha256` of `getDepExport`.

        **A file is recognised by `Content-Disposition: attachment`; an envelope never carries
        it.** Do not decide on the `Content-Type`: the DEP itself is JSON too. Media types of the
        files: `application/json` (`dep`), `application/pdf` (`protocol`),
        `text/csv; charset=utf-8` (`items`), `application/zip` (`zip`).
        Exports from before the inspection feature have no `items` and no `zip`
        (`file_not_available`). While the export runs: `export_not_ready`; after a failure:
        `export_failed`.
      security:
        - ApiKeyAuth: []
          CashregisterToken: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [exportId, file]
                  properties:
                    exportId: { type: string, example: "DEP-2026-10-30-0001" }
                    file: { type: string, enum: [dep, protocol, items, zip] }
      responses:
        "200":
          description: "The file itself (with `Content-Disposition: attachment`), or the JSON envelope with `data.download`, or an error (both without `Content-Disposition`)."
          headers:
            Content-Disposition:
              description: "Only on a file: `attachment; filename=\"<exportId>.json\"` (`.pdf`, `_positionen.csv`, `.zip`). An envelope never carries it."
              schema: { type: string }
          content:
            application/json:
              schema:
                oneOf:
                  - title: Envelope
                    description: "Without `Content-Disposition`: `data.download` for a large file, or an error."
                    type: object
                    properties:
                      status: { type: string, enum: [success, error] }
                      message: { type: string }
                      code: { type: string, enum: [validation, export_not_found, export_not_ready, export_failed, invalid_file, file_not_available, server_error] }
                      data:
                        type: object
                        properties:
                          download:
                            type: object
                            properties:
                              url: { type: string }
                              expiresAt: { type: string, format: date-time }
                              size: { type: integer }
                              sha256: { type: string }
                              fileName: { type: string }
                              contentType: { type: string }
                  - title: DEP file
                    description: "With `Content-Disposition: attachment` (`file: dep`): the DEP itself, the JSON export format of the RKSV (BMF)."
                    type: object
            application/pdf:
              schema: { type: string, format: binary, description: "`file: protocol`, with `Content-Disposition: attachment`." }
            text/csv:
              schema: { type: string, format: binary, description: "`file: items` (`text/csv; charset=utf-8`), with `Content-Disposition: attachment`." }
            application/zip:
              schema: { type: string, format: binary, description: "`file: zip`, with `Content-Disposition: attachment`." }
  /v3/createDepHandoverLink:
    post:
      operationId: createDepHandoverLink
      tags: [Receipts]
      summary: Create an inspector link with a code for a finished export
      description: |
        Creates a handover link for a finished export, so that the inspector can download
        the files at `check.kasseneck.at` without an account (access data of an external
        server, Erlass BMF-AV Nr. 2/2026, section 3.2.1.3). Only on `/v3`.

        The response carries the `url` (show it as a QR code on the screen of the cash
        register) and a 6 digit `code` that only the cash register shows; hand both to the
        inspector separately. **The `url` and the `code` appear only in this response**;
        the server keeps only hashes. The link is valid for 14 days. After 5 wrong codes the
        link is blocked until midnight (Vienna). The owner of the account gets an e-mail when a
        link is created and on its first use, each with a revoke key; `revokeDepHandoverLink`
        or the customer area revoke it.

        Limits: at most 3 active links per export (`too_many_links`), 10 new links per
        account and Vienna day. The export must be finished (`export_not_ready`,
        `export_failed`).
      security:
        - ApiKeyAuth: []
          CashregisterToken: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [exportId]
                  properties:
                    exportId: { type: string, example: "DEP-2026-10-30-0001" }
      responses:
        "200":
          description: "`data: { linkId, url, code, expiresAt }`, or an error."
          content:
            application/json:
              schema:
                type: object
                properties:
                  status: { type: string, enum: [success, error] }
                  message: { type: string }
                  code: { type: string, enum: [validation, export_not_found, export_not_ready, export_failed, too_many_links, server_error] }
                  data:
                    type: object
                    properties:
                      linkId: { type: string }
                      url: { type: string, description: "`https://check.kasseneck.at/dep#link=<linkId>.<token>`; the token is only in the fragment." }
                      code: { type: string, description: "6 digits." }
                      expiresAt: { type: string, format: date-time }
  /v3/revokeDepHandoverLink:
    post:
      operationId: revokeDepHandoverLink
      tags: [Receipts]
      summary: Revoke an inspector link
      description: |
        Revokes a handover link of this cash register at once. Only on `/v3`. Revoking a link
        that is already revoked succeeds with the original `revokedAt`. A link of
        another cash register is answered like an unknown one (`link_not_found`).
      security:
        - ApiKeyAuth: []
          CashregisterToken: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [linkId]
                  properties:
                    linkId: { type: string, description: "20 characters, from `createDepHandoverLink`." }
      responses:
        "200":
          description: "`data: { linkId, revokedAt }`, or an error."
          content:
            application/json:
              schema:
                type: object
                properties:
                  status: { type: string, enum: [success, error] }
                  message: { type: string }
                  code: { type: string, enum: [validation, link_not_found, server_error] }
                  data:
                    type: object
                    properties:
                      linkId: { type: string }
                      revokedAt: { type: [string, "null"], format: date-time }
  /v3/cancelReceipt:
    post:
      operationId: cancelReceipt
      tags: [Receipts]
      summary: Cancel a receipt (full or partial)
      description: |
        Creates a signed cancellation receipt (Storno) for a `standard` receipt. The original
        stays unchanged byte for byte; only its `cancellations[]` grows. Without `items` the
        whole remaining quantity is cancelled; with `items` only the given lines. A second
        cancellation over the same remainder fails (`already_cancelled`,
        `quantity_exceeds_remaining`).

        Refunds: without `payments` the server mirrors the original payments (a partial
        cancellation of a receipt with several payments needs `payments`,
        `cancellation_payments_required`). With `payments`, each entry is a refund with a
        negative `amountCents`; a refund of a card payment names the original payment in
        `refundOf` (`p1`, `p2`, … from `receipt.payments[].id`). Under `/v3` `paymentMethod`
        and the old card fields are answered with `payment_method_not_supported`.

        A cancellation carries no `manualReceipt`: sending it is `manual_receipt_not_allowed`.
        Cancelling a recorded handwritten receipt works like any other cancellation; the
        cancellation receipt does not repeat the reference.

        Tips: without `refundTip` and `tipRefundSource` the tip is cancelled with the rest.
        `refundTip: false` keeps a staff tip that is still open with the staff member
        (the cancellation then covers every line except the tip; not on a receipt with a value
        voucher, `tip_keep_not_possible_with_voucher`). `tipRefundSource` says who gives a cash
        tip back: `drawer` (the cash drawer) or `employee` (the staff member who received it).

        Vouchers with a code: a receipt that carries them is only cancelled in full
        (`voucher_partial_cancel`), and the sale of a voucher only while the voucher is unused
        (`voucher_already_used`). The cancellation gives a redeemed amount back to its voucher
        and cancels a voucher the receipt sold.

        Refund as a voucher: `refundAs: "voucher"` gives the amount back as a new multi-purpose
        voucher instead of money (only for a signed-in cash register user of the Kasseneck app
        with the right to sell vouchers, `reason` `customer_cancelled` or `other`, a voucher type
        for returns set in the customer area, 1.00 € to 10,000 €, and no voucher with a code on
        the original). It needs an `idempotencyKey`, which belongs to the original receipt: a repeat
        with the same key answers the same cancellation receipt (`replayed: true`) and never issues a
        second voucher; while the first call is still running, a repeat answers
        `cancellation_outcome_unknown`. The new voucher
        stands on the cancellation receipt as a `redeem` entry with `fromReturn: true`, its plain
        code once in `issuedVouchers`; a staff tip of the original goes back in cash.

        Errors: `code` from `ReceiptErrorCode` (column *Sent by* `cancelReceipt`) or from
        `CommonErrorCode`.

        Authentication: the API key of the business (or a signed-in user of the business), no
        `cashregister-token`; the cash register is the parameter `cashregisterId`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [cashregisterId, originalReceiptId, reason]
                  properties:
                    cashregisterId: { type: string }
                    originalReceiptId: { type: string, description: The receipt to cancel. }
                    reason:
                      $ref: '#/components/schemas/CancellationReason'
                    items:
                      type: array
                      description: Lines to cancel (partial cancellation). Leave out to cancel the whole remainder.
                      items:
                        type: object
                        required: [index, quantity]
                        properties:
                          index: { type: integer, minimum: 0, description: Index of the line in the original `receipt.items`. }
                          quantity: { type: integer, minimum: 1, description: How many to cancel; at most the remaining quantity. }
                          returnDisposition: { $ref: '#/components/schemas/ReturnDisposition' }
                    returnDisposition:
                      allOf: [{ $ref: '#/components/schemas/ReturnDisposition' }]
                      description: "Default for every line with a stock-tracked article; a line can set its own in `items[].returnDisposition`. Without it the goods go back to sellable stock (`restock`). An unknown value is `invalid_return_disposition`."
                    note: { type: string, maxLength: 200, description: Optional note. }
                    payments:
                      type: array
                      description: Refunds (negative `amountCents`); see `Payment`, with `refundOf` for card refunds.
                      items:
                        $ref: '#/components/schemas/Payment'
                    refundTip:
                      type: boolean
                      description: "`false` keeps a staff tip that is still open with the staff member; without it (or `true`) the tip is cancelled too."
                    tipRefundSource:
                      type: string
                      enum: [drawer, employee]
                      description: "Who gives the tip back in cash: `drawer` or `employee` (only for a staff tip the staff member received). Not with `refundTip: false` (`tip_refund_conflict`), only when the tip goes back in cash (`tip_refund_source_requires_cash`)."
                    drawerId:
                      $ref: '#/components/schemas/DrawerId'
                    refundAs:
                      type: string
                      enum: [voucher]
                      description: "`voucher`: refund as a new multi-purpose voucher instead of money (see above). Not together with `payments` or the older payment fields (`refund_as_conflict`); another value is `refund_as_invalid`."
                    idempotencyKey:
                      type: string
                      maxLength: 120
                      description: "Required with `refundAs` (`idempotency_key_required`). The key belongs to the original receipt: the same key with another `originalReceiptId`, `items`, `reason` or `refundAs` is `idempotency_conflict`. Other parameters are not compared, so repeat the request unchanged."
            examples:
              full:
                summary: Full cancellation, refunds mirrored by the server
                value: { params: { cashregisterId: "kasse-1", originalReceiptId: "abc123", reason: input_error } }
              card_refund:
                summary: Refund of a card payment
                value:
                  params:
                    cashregisterId: "kasse-1"
                    originalReceiptId: "abc123"
                    reason: customer_cancelled
                    payments:
                      - { method: creditCard, amountCents: -700, refundOf: p1, provider: sumup, providerPaymentId: "rf-1" }
      responses:
        "200":
          description: |
            On success `data` is `{ receipt, cancellationOf, remaining }`: the cancellation
            receipt (`Receipt`, with `cancellationOf` and `cancellationReason`), the reference
            to the original, and the remaining quantity per line of the original. With `refundAs`
            also `issuedVouchers` (the voucher of the return) and, on a repeat, `replayed: true`.
            Errors carry a `code` from `ReceiptErrorCode` or `CommonErrorCode`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status: { type: string, enum: [success, error] }
                  message: { type: string }
                  code:
                    anyOf:
                      - $ref: '#/components/schemas/ReceiptErrorCode'
                      - $ref: '#/components/schemas/CommonErrorCode'
                  data:
                    type: object
                    properties:
                      receipt: { $ref: '#/components/schemas/Receipt' }
                      cancellationOf: { type: object, description: Reference to the original receipt (`receiptId` and more). }
                      remaining: { type: array, items: { type: integer }, description: Remaining quantity per line of the original. }
                      issuedVouchers:
                        type: array
                        description: "Only with `refundAs`: the voucher of the return (`fromReturn: true`). The plain `code` comes only with the first answer; a repeat or a lost answer has no `code` but `reprintRequired: true` (print it again through the reprint)."
                        items:
                          allOf:
                            - $ref: '#/components/schemas/IssuedVoucher'
                            - type: object
                              properties:
                                reprintRequired: { type: boolean, description: "The plain code is not in this answer; reprint the voucher." }
                      replayed: { type: boolean, description: "Only on a repeat with the same `idempotencyKey`: the cancellation receipt of the first call." }
  /v3/sendReceiptEmail:
    post:
      operationId: sendReceiptEmail
      tags: [Receipts]
      summary: Send the receipt link by email
      description: |
        Sends the customer an email with the link to the receipt PDF, in the name of the
        business (its own mailbox if configured, otherwise the platform sender with reply-to
        the business). Rate-limited per receipt and per cash register (`too_many_requests`).
      security:
        - ApiKeyAuth: []
          CashregisterToken: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [fullReceiptId, to]
                  properties:
                    fullReceiptId: { type: string, description: The receipt token (`receipt.fullReceiptId`). }
                    to: { type: string, format: email }
                    language: { type: string, description: "Language of the email; accepted, currently without effect." }
            examples:
              send:
                value: { params: { fullReceiptId: "…", to: "max@example.at" } }
      responses:
        "200":
          description: |
            On success `data` is `{ to, at, via }`: `via` is `own` (the business's own
            mailbox), `platform` or `platform_fallback`. Error codes: `invalid_address`,
            `receipt_not_found`, `too_many_requests`, `send_failed` (`ReceiptErrorCode`) and the
            codes of `CommonErrorCode`.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status: { type: string, enum: [success, error] }
                  message: { type: string }
                  code:
                    anyOf:
                      - $ref: '#/components/schemas/ReceiptErrorCode'
                      - $ref: '#/components/schemas/CommonErrorCode'
                  data:
                    type: object
                    properties:
                      to: { type: string }
                      at: { type: string, description: 'ISO 8601 timestamp with offset (Europe/Vienna), e.g. `2026-09-26T10:15:00+02:00`.' }
                      via: { type: string, enum: [own, platform, platform_fallback] }
  /v3/generateFullReceiptId:
    post:
      operationId: generateFullReceiptId
      tags: [Receipts]
      summary: Receipt token for the PDF link
      description: |
        Returns the encrypted `fullReceiptId` token of a receipt (the same value as
        `receipt.fullReceiptId`). The server does not look the receipt up: a wrong `receiptId`
        gives a token whose link finds no receipt. Errors: only the codes of `CommonErrorCode`.
      security:
        - ApiKeyAuth: []
          CashregisterToken: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [receiptId]
                  properties:
                    receiptId: { type: string }
      responses:
        "200":
          description: "`data: { fullReceiptId }`."
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Envelope'
  /v3/downloadReceipt:
    get:
      operationId: downloadReceipt
      tags: [Receipts]
      summary: Download the receipt PDF (capability link)
      description: |
        Returns the receipt PDF directly (`application/pdf`). Authorisation is solely the
        encrypted `fullReceiptId` token from the createReceipt response; no API key is
        needed. The token is a capability link: whoever has it sees the PDF. Under `/v3` the
        token goes in the query (`?fullReceiptId=`). The file name is `<receiptId>.pdf`.
      security: []
      parameters:
        - name: fullReceiptId
          in: query
          required: true
          schema:
            type: string
          description: Encrypted receipt token from `data.receipt.fullReceiptId`.
      responses:
        "200":
          description: PDF file.
          content:
            application/pdf:
              schema:
                type: string
                format: binary
        "400":
          description: Receipt link incomplete.
        "404":
          description: Account or receipt not found.
  /v3/getFirstReceiptDate:
    post:
      operationId: getFirstReceiptDate
      tags: [Receipts]
      summary: Timestamp of the first receipt
      description: |
        Returns the `timeStamp` of the first receipt of the cash register as `data` (a string).
        Without any receipt yet the answer is `status: "error"` without a code. Other errors:
        the codes of `CommonErrorCode`.
      security:
        - ApiKeyAuth: []
          CashregisterToken: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmptyParams'
      responses:
        "200":
          description: "`data` is the timestamp (Europe/Vienna) of the first receipt."
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Envelope'
  /v3/getReportV2:
    post:
      operationId: getReportV2
      tags: [Receipts]
      summary: Receipts of a period (raw data for reports)
      description: |
        Returns all receipts of the cash register with `start <= timeStamp < end` and the data
        of the business for the report header. Meant for your own reports; to show a list of
        receipts, use `listReceipts` (pages, at most 31 days). `end` may lie at most 62 calendar
        days after `start`; a longer period returns `range_too_long` (on `/v1` and `/v2`:
        `zeitraum_zu_lang`) without reading any receipt. Receipts have the same shape as
        `receipt` in `createReceipt` (English field names, no payment provider internals).
      security:
        - ApiKeyAuth: []
          CashregisterToken: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [start, end]
                  properties:
                    start: { type: string, description: "Local timestamp (Europe/Vienna), e.g. `2026-09-01T00:00:00`." }
                    end: { type: string, description: Exclusive. }
      responses:
        "200":
          description: "`data: { receipts: Receipt[], metadata }`."
          content:
            application/json:
              schema:
                type: object
                properties:
                  status: { type: string, enum: [success, error] }
                  message: { type: string }
                  code:
                    anyOf:
                      - type: string
                        enum: [range_too_long]
                        description: "`end` lies more than 62 days after `start`."
                      - $ref: '#/components/schemas/CommonErrorCode'
                  data:
                    type: object
                    properties:
                      receipts: { type: array, items: { $ref: '#/components/schemas/Receipt' } }
                      metadata:
                        type: object
                        description: Business data for the report header.
                        properties:
                          label: { type: [string, "null"], description: Name of the cash register. }
                          taxNumber: { type: [string, "null"] }
                          vatId: { type: [string, "null"] }
                          is_small_business: { type: [boolean, "null"] }
                          company: { type: [string, "null"] }
                          phone: { type: [string, "null"] }
                          street: { type: [string, "null"] }
                          zip: { type: [string, "null"] }
                          city: { type: [string, "null"] }
                          footer1: { type: [string, "null"] }
                          footer2: { type: [string, "null"] }
                          footer3: { type: [string, "null"] }
                          footer4: { type: [string, "null"] }
                          logo_url: { type: [string, "null"] }
                          thanks_message: { type: [string, "null"] }
                          kreiseck_logo: { type: boolean }
  /v3/downloadReport:
    post:
      operationId: downloadReport
      tags: [Receipts]
      deprecated: true
      summary: Monthly report as PDF
      description: |
        Deprecated: use `getCashregisterReport`. Closed periods now return the same report as
        `getCashregisterReport`; the current month or day keeps the previous layout. Responses carry
        `Deprecation` and `Link: <https://api.kasseneck.at/v3/getCashregisterReport>; rel="successor-version"`.
        The monthly report of the cash register as PDF. File name (`Content-Disposition`):
        `monthly-report_<cashregisterId>_<YYYY-MM>.pdf`. Errors come as the JSON envelope.
      security:
        - ApiKeyAuth: []
          CashregisterToken: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [year, month]
                  properties:
                    year: { type: integer, minimum: 2010 }
                    month: { type: integer, minimum: 1, maximum: 12 }
      responses:
        "200":
          description: PDF file, or the JSON envelope on error.
          content:
            application/pdf:
              schema: { type: string, format: binary }
            application/json:
              schema: { $ref: '#/components/schemas/Envelope' }
  /v3/downloadDailyReport:
    post:
      operationId: downloadDailyReport
      tags: [Receipts]
      deprecated: true
      summary: Daily report as PDF
      description: |
        Deprecated: use `getCashregisterReport`. Closed periods now return the same report as
        `getCashregisterReport`; the current month or day keeps the previous layout. Responses carry
        `Deprecation` and `Link: <https://api.kasseneck.at/v3/getCashregisterReport>; rel="successor-version"`.
        The daily report of the cash register as PDF. File name (`Content-Disposition`):
        `daily-report_<cashregisterId>_<YYYY-MM-DD>.pdf`. Errors come as the JSON envelope.
      security:
        - ApiKeyAuth: []
          CashregisterToken: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [year, month, day]
                  properties:
                    year: { type: integer, minimum: 2010 }
                    month: { type: integer, minimum: 1, maximum: 12 }
                    day: { type: integer, minimum: 1, maximum: 31 }
      responses:
        "200":
          description: PDF file, or the JSON envelope on error.
          content:
            application/pdf:
              schema: { type: string, format: binary }
            application/json:
              schema: { $ref: '#/components/schemas/Envelope' }
  /v3/getCashregisterReport:
    post:
      operationId: getCashregisterReport
      tags: [Receipts]
      summary: Report of a month, a day or a date range as PDF
      description: |
        The report of a closed month, a closed day (yesterday or earlier; today returns `period_not_closed`) or a closed date range of the cash register as PDF. Pass exactly one of the three
        period forms: `{year, month}` (monthly report), `{year, month, day}` (daily report) or
        `{start, end}` (free range, `YYYY-MM-DD`, `end` exclusive, at most 366 days).
        File name (`Content-Disposition`): `monthly-report_<cashregisterId>_<YYYY-MM>.pdf`,
        `daily-report_<cashregisterId>_<YYYY-MM-DD>.pdf` or `report_<cashregisterId>_<start>_<end>.pdf`.
        Errors come as the JSON envelope with `data.code`: `period_not_closed`, `period_in_future`,
        `invalid_period`, `report_generating` (retry shortly), `cashregister_not_found`,
        `module_inactive`, `server_error`.
      security:
        - ApiKeyAuth: []
          CashregisterToken: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  properties:
                    year: { type: integer, minimum: 2010 }
                    month: { type: integer, minimum: 1, maximum: 12 }
                    day: { type: integer, minimum: 1, maximum: 31 }
                    start: { type: string, format: date }
                    end: { type: string, format: date }
      responses:
        "200":
          description: PDF file, or the JSON envelope on error.
          content:
            application/pdf:
              schema: { type: string, format: binary }
            application/json:
              schema: { $ref: '#/components/schemas/Envelope' }
  /v3/createPaymentLinkStripe:
    post:
      operationId: createPaymentLinkStripe
      tags: [Receipts]
      summary: Stripe payment link for line items
      description: |
        Creates a Stripe Checkout session for the given line items with the Stripe account of
        the business (it must be configured). Vouchers are not supported here. The Stripe
        field names (`customer_email`, `expires_at`, …) keep Stripe's own spelling.
      security:
        - ApiKeyAuth: []
          CashregisterToken: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [createReceiptAfterPayment, items, mode]
                  properties:
                    createReceiptAfterPayment: { type: boolean }
                    items: { type: array, items: { $ref: '#/components/schemas/ReceiptItem' } }
                    mode: { type: string, enum: [payment, authorization], description: "`authorization` only reserves the amount; capture it with `stripeCaptureIntent`." }
                    customer_email: { type: string }
                    customer_phone: { type: string }
                    webhookId: { type: string }
      responses:
        "200":
          description: "`data: { id, url, expires_at, shorten_payment_url }`."
          content:
            application/json:
              schema: { $ref: '#/components/schemas/Envelope' }
  /v3/stripeCaptureIntent:
    post:
      operationId: stripeCaptureIntent
      tags: [Receipts]
      summary: Capture a reserved Stripe payment
      security:
        - ApiKeyAuth: []
          CashregisterToken: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [stripe_sessions_id]
                  properties:
                    stripe_sessions_id: { type: string, description: The session `id` from `createPaymentLinkStripe`. }
      responses:
        "200":
          description: "`data: { id, status, amount_received, currency }` (Stripe's field names)."
          content:
            application/json:
              schema: { $ref: '#/components/schemas/Envelope' }
  /v3/hobexPayApi:
    post:
      operationId: hobexPayApi
      tags: [Receipts]
      summary: Card payment on a hobex terminal
      description: |
        Starts a payment of `amount + tip` on the hobex terminal of the cash register (hobex
        must be configured for it). `amount` and `tip` are euros with at most two decimals.
        `data` is hobex's own status object.
      security:
        - ApiKeyAuth: []
          CashregisterToken: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [transactionId, amount, tip]
                  properties:
                    transactionId: { type: string, description: Your own ID of the transaction. }
                    amount: { type: number }
                    tip: { type: number }
                    reference: { type: string }
      responses:
        "200":
          description: Envelope with the hobex answer.
          content:
            application/json:
              schema: { $ref: '#/components/schemas/Envelope' }
  /v3/hobexRefundApi:
    post:
      operationId: hobexRefundApi
      tags: [Receipts]
      summary: Void or refund a hobex payment
      description: Voids the transaction on the hobex terminal, or refunds `amount + tip` (euros) if it can no longer be voided. `data` is hobex's own answer.
      security:
        - ApiKeyAuth: []
          CashregisterToken: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [transactionId, amount, tip]
                  properties:
                    transactionId: { type: string }
                    amount: { type: number }
                    tip: { type: number }
      responses:
        "200":
          description: Envelope with the hobex answer.
          content:
            application/json:
              schema: { $ref: '#/components/schemas/Envelope' }
  /v3/hobexGetStatus:
    post:
      operationId: hobexGetStatus
      tags: [Receipts]
      summary: Status of a hobex transaction
      security:
        - ApiKeyAuth: []
          CashregisterToken: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [transactionId]
                  properties:
                    transactionId: { type: string }
      responses:
        "200":
          description: Envelope with hobex's own status object.
          content:
            application/json:
              schema: { $ref: '#/components/schemas/Envelope' }
  /v3/financeWebService:
    post:
      operationId: financeWebService
      tags: [Receipts]
      summary: FinanzOnline web service (BMF schema)
      description: |
        Passes calls to the RKSV web service of FinanzOnline (the tax authority's online
        system). **Parameters and answers stay in the official BMF schema**, also under `/v3`:
        names such as `art_se`, `vda_id`, `zertifikatnr_hex`, `kassenidentifikationsnummer`,
        `aeskey`, `begruendung`, `beginn_ausfall`, `ende_ausfall`, `kundeninfo` and the answer
        fields `satznr` and `rkdbMessage` are BMF terms and are not translated.

        The method goes next to `params` in the body: `{ "method": "…", "params": { … } }`.
        Methods: `status_cashbox`, `receipt_transmission`, `registration_signature`,
        `registration_cashbox`, `signature_failure`, `cashbox_failure`,
        `signature_recovery`, `cashbox_recovery`, `status_signature`,
        `create_start_receipt`. `status_cashbox`, `receipt_transmission` and
        `create_start_receipt` need the `cashregister-token`.

        The one exception: `create_start_receipt` answers with the `createReceipt` envelope
        nested under `data.data`, and that envelope is translated like `createReceipt`
        (English field names).
      security:
        - ApiKeyAuth: []
          CashregisterToken: []
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [method]
              properties:
                method:
                  type: string
                  enum: [status_cashbox, receipt_transmission, registration_signature, registration_cashbox, signature_failure, cashbox_failure, signature_recovery, cashbox_recovery, status_signature, create_start_receipt]
                params:
                  type: object
                  description: Parameters of the method, named as in the BMF schema.
            examples:
              status:
                value: { method: status_cashbox, params: {} }
      responses:
        "200":
          description: Envelope with the answer of FinanzOnline in the BMF schema.
          content:
            application/json:
              schema: { $ref: '#/components/schemas/Envelope' }
  /v3/listMyTipRecipients:
    post:
      operationId: listMyTipRecipients
      tags: [Receipts]
      summary: Who can receive a tip
      description: |
        The users of the cash register who can be named as tip recipients
        (`tip.recipients[].registerUserId` in `createReceipt`), sorted by name. A signed-in
        user without the right to assign tips sees only themselves.
      security:
        - ApiKeyAuth: []
          CashregisterToken: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmptyParams'
      responses:
        "200":
          description: "`data: { recipients: [{ registerUserId, name, owner }] }`."
          content:
            application/json:
              schema: { $ref: '#/components/schemas/Envelope' }
  /v3/getInvoiceSetupStatus:
    post:
      operationId: getInvoiceSetupStatus
      tags: [Invoices]
      summary: Is the account ready to issue invoices?
      description: |
        Call this before the first `issueInvoice` and show `missing`. Answers also without the
        API release, without an active module and before live activation.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema: { $ref: '#/components/schemas/EmptyParams' }
      responses:
        "200":
          description: |
            `data: { ready, environment, missing: [{ requirement, message }] }`; `environment`
            is `live` or `test`, `missing` is empty when `ready` is true.
          content:
            application/json:
              schema:
                type: object
                properties:
                  status: { type: string, enum: [success, error] }
                  message: { type: string }
                  data:
                    type: object
                    properties:
                      ready: { type: boolean }
                      environment: { type: string, enum: [live, test] }
                      missing:
                        type: array
                        items:
                          type: object
                          properties:
                            requirement: { type: string, enum: [module_active, api_enabled, live_enabled, business_name, address, vat_id, bank_account, number_format] }
                            message: { type: string, description: German text. }
  /v3/listBrands:
    post:
      operationId: listBrands
      tags: [Invoices]
      summary: Brands (logo, colour, contact lines) of the account
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema: { $ref: '#/components/schemas/EmptyParams' }
      responses:
        "200":
          description: "`data: { brands: [{ id, name, isDefault }] }`, sorted by name. `id` goes into `issueInvoice` as `brandId`."
          content:
            application/json:
              schema: { $ref: '#/components/schemas/Envelope' }
  /v3/createCustomer:
    post:
      operationId: createCustomer
      tags: [Invoices]
      summary: Create an invoice customer
      description: |
        Once per customer, ideally with your own customer number as `externalId`. Errors:
        `customer_exists` (`data.customerId`), `short_code_taken` (`data.customerId`),
        `validation`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [customer]
                  properties:
                    customer: { $ref: '#/components/schemas/InvoiceCustomerInput' }
                    idempotencyKey: { type: string, minLength: 1, maxLength: 120 }
            examples:
              company:
                value:
                  params:
                    customer: { type: company, name: "Café Muster GmbH", country: AT, street: "Hauptplatz", houseNumber: "3", zip: "1010", city: "Wien", vatId: "ATU12345675", externalId: "shop-4711" }
      responses:
        "200":
          description: "`data: { customer }` (`InvoiceCustomer`)."
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InvoiceEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          customer: { $ref: '#/components/schemas/InvoiceCustomer' }
  /v3/getCustomer:
    post:
      operationId: getCustomer
      tags: [Invoices]
      summary: Fetch an invoice customer
      description: Exactly one of `customerId` or `externalId`. Otherwise `customer_not_found`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  properties:
                    customerId: { type: string }
                    externalId: { type: string }
      responses:
        "200":
          description: "`data: { customer }` (`InvoiceCustomer`)."
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InvoiceEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          customer: { $ref: '#/components/schemas/InvoiceCustomer' }
  /v3/updateCustomer:
    post:
      operationId: updateCustomer
      tags: [Invoices]
      summary: Change an invoice customer
      description: |
        `customer` carries only the fields to change (same rules as `createCustomer`). Issued
        invoices keep the data of their issue date. Changing a `shortCode` once set:
        `short_code_immutable`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [customerId, customer]
                  properties:
                    customerId: { type: string }
                    customer: { $ref: '#/components/schemas/InvoiceCustomerInput' }
      responses:
        "200":
          description: "`data: { customer }` (`InvoiceCustomer`)."
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InvoiceEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          customer: { $ref: '#/components/schemas/InvoiceCustomer' }
  /v3/searchCustomers:
    post:
      operationId: searchCustomers
      tags: [Invoices]
      summary: Search invoice customers
      description: |
        At least one of `externalId`, `vatId`, `email` (exact) or `name` (start of the name,
        case and accents ignored: `cafe` finds „Café Muster“). Issuing never matches customers
        by itself: link them explicitly through `customerId`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  properties:
                    externalId: { type: string }
                    vatId: { type: string }
                    email: { type: string }
                    name: { type: string }
                    limit: { type: integer, minimum: 1, maximum: 100, default: 25 }
                    cursor: { type: string }
      responses:
        "200":
          description: "`data: { customers: InvoiceCustomer[], nextCursor }`; `nextCursor` is `null` on the last page."
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InvoiceEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          customers: { type: array, items: { $ref: '#/components/schemas/InvoiceCustomer' } }
                          nextCursor: { type: [string, "null"] }
  /v3/issueInvoice:
    post:
      operationId: issueInvoice
      tags: [Invoices]
      summary: Issue an invoice (fixed, numbered)
      description: |
        Issues an invoice under § 11 UStG; after the call it is fixed: it carries its
        sequential number, cannot be changed and can only be corrected by a credit note.
        `idempotencyKey` is required: the same request with the same key returns the same
        invoice (`replayed: true`), the same key with other data is `idempotency_conflict`.
        After a timeout, always repeat with the **same** key.

        `taxScheme` is optional: the server derives it from country and type of the
        customer, the customer's VAT ID and `items[].kind`. A value that is sent is checked;
        a mismatch is `tax_scheme_mismatch` with `data.expected`, `data.given`, `data.reason`,
        and nothing is issued. `dryRun: true` checks and computes exactly like issuing but
        writes nothing and does not use up the `idempotencyKey`; the answer then carries
        `preview` instead of `invoice`.

        Recipient: above 400 € gross a `customerId` with name and address is required, above
        10,000 € to a company and for `reverseCharge` and `intraCommunitySupply` also the VAT
        ID; otherwise `recipient_required` or `invoice_requirements_missing` (`data.issues` in
        German, or `data.missing` as codes). The account needs the API release by Kasseneck
        for live (`invoice_api_not_enabled`) and a complete setup
        (`invoice_setup_incomplete`, see `getInvoiceSetupStatus`).

        **Stock.** A line with `articleId` of a stock-tracked article is booked out of stock
        at `stockLocationId` (default: the default location) shortly after issuing, when the
        inventory module is active. `items[].reservationId` redeems a reservation of the
        inventory API (`createReservation`) for that line; see `IssueInvoiceItemInput` and
        the tag *Inventory*. A reservation that does not fit stops the invoice
        (`reservation_not_found`, `reservation_not_active`, `reservation_mismatch`, with
        `data.field` `items[i].reservationId` and `data.reservationId`; no number is used).

        **VAT ID check.** An invoice without VAT that needs the customer's VAT ID
        (`intraCommunitySupply`, `reverseCharge`, `domesticReverseCharge`, and any invoice
        without VAT over EUR 10,000 gross to a business) is only issued with a result of the VAT ID
        check on the day of issue (FinanzOnline, else VIES; a valid result of the last 30 days
        counts when no answer comes). Invalid: `vat_id_invalid`, nothing
        is issued, also not with `acceptVatIdRisk`. No result yet: `vat_id_check_pending` with
        `data.retryAfter` (seconds, not `retryAfterSec`); nothing is issued, no number is used
        and no draft is left: send the same request with the same `idempotencyKey` after that
        time, or issue with `acceptVatIdRisk: true` (you carry the risk of an invalid VAT ID).
        `acceptVatIdRisk` is not part of the request for idempotency: sending it with the same
        key is no `idempotency_conflict`, and a later repeat without it returns the same
        invoice. The issued invoice carries the frozen check in `vatIdProof`, or `vatIdRisk`
        when issued at your risk (both `null` otherwise, on every invoice answer). `dryRun`
        does not check the VAT ID; credit notes never do.

        **Deposit.** With deposit switched on, a line with `articleId` gets the deposit lines of
        its article from the server, and a line with `deposit` is a deposit line of your own
        (see "Deposit on invoices" at the tag *Receipts*). Errors on a deposit line carry
        `data.index` (the line): `deposit_not_enabled`, `deposit_type_not_found`,
        `deposit_set_by_server`, `invalid_deposit_quantity`, `invalid_deposit`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params: { $ref: '#/components/schemas/IssueInvoiceParams' }
            examples:
              consulting:
                summary: 2 hours of consulting at 50.00 € net, 20 %
                value:
                  params:
                    idempotencyKey: "order-10023"
                    customerId: "k7Qx…"
                    priceMode: net
                    serviceStart: "2026-09-14"
                    items:
                      - { description: "Beratung", quantity: 2, unit: hour, kind: service, unitPriceCents: 5000, vatRate: 20 }
              issue_invoice_auto_deposit:
                summary: 24 cans with an article; the server adds the single-use deposit (Max Hollerer GmbH)
                value:
                  params:
                    idempotencyKey: "order-10031"
                    customerId: "customer_hollerer"
                    priceMode: gross
                    serviceStart: "2026-11-10"
                    items:
                      - { description: "Radler Dose 0,33 l", articleId: "art_radler_dose", quantity: 24, unitPriceCents: 120, vatRate: 20 }
              issue_invoice_explicit_deposit:
                summary: 24 cans without article; single-use deposit as a line of your own (Max Hollerer GmbH)
                value:
                  params:
                    idempotencyKey: "order-10032"
                    customerId: "customer_hollerer"
                    priceMode: gross
                    serviceStart: "2026-11-10"
                    items:
                      - { description: "Radler Dose 0,33 l", quantity: 24, unitPriceCents: 120, vatRate: 20 }
                      - { description: "Pfand Einweg", quantity: 24, unitPriceCents: 25, vatRate: 0, deposit: { depositTypeId: einweg, depositFor: 0 } }
      responses:
        "200":
          description: |
            `data: { invoice: Invoice, replayed, notice? }`, or with `dryRun`
            `data: { preview: InvoicePreview, notice? }`. `notice` is a list of
            `{ code, message }` with `code` `recapitulative_statement_due`,
            `place_of_supply_check`, `cash_receipt_required` or `reservation_expired` (then
            also `reservationId`: the reservation had expired, the line is sold without it);
            it is missing when there is nothing to say.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InvoiceEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          invoice: { $ref: '#/components/schemas/Invoice' }
                          preview: { $ref: '#/components/schemas/InvoicePreview' }
                          replayed: { type: boolean }
                          notice: { type: array, items: { type: object, properties: { code: { type: string, enum: [recapitulative_statement_due, place_of_supply_check, cash_receipt_required, reservation_expired] }, message: { type: string }, reservationId: { type: string, description: "Only with `reservation_expired`." } } } }
  /v3/cancelInvoice:
    post:
      operationId: cancelInvoice
      tags: [Invoices]
      summary: Cancel an invoice in full (credit note)
      description: |
        Creates a credit note over all lines; the invoice becomes `cancelled`. Amounts already
        paid stay on the invoice; refunding them is up to the business. Errors:
        `invoice_not_found`, `not_cancellable`, `partial_credit_exists` (credit the rest with
        `createCreditNote`).
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [idempotencyKey, invoiceId, reason]
                  properties:
                    idempotencyKey: { type: string, minLength: 1, maxLength: 120 }
                    invoiceId: { type: string }
                    reason: { $ref: '#/components/schemas/CreditNoteReason' }
                    note: { type: string }
      responses:
        "200":
          description: "`data: { creditNote: Invoice, original: { id, status }, originalPaidCents, replayed }`."
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InvoiceEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          creditNote: { $ref: '#/components/schemas/Invoice' }
                          original: { type: object, properties: { id: { type: string }, status: { type: string } } }
                          originalPaidCents: { type: integer }
                          replayed: { type: boolean }
  /v3/createCreditNote:
    post:
      operationId: createCreditNote
      tags: [Invoices]
      summary: Partial credit note
      description: |
        `items` like `issueInvoice`, with positive amounts. Tax scheme, price mode, recipient,
        language and brand come from the invoice. All credit notes together may never credit
        more than the invoice per VAT rate (§ 16 UStG), otherwise `credit_exceeds_invoice` with
        `data.remainingCents: { total, byRate }`. The invoice stays `final`.

        **Deposit.** `items[].deposit` works as on `issueInvoice`: a line with `deposit` is a
        deposit line for the line `depositFor` of the credit note, and a line with `articleId`
        gets its deposit lines from the server, from today's master data; the lines of a partial
        credit note are not linked to the lines of the invoice, so the deposit of the invoice is
        not copied (only `cancelInvoice` does that). Errors carry `data.index`:
        `deposit_not_enabled`, `deposit_type_not_found`, `deposit_set_by_server`,
        `invalid_deposit_quantity`, `invalid_deposit`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [idempotencyKey, invoiceId, reason, items]
                  properties:
                    idempotencyKey: { type: string, minLength: 1, maxLength: 120 }
                    invoiceId: { type: string }
                    reason: { $ref: '#/components/schemas/CreditNoteReason' }
                    note: { type: string }
                    items: { type: array, items: { $ref: '#/components/schemas/InvoiceItemInput' } }
            examples:
              credit_note_deposit:
                summary: 6 cans taken back, with their single-use deposit (Max Hollerer GmbH)
                value:
                  params:
                    idempotencyKey: "credit-10032"
                    invoiceId: "invoice_hollerer"
                    reason: return
                    items:
                      - { description: "Radler Dose 0,33 l", quantity: 6, unitPriceCents: 120, vatRate: 20 }
                      - { description: "Pfand Einweg", quantity: 6, unitPriceCents: 25, vatRate: 0, deposit: { depositTypeId: einweg, depositFor: 0 } }
      responses:
        "200":
          description: "`data: { creditNote: Invoice, remainingCents, replayed }`."
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InvoiceEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          creditNote: { $ref: '#/components/schemas/Invoice' }
                          remainingCents: { type: object }
                          replayed: { type: boolean }
  /v3/getInvoice:
    post:
      operationId: getInvoice
      tags: [Invoices]
      summary: Fetch an invoice or credit note
      description: |
        Exactly one of `invoiceId` or `number`, as a field of `params`. Drafts from the panel
        are not visible (`invoice_not_found`); a number that exists twice is
        `invoice_ambiguous` (use `invoiceId`).
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  properties:
                    invoiceId: { type: string }
                    number: { type: string }
      responses:
        "200":
          description: "`data: { invoice: InvoiceDetail }`."
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InvoiceEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          invoice: { $ref: '#/components/schemas/InvoiceDetail' }
  /v3/listInvoices:
    post:
      operationId: listInvoices
      tags: [Invoices]
      summary: List invoices and credit notes
      description: |
        Newest first. `open` and `overdue` depend on payments and on the day in Vienna, so a
        page can be shorter than `limit` and still carry a `nextCursor`: keep paging until it
        is `null`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  properties:
                    from: { type: string, format: date, description: Invoice date from (YYYY-MM-DD). }
                    to: { type: string, format: date }
                    status: { type: string, enum: [final, paid, cancelled, open, overdue] }
                    docType: { $ref: '#/components/schemas/InvoiceDocType' }
                    customerId: { type: string }
                    limit: { type: integer, minimum: 1, maximum: 100, default: 25 }
                    cursor: { type: string }
      responses:
        "200":
          description: "`data: { invoices: Invoice[], nextCursor }`."
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InvoiceEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          invoices: { type: array, items: { $ref: '#/components/schemas/Invoice' } }
                          nextCursor: { type: [string, "null"] }
  /v3/getInvoicePdf:
    post:
      operationId: getInvoicePdf
      tags: [Invoices]
      summary: Invoice PDF
      description: |
        The PDF (for imported invoices the uploaded original), with embedded Factur-X
        (PDF/A-3) when the data suffice for an e-invoice. With `language` other than the
        invoice's: the translation copy, same number, marked as a translation on every page,
        without embedded e-invoice. Errors come as the JSON envelope. An invoice paid in cash or
        by card on site carries the cash register part with the payment receipt below the
        invoice; while that receipt is still being created the answer is `cash_receipt_pending`
        with `retryAfter` (seconds): call again then.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [invoiceId]
                  properties:
                    invoiceId: { type: string }
                    language: { type: string, enum: [de, en] }
      responses:
        "200":
          description: PDF file, or the JSON envelope on error.
          content:
            application/pdf:
              schema: { type: string, format: binary }
            application/json:
              schema: { $ref: '#/components/schemas/InvoiceEnvelope' }
  /v3/getInvoiceXml:
    post:
      operationId: getInvoiceXml
      tags: [Invoices]
      summary: E-invoice XML (EN 16931)
      description: |
        `format` `ubl` (Peppol BIS Billing 3.0, default) or `cii` (UN/CEFACT CII as in
        Factur-X). If the data do not suffice: `einvoice_incomplete` with `data.missing` as
        codes (`EinvoiceMissing`); no e-invoice at all for this invoice:
        `einvoice_unavailable` with `data.reason`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [invoiceId]
                  properties:
                    invoiceId: { type: string }
                    format: { type: string, enum: [ubl, cii], default: ubl }
      responses:
        "200":
          description: "`data: { xml, format, filename }`; `filename` is `invoice-<number>.xml`."
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InvoiceEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          xml: { type: string }
                          format: { type: string, enum: [ubl, cii] }
                          filename: { type: string, example: invoice-2026-0042.xml }
  /v3/recordInvoicePayment:
    post:
      operationId: recordInvoicePayment
      tags: [Invoices]
      summary: Record a payment that arrived after issuing
      description: |
        `idempotencyKey` is required: without it a retry after a timeout would book twice.
        Errors: `invoice_not_found`, `not_payable` (cancelled, or a credit note),
        `payment_exceeds_invoice` (`data.remainingCents`), `idempotency_conflict`. A cash
        payment (`method: cash`, or `onSite: true`) is booked and the answer carries
        `cash_receipt_required` in `notice`: a cash sale also needs a receipt (§ 132a BAO).
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  allOf:
                    - { $ref: '#/components/schemas/InvoicePaymentInput' }
                    - type: object
                      required: [idempotencyKey, invoiceId]
                      properties:
                        idempotencyKey: { type: string, minLength: 1, maxLength: 120 }
                        invoiceId: { type: string }
      responses:
        "200":
          description: "`data: { invoice: Invoice, payment: { id, amountCents, paidAt, method, reference }, replayed, notice? }`."
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InvoiceEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          invoice: { $ref: '#/components/schemas/Invoice' }
                          payment: { type: object, properties: { id: { type: string }, amountCents: { type: integer }, paidAt: { type: string }, method: { type: string }, reference: { type: [string, "null"] } } }
                          replayed: { type: boolean }
                          notice: { type: array, items: { type: object, properties: { code: { type: string, enum: [recapitulative_statement_due, place_of_supply_check, cash_receipt_required] }, message: { type: string } } } }
  /v3/createInvoiceItem:
    post:
      operationId: createInvoiceItem
      tags: [Invoices]
      summary: Deliver an item to the billing basket
      description: |
        Meant for `/v3`; the `/v1` path exists but is deprecated from the start.

        Instead of issuing an invoice, a system delivers items. The daily run (09:00 Vienna) bundles all
        open items of a customer on the customer's invoice day (date rule on the customer, else the account
        default, else month end) into ONE invoice – direct debit with a valid mandate, else bank transfer
        (14 days, QR code). Items are only billed in accounts with an active billing run.

        `reference` is unique per `source`: the same reference with the same data returns the same item
        (`replayed: true`), other data fails with `item_reference_conflict`. A new source starts in review
        (`pending_review`); the account can switch it to automatic (`open` at once).

        If the account has no billing run (also in test environments without `settings/sepa`), the item is
        accepted but stays put; the answer then carries `data.notice` with `billing_run_off`.
        Attachments: at most 3 files (CSV or PDF), 2 MB each (`attachment_too_large`); the run attaches them
        to the invoice mail.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params: { $ref: '#/components/schemas/BasketItemInput' }
      responses:
        "200":
          description: "`data: { item: InvoiceItem, replayed, notice?: [{ code, message }] }`."
          content:
            application/json:
              schema: { $ref: '#/components/schemas/InvoiceItemEnvelope' }
  /v3/updateInvoiceItem:
    post:
      operationId: updateInvoiceItem
      tags: [Invoices]
      summary: Change an item that is not invoiced yet
      description: Only while `pending_review` or `open`. In a source with review, a changed item needs a new approval. Errors `item_not_found`, `item_already_invoiced`, `item_withdrawn`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [itemId]
                  properties:
                    itemId: { type: string }
                    description: { type: string, maxLength: 300 }
                    subtitle: { type: string, maxLength: 1000 }
                    quantity: { type: number, exclusiveMinimum: 0, maximum: 1000000000 }
                    unit: { $ref: '#/components/schemas/InvoiceUnit' }
                    kind: { type: string, enum: [goods, service] }
                    unitPriceCents: { type: integer, minimum: -100000000, maximum: 100000000 }
                    unitPriceMicros: { type: integer, minimum: -1000000000000, maximum: 1000000000000 }
                    vatRate: { type: integer, enum: [0, 10, 13, 20] }
                    discountPct: { type: number, minimum: 0, maximum: 100 }
                    serviceStart: { type: string, format: date }
                    serviceEnd: { type: string, format: date }
                    metadata: { type: object, maxProperties: 20, propertyNames: { pattern: '^[a-zA-Z0-9_]{1,40}$' }, additionalProperties: { type: string, maxLength: 500 } }
      responses:
        "200":
          description: "`data: { item: InvoiceItem }`."
          content:
            application/json:
              schema: { $ref: '#/components/schemas/InvoiceItemEnvelope' }
  /v3/withdrawInvoiceItem:
    post:
      operationId: withdrawInvoiceItem
      tags: [Invoices]
      summary: Withdraw an item before it is invoiced
      description: Repeatable. An invoiced item stays (`item_already_invoiced`) – correct it with a new negative item or a credit note.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params: { type: object, required: [itemId], properties: { itemId: { type: string } } }
      responses:
        "200":
          description: "`data: { item: InvoiceItem }`."
          content:
            application/json:
              schema: { $ref: '#/components/schemas/InvoiceItemEnvelope' }
  /v3/getInvoiceItem:
    post:
      operationId: getInvoiceItem
      tags: [Invoices]
      summary: Read one item
      description: By `itemId`, or by `source` + `reference`. Error `item_not_found`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  properties:
                    itemId: { type: string }
                    source: { type: string }
                    reference: { type: string }
      responses:
        "200":
          description: "`data: { item: InvoiceItem }`."
          content:
            application/json:
              schema: { $ref: '#/components/schemas/InvoiceItemEnvelope' }
  /v3/listInvoiceItems:
    post:
      operationId: listInvoiceItems
      tags: [Invoices]
      summary: List items
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  properties:
                    source: { type: string }
                    customerId: { type: string }
                    status: { type: string, enum: [pending_review, open, invoiced, withdrawn] }
                    serviceMonth: { type: string, pattern: '^\\d{4}-(0[1-9]|1[0-2])$', description: YYYY-MM }
                    limit: { type: integer, minimum: 1, maximum: 100, description: Default 50. }
                    cursor: { type: string }
      responses:
        "200":
          description: "`data: { items: InvoiceItem[], nextCursor }`."
          content:
            application/json:
              schema: { $ref: '#/components/schemas/InvoiceItemEnvelope' }
  /v3/setCustomerMandate:
    post:
      operationId: setCustomerMandate
      tags: [Invoices]
      summary: Store or replace the SEPA mandate of a customer
      description: |
        Without a valid mandate the customer pays by bank transfer. `sequence: recurring` means the
        mandate was already used for a direct debit elsewhere (no FRST any more). Invalid IBAN, BIC or
        mandate reference, or a `signedAt` in the future: `mandate_invalid`. The answer never contains the
        full IBAN, only `ibanMasked`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [customerId, mandateReference, signedAt, iban, scheme, sequence]
                  properties:
                    customerId: { type: string }
                    mandateReference: { type: string, maxLength: 35, description: SEPA character set. }
                    signedAt: { type: string, format: date, description: Not in the future. }
                    iban: { type: string, maxLength: 42 }
                    bic: { type: string, maxLength: 11 }
                    accountHolder: { type: string, maxLength: 70, description: Default is the name of the customer. }
                    scheme: { type: string, enum: [core, b2b] }
                    sequence: { type: string, enum: [first, recurring] }
      responses:
        "200":
          description: "`data: { mandate: CustomerMandate }`."
          content:
            application/json:
              schema: { $ref: '#/components/schemas/InvoiceItemEnvelope' }
  /v3/revokeCustomerMandate:
    post:
      operationId: revokeCustomerMandate
      tags: [Invoices]
      summary: Revoke the SEPA mandate of a customer
      description: Repeatable. The customer pays by bank transfer from the next invoice on.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params: { type: object, required: [customerId], properties: { customerId: { type: string } } }
      responses:
        "200":
          description: "`data: { mandate: null }`."
          content:
            application/json:
              schema: { $ref: '#/components/schemas/InvoiceItemEnvelope' }
  /v3/getArticle:
    post:
      operationId: getArticle
      tags: [Inventory]
      summary: Read one article
      description: |
        Errors: `article_not_found` (also for an ID of another account), `validation`, and the
        codes every inventory endpoint can return (see `InventoryErrorCode`).
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [articleId]
                  additionalProperties: false
                  properties:
                    articleId: { type: string }
            examples:
              article:
                value: { params: { articleId: "beispiel_roggenbrot" } }
      responses:
        "200":
          description: "`data: { article: Article }`."
          headers:
            Retry-After: { $ref: '#/components/headers/RetryAfter' }
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InventoryEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          article: { $ref: '#/components/schemas/Article' }
              examples:
                article:
                  value:
                    status: success
                    message: ""
                    data:
                      article: { id: beispiel_roggenbrot, name: "Roggenbrot 1 kg", description: null, unitPriceCents: 450, vatRate: 10, unit: Stk, number: A-100, ean: "9001234567896", internalCode: null, groupId: brot, revenueGroupId: null, stockTracked: true, stockKind: quantity, minStock: null, active: true, createdAt: "2026-10-01T06:00:00.000Z", updatedAt: "2026-10-06T08:15:00.000Z", stockLocationIds: [haupt], minStockByLocation: { haupt: 5000 } }
  /v3/listArticles:
    post:
      operationId: listArticles
      tags: [Inventory]
      summary: List articles, also changed ones since a point in time
      description: |
        Sorted by `updatedAt` ascending (same time: by `id`). With `updatedSince` only articles
        changed at or after that moment (**inclusive**, `>=`); repeat with the `updatedAt` of
        the last article you processed to stay in sync without gaps. Deactivated articles are
        listed too (`active: false`) unless you filter with `active: true`. With
        `variantGroupId` only the variants of that group (also together with
        `updatedSince`); an unknown group gives an empty list.

        Errors: `validation` (unknown filter, wrong type, `limit` outside 1–200, a time that is
        not ISO 8601), `invalid_cursor`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  additionalProperties: false
                  properties:
                    updatedSince: { type: string, format: date-time, description: "ISO 8601, inclusive." }
                    groupId: { type: string, description: Article group. }
                    variantGroupId: { type: string, description: "Only the variants of this variant group (`createVariantGroup`)." }
                    active: { type: boolean }
                    stockTracked: { type: boolean, description: Only articles whose stock is tracked (true) or not (false). }
                    limit: { $ref: '#/components/schemas/PageLimit' }
                    cursor: { type: string, description: "`nextCursor` of the previous page." }
            examples:
              sync:
                summary: Everything changed since the last sync
                value: { params: { updatedSince: "2026-10-06T08:15:00.000Z", limit: 200 } }
              variants:
                summary: The variants of one variant group
                value: { params: { variantGroupId: beispiel_schuerze } }
      responses:
        "200":
          description: "`data: { articles: Article[], nextCursor }`."
          headers:
            Retry-After: { $ref: '#/components/headers/RetryAfter' }
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InventoryEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          articles: { type: array, items: { $ref: '#/components/schemas/Article' } }
                          nextCursor: { $ref: '#/components/schemas/NextCursor' }
  /v3/lookupArticleByCode:
    post:
      operationId: lookupArticleByCode
      tags: [Inventory]
      summary: Find an active article by code or by the ID in your own system
      description: |
        Either `code` (article number, EAN or internal code, exactly as stored) or
        `externalSystem` with `externalId` (an entry in `externalIds` of the article, e.g.
        `{ "externalSystem": "shop", "externalId": "4711" }`), never both. A deactivated
        article counts as not found.

        Errors: `article_not_found`, `validation` (both or neither given, `externalSystem` not
        `^[a-z0-9_]{1,32}$`).
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  additionalProperties: false
                  properties:
                    code: { type: string, maxLength: 128 }
                    externalSystem: { type: string, pattern: '^[a-z0-9_]{1,32}$' }
                    externalId: { type: string, maxLength: 128 }
            examples:
              ean:
                summary: By EAN
                value: { params: { code: "9001234567896" } }
              shop:
                summary: By the ID in the shop
                value: { params: { externalSystem: shop, externalId: "4711" } }
      responses:
        "200":
          description: "`data: { article: Article }`."
          headers:
            Retry-After: { $ref: '#/components/headers/RetryAfter' }
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InventoryEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          article: { $ref: '#/components/schemas/Article' }
  /v3/createArticle:
    post:
      operationId: createArticle
      tags: [Inventory]
      summary: Create an article
      description: |
        Writing call: needs „Lager-API schreiben“ for the account (`inventory_api_not_enabled`)
        and an `idempotencyKey`. With `ean` the article is a foreign article with that code;
        without it it gets the next internal code of the account. The answer is the article
        exactly as `getArticle` returns it; `article.created` follows for webhooks. Variants
        are created with `createVariantGroup` or `addVariant`; `variantGroupId` and
        `variantAttributes` here are `validation`.

        Errors: `validation` (also several fields at once in `data.errors`), `code_taken`,
        `external_id_taken`, `group_not_found`, `revenue_group_not_found`,
        `location_not_found`, `idempotency_conflict`, `idempotency_key_required`,
        `inventory_api_not_enabled`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  allOf:
                    - type: object
                      required: [idempotencyKey, name]
                      properties:
                        idempotencyKey: { $ref: '#/components/schemas/InventoryIdempotencyKey' }
                    - $ref: '#/components/schemas/ArticleWriteFields'
            examples:
              own:
                summary: Own article with a minimum stock and the ID in the shop
                value: { params: { idempotencyKey: "shop-artikel-1001", name: Kaisersemmel, description: "Handgeschlagen, mit Mohn bestreut", unitPriceCents: 65, vatRate: 10, stockTracked: true, stockLocationIds: [haupt], minStockByLocation: { haupt: 20000 }, externalIds: { shop: "1001" }, metadata: { seoSlug: kaisersemmel-mohn } } }
              foreign:
                summary: Foreign article with its EAN
                value: { params: { idempotencyKey: "shop-artikel-1002", name: "Bio-Hafermilch 1 l", ean: "9001234567810", unitPriceCents: 249, vatRate: 10, stockTracked: true, stockKind: quantity } }
      responses:
        "200":
          description: "`data: { article: Article }`."
          headers:
            Retry-After: { $ref: '#/components/headers/RetryAfter' }
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InventoryEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          article: { $ref: '#/components/schemas/Article' }
              examples:
                own:
                  value:
                    status: success
                    message: ""
                    data:
                      article: { id: beispiel_kaisersemmel, name: Kaisersemmel, description: "Handgeschlagen, mit Mohn bestreut", unitPriceCents: 65, vatRate: 10, unit: Stk, number: null, ean: null, internalCode: "1", groupId: null, revenueGroupId: null, stockTracked: true, stockKind: quantity, minStock: null, active: true, externalIds: { shop: "1001" }, metadata: { seoSlug: kaisersemmel-mohn }, createdAt: "2026-10-06T06:01:32.000Z", updatedAt: "2026-10-06T06:01:32.000Z", stockLocationIds: [haupt], minStockByLocation: { haupt: 20000 } }
  /v3/updateArticle:
    post:
      operationId: updateArticle
      tags: [Inventory]
      summary: Change an article (only the given fields)
      description: |
        Writing call (see `createArticle`). Only the given fields change, at least one is
        required (`validation`); `null` clears an optional field (see `ArticleWriteFields`).
        `externalIds` and `metadata` are replaced as a whole, `minStockByLocation` is merged
        per location. `stockKind` is fixed after the first stock movement
        (`stock_kind_locked`). The answer is the article as `getArticle` returns it;
        `article.updated` follows for webhooks. A variant is changed like any article, but
        `variantGroupId` and `variantAttributes` cannot be changed (`validation`).

        Errors: `article_not_found`, `article_inactive` (deactivated articles cannot be
        changed), `validation`, `code_taken`, `external_id_taken`, `group_not_found`,
        `revenue_group_not_found`, `location_not_found`, `stock_kind_locked`,
        `idempotency_conflict`, `idempotency_key_required`, `inventory_api_not_enabled`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  allOf:
                    - type: object
                      required: [idempotencyKey, articleId]
                      properties:
                        idempotencyKey: { $ref: '#/components/schemas/InventoryIdempotencyKey' }
                        articleId: { type: string }
                    - $ref: '#/components/schemas/ArticleWriteFields'
            examples:
              price:
                summary: New price, description removed, other metadata
                value: { params: { idempotencyKey: "shop-update-1001-1", articleId: beispiel_kaisersemmel, unitPriceCents: 70, description: null, metadata: { seoSlug: kaisersemmel } } }
              minimum:
                summary: Minimum stock moves from the shop to the van
                value: { params: { idempotencyKey: "shop-update-1001-2", articleId: beispiel_kaisersemmel, minStockByLocation: { haupt: null, lieferwagen: 10000 } } }
      responses:
        "200":
          description: "`data: { article: Article }`."
          headers:
            Retry-After: { $ref: '#/components/headers/RetryAfter' }
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InventoryEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          article: { $ref: '#/components/schemas/Article' }
  /v3/deactivateArticle:
    post:
      operationId: deactivateArticle
      tags: [Inventory]
      summary: Deactivate an article
      description: |
        Writing call (see `createArticle`). The article stays readable with `active: false`,
        its code and its `externalIds` become free for other articles, and remaining stock
        can still be booked. Deactivating a deactivated article returns it unchanged. There
        is no way back through the API. `article.deactivated` follows for webhooks.
        Deactivating a variant of an active variant group takes it out of the group's
        `variants` (`variant_group.updated` follows) and frees its combination for
        `addVariant`.

        Errors: `article_not_found`, `validation`, `idempotency_conflict`,
        `idempotency_key_required`, `inventory_api_not_enabled`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [idempotencyKey, articleId]
                  additionalProperties: false
                  properties:
                    idempotencyKey: { $ref: '#/components/schemas/InventoryIdempotencyKey' }
                    articleId: { type: string }
            examples:
              deactivate:
                value: { params: { idempotencyKey: "shop-deactivate-1001", articleId: beispiel_kaisersemmel } }
      responses:
        "200":
          description: "`data: { article: Article }` with `active: false`."
          headers:
            Retry-After: { $ref: '#/components/headers/RetryAfter' }
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InventoryEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          article: { $ref: '#/components/schemas/Article' }
  /v3/listLocations:
    post:
      operationId: listLocations
      tags: [Inventory]
      summary: List the stock locations
      description: |
        All locations of the account, also inactive ones. The main location has the ID
        `haupt`; as long as it was never edited it is listed with `virtual: true`. Takes no
        parameters (`validation` for any).
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema: { $ref: '#/components/schemas/EmptyParams' }
      responses:
        "200":
          description: "`data: { locations: Location[] }`."
          headers:
            Retry-After: { $ref: '#/components/headers/RetryAfter' }
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InventoryEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          locations: { type: array, items: { $ref: '#/components/schemas/Location' } }
              examples:
                locations:
                  value:
                    status: success
                    message: ""
                    data:
                      locations:
                        - { id: haupt, name: Hauptstandort, type: store, address: { street: "Kornweg 5", zip: "1010", city: Wien, country: AT }, licensePlate: null, active: true }
                        - { id: lieferwagen, name: "Lieferwagen W-12345", type: vehicle, address: null, licensePlate: "W-12345", active: true }
  /v3/getStock:
    post:
      operationId: getStock
      tags: [Inventory]
      summary: Stock of one article at every location
      description: |
        One `StockLevel` per location that ever held the article; a location without a row
        has nothing. With purchase values enabled the answer also carries `values[]`.

        Errors: `article_not_found`, `validation`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [articleId]
                  additionalProperties: false
                  properties:
                    articleId: { type: string }
            examples:
              stock:
                value: { params: { articleId: "beispiel_roggenbrot" } }
      responses:
        "200":
          description: "`data: { stock: StockLevel[], values?: StockValue[] }`."
          headers:
            Retry-After: { $ref: '#/components/headers/RetryAfter' }
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InventoryEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          stock: { type: array, items: { $ref: '#/components/schemas/StockLevel' } }
                          values: { type: array, items: { $ref: '#/components/schemas/StockValue' }, description: Only with purchase values enabled. }
              examples:
                stock:
                  value:
                    status: success
                    message: ""
                    data:
                      stock:
                        - { articleId: beispiel_roggenbrot, locationId: haupt, onHand: 12000, reserved: 0, available: 12000, defective: 0, sequence: 42, updatedAt: "2026-10-06T08:15:00.000Z" }
                        - { articleId: beispiel_roggenbrot, locationId: lieferwagen, onHand: 3000, reserved: 0, available: 3000, defective: 1000, sequence: 7, updatedAt: "2026-10-05T14:02:11.000Z" }
  /v3/listStock:
    post:
      operationId: listStock
      tags: [Inventory]
      summary: List stock levels, also changed ones since a point in time
      description: |
        With `changedSince`: only stock levels changed at or after that moment
        (**inclusive**, `>=`), sorted by `updatedAt` ascending (same time: in a fixed internal
        order); that is the safety net next to `stock.changed`. Stock levels last written
        before the inventory API existed carry no change time and are only listed without
        `changedSince`: do one full pass without it first. Without `changedSince` the order
        is fixed but not by time.

        `belowMinimum: true` lists only stock levels whose `available` (on hand minus
        reserved) is below the minimum stock set for their location (`minStockByLocation`,
        the rule of `stock.below_minimum`; the legacy `minStock` of the article does not
        count), `false` only the others.

        Errors: `validation`, `invalid_cursor`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  additionalProperties: false
                  properties:
                    locationId: { type: string }
                    articleId: { type: string }
                    belowMinimum: { type: boolean }
                    changedSince: { type: string, format: date-time, description: "ISO 8601, inclusive." }
                    limit: { $ref: '#/components/schemas/PageLimit' }
                    cursor: { type: string, description: "`nextCursor` of the previous page." }
            examples:
              sync:
                summary: Every stock level changed since the last sync
                value: { params: { changedSince: "2026-10-06T08:15:00.000Z", limit: 200 } }
              location:
                summary: Everything in the van
                value: { params: { locationId: lieferwagen } }
      responses:
        "200":
          description: "`data: { stock: StockLevel[], nextCursor, values?: StockValue[] }`."
          headers:
            Retry-After: { $ref: '#/components/headers/RetryAfter' }
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InventoryEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          stock: { type: array, items: { $ref: '#/components/schemas/StockLevel' } }
                          nextCursor: { $ref: '#/components/schemas/NextCursor' }
                          values: { type: array, items: { $ref: '#/components/schemas/StockValue' }, description: "Only with purchase values enabled: one entry per article of this page." }
  /v3/listStockMovements:
    post:
      operationId: listStockMovements
      tags: [Inventory]
      summary: List stock movements (the stock ledger)
      description: |
        Newest first. Filter by `articleId` **or** `locationId` (not both, `validation`), by
        time (`from` and `to`, both inclusive), by `type` and by `source.type` (`source`);
        `source: api` lists what was booked through this API. Reservations appear as
        movements of type `reservation` with `quantityDelta: 0` and the change of the
        reserved quantity in `reservedDelta` (`stockAfter.reserved` is the reserved quantity
        after it).

        Errors: `validation` (also for an unknown `type` or `source`), `invalid_cursor`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  additionalProperties: false
                  properties:
                    articleId: { type: string }
                    locationId: { type: string }
                    from: { type: string, format: date-time, description: "ISO 8601, inclusive." }
                    to: { type: string, format: date-time, description: "ISO 8601, inclusive." }
                    type: { $ref: '#/components/schemas/StockMovementType' }
                    source: { $ref: '#/components/schemas/StockMovementSource' }
                    limit: { $ref: '#/components/schemas/PageLimit' }
                    cursor: { type: string, description: "`nextCursor` of the previous page." }
            examples:
              day:
                summary: Sales of one article on one day
                value: { params: { articleId: "beispiel_roggenbrot", from: "2026-10-05T22:00:00.000Z", to: "2026-10-06T21:59:59.999Z", type: sale } }
      responses:
        "200":
          description: "`data: { movements: StockMovement[], nextCursor }`."
          headers:
            Retry-After: { $ref: '#/components/headers/RetryAfter' }
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InventoryEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          movements: { type: array, items: { $ref: '#/components/schemas/StockMovement' } }
                          nextCursor: { $ref: '#/components/schemas/NextCursor' }
  /v3/receiveGoods:
    post:
      operationId: receiveGoods
      tags: [Inventory]
      summary: Book a goods receipt (with prices, landed costs, lots)
      description: |
        Writing call: needs „Lager-API schreiben“ (`inventory_api_not_enabled`) and an
        `idempotencyKey`. Books the goods into sellable stock at `locationId` (default: the
        default location of the account, usually `haupt`), one movement `goods_receipt` per
        line, with the source `api`.

        **Prices.** Per line either `totalCents` (value of the line) or `unitPriceMicros`
        (per base unit), not both; without a price the standard purchase price of the article
        is used. `landedCosts` (`freight`, `customs`, `insurance`, `other`; `discount` and
        `cash_discount` reduce the value) are spread over the lines by `allocation`: `value` (default),
        `quantity`, `weight` or `manual` (then `items[].landedCostCents`). Prices may be sent
        without „Einkaufswerte per API“: the stock gets its value and nothing is revealed.
        Values come back only with that switch, in the preview.

        **Preview.** `dryRun: true` checks lines, articles, prices and landed costs and returns
        `data.preview` without writing anything; it needs the writing switch but no
        `idempotencyKey` (one that is sent is only checked for its form). The location is
        checked by the real booking only.

        Errors: `validation`, `article_not_found`, `location_not_found`, `location_inactive`,
        `invalid_quantity`, `too_many_positions`, `invalid_landed_cost`,
        `invalid_distribution`, `weight_missing`, `landed_costs_mismatch`,
        `serial_required`, `serial_not_allowed`, `serial_already_exists`, `invalid_serial`,
        `idempotency_conflict`, `idempotency_key_required`, `inventory_api_not_enabled`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [items]
                  additionalProperties: false
                  properties:
                    idempotencyKey: { $ref: '#/components/schemas/InventoryIdempotencyKey' }
                    items:
                      type: array
                      minItems: 1
                      maxItems: 80
                      items:
                        type: object
                        required: [articleId, quantity]
                        additionalProperties: false
                        properties:
                          articleId: { type: string }
                          quantity: { type: integer, description: Thousandths of the base unit. }
                          totalCents: { type: integer, description: "Value of the line in cents (not with `unitPriceMicros`)." }
                          unitPriceMicros: { type: integer, description: "Purchase price per base unit in micro-euros (not with `totalCents`)." }
                          landedCostCents: { type: integer, description: "Share of the landed costs, only with `allocation: manual`." }
                          expiresOn: { type: string, format: date, description: "Best before / use by, `YYYY-MM-DD`." }
                          batch: { type: string, minLength: 1, maxLength: 64 }
                          serialNumbers: { type: array, maxItems: 80, items: { type: string, minLength: 1, maxLength: 128 }, description: "For `stockKind: serial`: one per item." }
                    locationId: { type: string }
                    landedCosts:
                      type: array
                      maxItems: 20
                      items:
                        type: object
                        required: [type, amountCents]
                        additionalProperties: false
                        properties:
                          type: { type: string, enum: [freight, customs, insurance, other, discount, cash_discount] }
                          amountCents: { type: integer }
                    allocation: { type: string, enum: [value, quantity, weight, manual], default: value }
                    supplier:
                      type: object
                      required: [name]
                      additionalProperties: false
                      properties:
                        name: { type: string, minLength: 1, maxLength: 120 }
                        address: { type: string, minLength: 1, maxLength: 300 }
                    reference: { type: string, minLength: 1, maxLength: 80, description: Delivery note or invoice number of the supplier. }
                    note: { type: string, minLength: 1, maxLength: 500 }
                    dryRun: { type: boolean, description: "Preview only, nothing is written." }
            examples:
              delivery:
                summary: Delivery with a lot, two prices and landed costs
                value: { params: { idempotencyKey: "shop-we-118", items: [{ articleId: beispiel_roggenbrot, quantity: 20000, totalCents: 2400, expiresOn: "2026-10-12", batch: "C-41" }, { articleId: beispiel_kipferl, quantity: 60000, unitPriceMicros: 380000 }], landedCosts: [{ type: freight, amountCents: 450 }, { type: cash_discount, amountCents: 50 }], allocation: value, supplier: { name: "Mühle Hollerer", address: "Mühlgasse 4, 5020 Salzburg" }, reference: "LS-2026-118", note: "Frühlieferung" } }
      responses:
        "200":
          description: "`data: StockBooking`, or with `dryRun` `data: { preview: ReceiveGoodsPreviewLine[] }`."
          headers:
            Retry-After: { $ref: '#/components/headers/RetryAfter' }
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InventoryEnvelope'
                  - type: object
                    properties:
                      data:
                        anyOf:
                          - $ref: '#/components/schemas/StockBooking'
                          - type: object
                            properties:
                              preview: { type: array, items: { $ref: '#/components/schemas/ReceiveGoodsPreviewLine' } }
              examples:
                booked:
                  value:
                    status: success
                    message: ""
                    data: { operationId: beispiel_vorgang_118, movementIds: [beispiel_vorgang_118_0, beispiel_vorgang_118_1], lotIds: [beispiel_vorgang_118_L0, beispiel_vorgang_118_L1], warnings: [] }
                previewWithValues:
                  summary: "`dryRun: true` with purchase values enabled"
                  value:
                    status: success
                    message: ""
                    data:
                      preview:
                        - { articleId: beispiel_roggenbrot, quantity: 20000, expiresOn: "2026-10-12", batch: "C-41", serialNumbers: [], priceFromArticle: false, baseCents: 2400, landedCostCents: 205, valueCents: 2605, unitCostMicros: 1302500 }
                        - { articleId: beispiel_kipferl, quantity: 60000, expiresOn: null, batch: null, serialNumbers: [], priceFromArticle: false, baseCents: 2280, landedCostCents: 195, valueCents: 2475, unitCostMicros: 412500 }
  /v3/transferStock:
    post:
      operationId: transferStock
      tags: [Inventory]
      summary: Move stock from one location to another
      description: |
        Writing call (see `receiveGoods`). Moves sellable stock with its lots and value; one
        movement `transfer_out` and one `transfer_in` per line. Never overdraws the source
        (`exceeds_stock`, nothing is booked).

        Errors: `validation`, `article_not_found`, `location_not_found`, `location_inactive`,
        `invalid_transfer` (same location), `exceeds_stock`, `invalid_quantity`,
        `too_many_positions`, `serial_required`, `serial_not_in_stock`,
        `idempotency_conflict`, `idempotency_key_required`, `inventory_api_not_enabled`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [idempotencyKey, fromLocationId, toLocationId, items]
                  additionalProperties: false
                  properties:
                    idempotencyKey: { $ref: '#/components/schemas/InventoryIdempotencyKey' }
                    fromLocationId: { type: string }
                    toLocationId: { type: string }
                    items: { type: array, minItems: 1, maxItems: 80, items: { $ref: '#/components/schemas/StockBookingItem' } }
                    note: { type: string, minLength: 1, maxLength: 500 }
            examples:
              van:
                summary: Load the van
                value: { params: { idempotencyKey: "shop-um-1", fromLocationId: haupt, toLocationId: lieferwagen, items: [{ articleId: beispiel_kipferl, quantity: 24000 }], note: "Tour Nord" } }
      responses:
        "200":
          description: "`data: StockBooking`."
          headers:
            Retry-After: { $ref: '#/components/headers/RetryAfter' }
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InventoryEnvelope'
                  - type: object
                    properties:
                      data: { $ref: '#/components/schemas/StockBooking' }
  /v3/recordStockLoss:
    post:
      operationId: recordStockLoss
      tags: [Inventory]
      summary: Book a loss (breakage, shrinkage, theft, expiry, withdrawal, disposal)
      description: |
        Writing call (see `receiveGoods`). Takes stock out at `locationId` (default: the
        default location) from the `condition` given (`sellable`, default, or `defective`),
        one movement `loss` per line. Never overdraws (`exceeds_stock`).

        `reason`: `breakage`, `shrinkage`, `theft`, `expired`, `withdrawal`, `disposal` or
        `other` (then `note` is required: `note_required`). A `withdrawal` (goods taken for
        private use, staff, gifts or samples) needs `withdrawalType` (`private`, `staff`,
        `gift`, `sample`; else `withdrawal_type_required`); `withdrawalType` with another
        reason is `validation`. The value of a withdrawal is the replacement price, else the
        last, else the standard purchase price of the article.

        Errors: `validation`, `article_not_found`, `location_not_found`, `invalid_reason`,
        `note_required`, `withdrawal_type_required`, `invalid_condition`, `exceeds_stock`,
        `invalid_quantity`, `too_many_positions`, `serial_required`, `serial_not_in_stock`,
        `idempotency_conflict`, `idempotency_key_required`, `inventory_api_not_enabled`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [idempotencyKey, reason, items]
                  additionalProperties: false
                  properties:
                    idempotencyKey: { $ref: '#/components/schemas/InventoryIdempotencyKey' }
                    reason: { type: string, enum: [breakage, shrinkage, theft, expired, withdrawal, disposal, other] }
                    withdrawalType: { type: string, enum: [private, staff, gift, sample], description: "Only and always with `reason: withdrawal`." }
                    condition: { type: string, enum: [sellable, defective], default: sellable }
                    locationId: { type: string }
                    items: { type: array, minItems: 1, maxItems: 80, items: { $ref: '#/components/schemas/StockBookingItem' } }
                    note: { type: string, minLength: 1, maxLength: 500 }
            examples:
              breakage:
                value: { params: { idempotencyKey: "shop-ab-1", reason: breakage, items: [{ articleId: beispiel_roggenbrot, quantity: 20000 }] } }
              staff:
                summary: Withdrawal for the staff
                value: { params: { idempotencyKey: "shop-ab-2", reason: withdrawal, withdrawalType: staff, items: [{ articleId: beispiel_kipferl, quantity: 2000 }] } }
      responses:
        "200":
          description: "`data: StockBooking`."
          headers:
            Retry-After: { $ref: '#/components/headers/RetryAfter' }
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InventoryEnvelope'
                  - type: object
                    properties:
                      data: { $ref: '#/components/schemas/StockBooking' }
              examples:
                belowMinimum:
                  summary: Booked, now below the minimum stock
                  value:
                    status: success
                    message: ""
                    data: { operationId: beispiel_vorgang_37, movementIds: [beispiel_vorgang_37_0], lotIds: [], warnings: [{ code: below_minimum, articleId: beispiel_roggenbrot, locationId: haupt, message: "Roggenbrot 1 kg: unter dem Mindestbestand." }] }
  /v3/changeStockCondition:
    post:
      operationId: changeStockCondition
      tags: [Inventory]
      summary: Mark stock as defective, or as sellable again
      description: |
        Writing call (see `receiveGoods`). Moves stock between the conditions `sellable` and
        `defective` at one location (default: the default location); one movement
        `condition_out` and one `condition_in` per line. Never overdraws (`exceeds_stock`).

        Errors: `validation`, `article_not_found`, `location_not_found`,
        `invalid_condition`, `exceeds_stock`, `invalid_quantity`, `too_many_positions`,
        `serial_required`, `serial_not_in_stock`, `idempotency_conflict`,
        `idempotency_key_required`, `inventory_api_not_enabled`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [idempotencyKey, from, to, items]
                  additionalProperties: false
                  properties:
                    idempotencyKey: { $ref: '#/components/schemas/InventoryIdempotencyKey' }
                    from: { type: string, enum: [sellable, defective] }
                    to: { type: string, enum: [sellable, defective] }
                    locationId: { type: string }
                    items: { type: array, minItems: 1, maxItems: 80, items: { $ref: '#/components/schemas/StockBookingItem' } }
                    note: { type: string, minLength: 1, maxLength: 500 }
            examples:
              defective:
                value: { params: { idempotencyKey: "shop-zu-1", from: sellable, to: defective, items: [{ articleId: beispiel_kipferl, quantity: 3000 }] } }
      responses:
        "200":
          description: "`data: StockBooking`."
          headers:
            Retry-After: { $ref: '#/components/headers/RetryAfter' }
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InventoryEnvelope'
                  - type: object
                    properties:
                      data: { $ref: '#/components/schemas/StockBooking' }
  /v3/reverseStockMovement:
    post:
      operationId: reverseStockMovement
      tags: [Inventory]
      summary: Reverse a whole booking
      description: |
        Writing call (see `receiveGoods`). Books the opposite of every movement of the
        booking `operationId` (movements of type `reversal`); the original stays as it is.
        Goods receipts, transfers, losses and condition changes can be reversed; sales,
        invoices, reservations and revaluations cannot (`reversal_not_supported`), and a
        booking is reversed once only (`already_reversed`). A goods receipt whose stock was
        partly sold already is `reversal_not_possible`: book a loss instead.

        Errors: `validation`, `operation_not_found`, `already_reversed`,
        `reversal_not_supported`, `reversal_not_possible`, `reason_required`,
        `exceeds_stock`, `idempotency_conflict`, `idempotency_key_required`,
        `inventory_api_not_enabled`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [idempotencyKey, operationId, reason]
                  additionalProperties: false
                  properties:
                    idempotencyKey: { $ref: '#/components/schemas/InventoryIdempotencyKey' }
                    operationId: { type: string, description: "`operationId` of the booking (answer of the booking or `listStockMovements`)." }
                    reason: { type: string, maxLength: 500, description: "Why; required, an empty text is `reason_required`." }
            examples:
              reverse:
                value: { params: { idempotencyKey: "shop-gb-1", operationId: beispiel_vorgang_40, reason: "Doch einwandfrei" } }
      responses:
        "200":
          description: "`data: StockBooking` of the reversal."
          headers:
            Retry-After: { $ref: '#/components/headers/RetryAfter' }
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InventoryEnvelope'
                  - type: object
                    properties:
                      data: { $ref: '#/components/schemas/StockBooking' }
  /v3/createReservation:
    post:
      operationId: createReservation
      tags: [Inventory]
      summary: Reserve stock for an order
      description: |
        Writing call: needs „Lager-API schreiben“ (`inventory_api_not_enabled`) and an
        `idempotencyKey`. Holds stock-tracked articles for an order: `reserved` grows and
        `available` shrinks at each location (movement `reservation` with `reservedDelta`,
        `stock.changed` with `cause: reservation`). **All or nothing**: if `available` does
        not cover every line, nothing is reserved and the answer is `insufficient_available`
        with `data.details` for the lines that fail. Lines without `locationId` use the
        default location of the account. Lines with the same article and location are added
        up.

        The reservation expires after `expiresInMinutes` (5–43 200, that is up to 30 days;
        default: the reservation period set for the account, else 7 days). Then the open
        quantity goes back to `available` and `reservation.expired` is sent. Redeem it by
        issuing the invoice of the order with `issueInvoice`, `items[].reservationId` and the
        same `stockLocationId`; release it with `releaseReservation` when the order is
        cancelled.

        Errors: `validation` (also for an article that is not stock-tracked, field
        `items[i].articleId`), `insufficient_available`, `article_not_found`,
        `article_inactive`, `location_not_found`, `location_inactive`, `too_many_positions`
        (more than 50 lines), `no_positions`, `invalid_quantity`, `idempotency_conflict`,
        `idempotency_key_required`, `inventory_api_not_enabled`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [idempotencyKey, items]
                  additionalProperties: false
                  properties:
                    idempotencyKey: { $ref: '#/components/schemas/InventoryIdempotencyKey' }
                    items:
                      type: array
                      minItems: 1
                      maxItems: 50
                      items:
                        type: object
                        required: [articleId, quantity]
                        additionalProperties: false
                        properties:
                          articleId: { type: string }
                          quantity: { type: integer, minimum: 1, description: "Thousandths of the base unit, greater than 0; whole items for `stockKind: serial`." }
                          locationId: { type: string, description: Default the default location of the account. }
                    reference: { type: [string, "null"], minLength: 1, maxLength: 128, description: "Your order number or the like (`listReservations` filters by it)." }
                    expiresInMinutes: { type: [integer, "null"], minimum: 5, maximum: 43200 }
            examples:
              order:
                summary: Order with two articles, one from the van, for 30 minutes
                value: { params: { idempotencyKey: "shop-res-1001", items: [{ articleId: beispiel_roggenbrot, quantity: 2000 }, { articleId: beispiel_kipferl, quantity: 6000, locationId: lieferwagen }], reference: "Bestellung 1001", expiresInMinutes: 30 } }
      responses:
        "200":
          description: "`data: { reservation: Reservation }`."
          headers:
            Retry-After: { $ref: '#/components/headers/RetryAfter' }
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InventoryEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          reservation: { $ref: '#/components/schemas/Reservation' }
              examples:
                order:
                  value:
                    status: success
                    message: ""
                    data:
                      reservation: { id: beispiel_reservierung_1001, status: active, reference: "Bestellung 1001", items: [{ articleId: beispiel_roggenbrot, locationId: haupt, quantity: 2000, redeemed: 0, released: 0 }, { articleId: beispiel_kipferl, locationId: lieferwagen, quantity: 6000, redeemed: 0, released: 0 }], expiresAt: "2026-10-06T06:32:17.000Z", createdAt: "2026-10-06T06:02:17.000Z" }
  /v3/extendReservation:
    post:
      operationId: extendReservation
      tags: [Inventory]
      summary: Move the expiry of an active reservation
      description: |
        Writing call (see `createReservation`). The new expiry is now plus
        `expiresInMinutes` (5–43 200), also if that is earlier than before. Only an active
        reservation that has not reached its `expiresAt` yet: otherwise
        `reservation_not_active` (a reservation past its `expiresAt` is expired right then,
        with `reservation.expired`).

        Errors: `reservation_not_found`, `reservation_not_active`, `validation`,
        `idempotency_conflict`, `idempotency_key_required`, `inventory_api_not_enabled`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [idempotencyKey, reservationId, expiresInMinutes]
                  additionalProperties: false
                  properties:
                    idempotencyKey: { $ref: '#/components/schemas/InventoryIdempotencyKey' }
                    reservationId: { type: string }
                    expiresInMinutes: { type: integer, minimum: 5, maximum: 43200 }
            examples:
              hour:
                value: { params: { idempotencyKey: "shop-res-1001-verl", reservationId: beispiel_reservierung_1001, expiresInMinutes: 60 } }
      responses:
        "200":
          description: "`data: { reservation: Reservation }`."
          headers:
            Retry-After: { $ref: '#/components/headers/RetryAfter' }
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InventoryEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          reservation: { $ref: '#/components/schemas/Reservation' }
  /v3/releaseReservation:
    post:
      operationId: releaseReservation
      tags: [Inventory]
      summary: Release a reservation, in full or per line
      description: |
        Writing call (see `createReservation`). Without `items` everything open is
        released and the status becomes `released`. With `items` only those lines: without
        `quantity` the whole open quantity of the line, with `quantity` that much (more than
        is open, or an article that is not part of the reservation, is `validation` with the
        field). `locationId` picks the line when the article is reserved at several
        locations. The released quantity goes back to `available`; every release that
        changes something sends `reservation.released` (with the status after it, so also
        `active` after a partial release).

        Errors: `reservation_not_found`, `reservation_not_active`, `validation`,
        `idempotency_conflict`, `idempotency_key_required`, `inventory_api_not_enabled`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [idempotencyKey, reservationId]
                  additionalProperties: false
                  properties:
                    idempotencyKey: { $ref: '#/components/schemas/InventoryIdempotencyKey' }
                    reservationId: { type: string }
                    items:
                      type: array
                      minItems: 1
                      maxItems: 50
                      items:
                        type: object
                        required: [articleId]
                        additionalProperties: false
                        properties:
                          articleId: { type: string }
                          locationId: { type: string }
                          quantity: { type: integer, minimum: 1, description: "Default: everything open on the line." }
            examples:
              partial:
                summary: The customer takes 2 fewer
                value: { params: { idempotencyKey: "shop-res-1001-frei", reservationId: beispiel_reservierung_1001, items: [{ articleId: beispiel_kipferl, quantity: 2000 }] } }
              all:
                summary: The order was cancelled
                value: { params: { idempotencyKey: "shop-res-1004-frei", reservationId: beispiel_reservierung_1004 } }
      responses:
        "200":
          description: "`data: { reservation: Reservation }`."
          headers:
            Retry-After: { $ref: '#/components/headers/RetryAfter' }
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InventoryEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          reservation: { $ref: '#/components/schemas/Reservation' }
              examples:
                partial:
                  value:
                    status: success
                    message: ""
                    data:
                      reservation: { id: beispiel_reservierung_1001, status: active, reference: "Bestellung 1001", items: [{ articleId: beispiel_roggenbrot, locationId: haupt, quantity: 2000, redeemed: 0, released: 0 }, { articleId: beispiel_kipferl, locationId: lieferwagen, quantity: 6000, redeemed: 0, released: 2000 }], expiresAt: "2026-10-06T07:02:23.000Z", createdAt: "2026-10-06T06:02:17.000Z" }
  /v3/getReservation:
    post:
      operationId: getReservation
      tags: [Inventory]
      summary: Read one reservation
      description: |
        Reading call: needs no writing switch. Errors: `reservation_not_found`,
        `validation`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [reservationId]
                  additionalProperties: false
                  properties:
                    reservationId: { type: string }
            examples:
              reservation:
                value: { params: { reservationId: beispiel_reservierung_1005 } }
      responses:
        "200":
          description: "`data: { reservation: Reservation }`."
          headers:
            Retry-After: { $ref: '#/components/headers/RetryAfter' }
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InventoryEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          reservation: { $ref: '#/components/schemas/Reservation' }
              examples:
                redeemed:
                  summary: Redeemed by an invoice
                  value:
                    status: success
                    message: ""
                    data:
                      reservation: { id: beispiel_reservierung_1005, status: redeemed, reference: "Bestellung 1005", items: [{ articleId: beispiel_roggenbrot, locationId: haupt, quantity: 1000, redeemed: 1000, released: 0 }], expiresAt: "2026-10-13T06:02:35.000Z", createdAt: "2026-10-06T06:02:35.000Z" }
  /v3/listReservations:
    post:
      operationId: listReservations
      tags: [Inventory]
      summary: List reservations, newest first
      description: |
        Reading call. Sorted by `createdAt` descending. Filter by `status` and by `reference`
        (exact). Errors: `validation` (also for an unknown `status`), `invalid_cursor`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  additionalProperties: false
                  properties:
                    status: { $ref: '#/components/schemas/ReservationStatus' }
                    reference: { type: string }
                    limit: { $ref: '#/components/schemas/PageLimit' }
                    cursor: { type: string, description: "`nextCursor` of the previous page." }
            examples:
              active:
                summary: Everything still held
                value: { params: { status: active } }
              order:
                summary: The reservations of one order
                value: { params: { reference: "Bestellung 1004" } }
      responses:
        "200":
          description: "`data: { reservations: Reservation[], nextCursor }`."
          headers:
            Retry-After: { $ref: '#/components/headers/RetryAfter' }
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InventoryEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          reservations: { type: array, items: { $ref: '#/components/schemas/Reservation' } }
                          nextCursor: { $ref: '#/components/schemas/NextCursor' }
  /v3/createVariantGroup:
    post:
      operationId: createVariantGroup
      tags: [Inventory]
      summary: Create a variant group with its variants
      description: |
        Writing call: needs „Lager-API schreiben“ for the account (`inventory_api_not_enabled`)
        and an `idempotencyKey`. Creates the group and, in the same transaction, one article
        per variant: either every combination of the values (`createMatrix: true`, at most
        100) or only the combinations in `variants[]` (at most 100), never both. Each entry
        of `variants[]` takes the fields of `createArticle` (`name` optional) plus
        `variantAttributes`; `defaults` of the group fill what it does not send. See
        *Variants* in the tag *Inventory* for the flow and the limits.

        The answer is the group with `variants[{ articleId, variantAttributes }]`, not the
        full articles; read them with `listArticles { variantGroupId }`. A repeat with the
        same key returns the same answer byte for byte. `variant_group.created` and one
        `article.created` per variant follow for webhooks.

        Errors: `validation` (also `createMatrix` together with `variants`, or a matrix of
        more than 100 combinations, `data.errors[].field` e.g. `attributes[1].values[2]` or
        `variants[3].unitPriceCents`), `invalid_variant_attributes` (`data.field` e.g.
        `variants[0].variantAttributes.farbe`), `variant_already_exists` (the same
        combination twice in `variants`, `data.field` `variants[i].variantAttributes`),
        `too_many_positions` (`data.field` `variants` or `createMatrix`), `code_taken`,
        `external_id_taken` (`data.field` e.g. `variants[2].externalIds.shop`),
        `group_not_found` (`data.field` `defaults.groupId` when the group comes from the
        defaults), `revenue_group_not_found`, `location_not_found`, `idempotency_conflict`,
        `idempotency_key_required`, `inventory_api_not_enabled`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  allOf:
                    - type: object
                      required: [idempotencyKey]
                      properties:
                        idempotencyKey: { $ref: '#/components/schemas/InventoryIdempotencyKey' }
                    - $ref: '#/components/schemas/CreateVariantGroupRequest'
            examples:
              shop:
                summary: Only the combinations the shop carries, each with its ID in the shop
                value: { params: { idempotencyKey: "shop-gruppe-3001", name: "Schürze", attributes: [{ key: groesse, label: "Größe", values: [S, M, L] }, { key: farbe, label: Farbe, values: [rot, blau] }], defaults: { unitPriceCents: 2490, vatRate: 20, stockTracked: true }, variants: [{ variantAttributes: { groesse: M, farbe: rot }, externalIds: { shop: "3001-M-rot" } }, { variantAttributes: { groesse: M, farbe: blau }, externalIds: { shop: "3001-M-blau" } }, { variantAttributes: { groesse: L, farbe: rot }, ean: "9001234567827", externalIds: { shop: "3001-L-rot" } }] } }
              matrix:
                summary: Every combination (3 sizes × 2 colours = 6 articles)
                value: { params: { idempotencyKey: "shop-gruppe-3002", name: "Schürze", attributes: [{ key: groesse, label: "Größe", values: [S, M, L] }, { key: farbe, label: Farbe, values: [rot, blau] }], defaults: { unitPriceCents: 2490, vatRate: 20, stockTracked: true }, createMatrix: true } }
      responses:
        "200":
          description: "`data: { variantGroup: VariantGroup }`."
          headers:
            Retry-After: { $ref: '#/components/headers/RetryAfter' }
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InventoryEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          variantGroup: { $ref: '#/components/schemas/VariantGroup' }
              examples:
                shop:
                  value:
                    status: success
                    message: ""
                    data:
                      variantGroup: { id: beispiel_schuerze, name: "Schürze", attributes: [{ key: groesse, label: "Größe", values: [S, M, L] }, { key: farbe, label: Farbe, values: [rot, blau] }], defaults: { unitPriceCents: 2490, vatRate: 20, stockTracked: true }, active: true, variants: [{ articleId: beispiel_schuerze_m_rot, variantAttributes: { farbe: rot, groesse: M } }, { articleId: beispiel_schuerze_m_blau, variantAttributes: { farbe: blau, groesse: M } }, { articleId: beispiel_schuerze_l_rot, variantAttributes: { farbe: rot, groesse: L } }], createdAt: "2026-10-06T08:02:41.000Z", updatedAt: "2026-10-06T08:02:41.000Z" }
  /v3/updateVariantGroup:
    post:
      operationId: updateVariantGroup
      tags: [Inventory]
      summary: Rename a variant group, change its defaults, add values, or deactivate it
      description: |
        Writing call (see `createVariantGroup`). Either any of `name`, `defaults` and
        `addAttributeValues`, or `active: false` alone.

        - `name` and `defaults` act only on variants created from now on; existing variants
          keep their fields (change them with `updateArticle`). `defaults` is merged per
          field: `null` clears a field, `defaults: null` clears all.
        - `addAttributeValues` adds values to existing attributes, e.g.
          `{ "groesse": ["XL"] }`. Values the group already has (also in other upper/lower
          case) and duplicates in the request are skipped silently, so a shop may always send
          all its values. Values cannot be removed and attributes cannot be added. Adding a
          value creates no variant: call `addVariant` for each combination you carry.
        - `active: false` deactivates the group and then every active variant in it, like
          `deactivateArticle` (codes and `externalIds` become free); the answer comes when all
          are done. It is final: `active: true` is `validation`. Repeating it (same or new
          key) finishes a deactivation that was interrupted.

        Without a visible change the group is not written (`updatedAt` stays, no event);
        otherwise `variant_group.updated` follows, and on deactivation one
        `article.deactivated` per variant.

        Errors: `variant_group_not_found`, `variant_group_inactive` (any change of a
        deactivated group except `active: false`), `validation` (also an unknown attribute
        in `addAttributeValues`, more than 30 values, `active` together with other fields),
        `group_not_found` (`data.field` `defaults.groupId`), `idempotency_conflict`,
        `idempotency_key_required`, `inventory_api_not_enabled`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  allOf:
                    - type: object
                      required: [idempotencyKey, variantGroupId]
                      properties:
                        idempotencyKey: { $ref: '#/components/schemas/InventoryIdempotencyKey' }
                    - $ref: '#/components/schemas/UpdateVariantGroupRequest'
            examples:
              size:
                summary: A new size; the shop sends all its sizes, M is skipped
                value: { params: { idempotencyKey: "shop-gruppe-3001-xl", variantGroupId: beispiel_schuerze, addAttributeValues: { groesse: [M, XL] } } }
              defaults:
                summary: New price for variants created from now on
                value: { params: { idempotencyKey: "shop-gruppe-3001-preis", variantGroupId: beispiel_schuerze, defaults: { unitPriceCents: 2690 } } }
              deactivate:
                summary: Deactivate the group and all its variants
                value: { params: { idempotencyKey: "shop-gruppe-3002-aus", variantGroupId: beispiel_geschirrtuch, active: false } }
      responses:
        "200":
          description: "`data: { variantGroup: VariantGroup }`."
          headers:
            Retry-After: { $ref: '#/components/headers/RetryAfter' }
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InventoryEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          variantGroup: { $ref: '#/components/schemas/VariantGroup' }
              examples:
                deactivate:
                  value:
                    status: success
                    message: ""
                    data:
                      variantGroup: { id: beispiel_geschirrtuch, name: Geschirrtuch, attributes: [{ key: farbe, label: Farbe, values: [rot, blau, "grün"] }], defaults: { unitPriceCents: 590, vatRate: 20, stockTracked: true }, active: false, variants: [{ articleId: beispiel_geschirrtuch_rot, variantAttributes: { farbe: rot } }, { articleId: beispiel_geschirrtuch_blau, variantAttributes: { farbe: blau } }], createdAt: "2026-10-06T08:02:42.000Z", updatedAt: "2026-10-06T08:02:50.000Z" }
  /v3/addVariant:
    post:
      operationId: addVariant
      tags: [Inventory]
      summary: Add one variant to a variant group
      description: |
        Writing call (see `createVariantGroup`). Creates one article with `variantGroupId`
        and `variantAttributes`: every attribute of the group exactly once, with a value
        from its list. Takes the fields of `createArticle` (`name` optional, default
        „<group> <values>“); the `defaults` of the group fill what is not sent. The answer is
        the article as `getArticle` returns it; `article.created` and
        `variant_group.updated` follow for webhooks.

        Errors: `variant_group_not_found`, `variant_group_inactive`,
        `invalid_variant_attributes` (`data.field` e.g. `variantAttributes.farbe`, the
        allowed values in `data.errors[].message`), `variant_already_exists` (the
        combination exists, `data.articleId` is that variant; a deactivated variant frees its
        combination), `variant_limit` (250 active variants), `validation`, `code_taken`,
        `external_id_taken`, `group_not_found` (`data.field` `defaults.groupId` when the
        group comes from the defaults), `revenue_group_not_found`, `location_not_found`,
        `too_many_positions` (`data.field` `externalIds`), `idempotency_conflict`,
        `idempotency_key_required`, `inventory_api_not_enabled`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  allOf:
                    - type: object
                      required: [idempotencyKey, variantGroupId, variantAttributes]
                      properties:
                        idempotencyKey: { $ref: '#/components/schemas/InventoryIdempotencyKey' }
                    - $ref: '#/components/schemas/AddVariantRequest'
            examples:
              xl:
                summary: The new size XL in red
                value: { params: { idempotencyKey: "shop-variante-3001-XL-rot", variantGroupId: beispiel_schuerze, variantAttributes: { groesse: XL, farbe: rot }, externalIds: { shop: "3001-XL-rot" } } }
      responses:
        "200":
          description: "`data: { article: Article }`."
          headers:
            Retry-After: { $ref: '#/components/headers/RetryAfter' }
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InventoryEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          article: { $ref: '#/components/schemas/Article' }
              examples:
                xl:
                  value:
                    status: success
                    message: ""
                    data:
                      article: { id: beispiel_schuerze_xl_rot, name: "Schürze XL rot", description: null, unitPriceCents: 2490, vatRate: 20, unit: Stk, number: null, ean: null, internalCode: "14", groupId: null, revenueGroupId: null, stockTracked: true, stockKind: quantity, minStock: null, active: true, externalIds: { shop: "3001-XL-rot" }, variantGroupId: beispiel_schuerze, variantAttributes: { farbe: rot, groesse: XL }, createdAt: "2026-10-06T08:02:49.000Z", updatedAt: "2026-10-06T08:02:49.000Z", stockLocationIds: [], minStockByLocation: {} }
  /v3/getVariantGroup:
    post:
      operationId: getVariantGroup
      tags: [Inventory]
      summary: Read one variant group
      description: |
        Reading call: needs no writing switch. `variants` lists the active variants of an
        active group; once the group is deactivated the list stays as it was at that moment.
        Errors: `variant_group_not_found`, `validation`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [variantGroupId]
                  additionalProperties: false
                  properties:
                    variantGroupId: { type: string }
            examples:
              group:
                value: { params: { variantGroupId: beispiel_schuerze } }
      responses:
        "200":
          description: "`data: { variantGroup: VariantGroup }`."
          headers:
            Retry-After: { $ref: '#/components/headers/RetryAfter' }
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InventoryEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          variantGroup: { $ref: '#/components/schemas/VariantGroup' }
              examples:
                group:
                  value:
                    status: success
                    message: ""
                    data:
                      variantGroup: { id: beispiel_schuerze, name: "Schürze", attributes: [{ key: groesse, label: "Größe", values: [S, M, L, XL] }, { key: farbe, label: Farbe, values: [rot, blau] }], defaults: { unitPriceCents: 2490, vatRate: 20, stockTracked: true }, active: true, variants: [{ articleId: beispiel_schuerze_m_rot, variantAttributes: { farbe: rot, groesse: M } }, { articleId: beispiel_schuerze_m_blau, variantAttributes: { farbe: blau, groesse: M } }, { articleId: beispiel_schuerze_l_rot, variantAttributes: { farbe: rot, groesse: L } }, { articleId: beispiel_schuerze_xl_rot, variantAttributes: { farbe: rot, groesse: XL } }], createdAt: "2026-10-06T08:02:41.000Z", updatedAt: "2026-10-06T08:02:49.000Z" }
  /v3/listVariantGroups:
    post:
      operationId: listVariantGroups
      tags: [Inventory]
      summary: List variant groups, also changed ones since a point in time
      description: |
        Reading call. Sorted by `updatedAt` ascending (same time: by `id`). With
        `updatedSince` only groups changed at or after that moment (**inclusive**, `>=`);
        repeat with the `updatedAt` of the last group you processed to stay in sync without
        gaps. Deactivated groups are listed too unless you filter with `active: true`.
        Errors: `validation`, `invalid_cursor`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  additionalProperties: false
                  properties:
                    active: { type: boolean }
                    updatedSince: { type: string, format: date-time, description: "ISO 8601, inclusive." }
                    limit: { $ref: '#/components/schemas/PageLimit' }
                    cursor: { type: string, description: "`nextCursor` of the previous page." }
            examples:
              sync:
                summary: Everything changed since the last sync
                value: { params: { updatedSince: "2026-10-06T08:00:00.000Z" } }
      responses:
        "200":
          description: "`data: { variantGroups: VariantGroup[], nextCursor }`."
          headers:
            Retry-After: { $ref: '#/components/headers/RetryAfter' }
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InventoryEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          variantGroups: { type: array, items: { $ref: '#/components/schemas/VariantGroup' } }
                          nextCursor: { $ref: '#/components/schemas/NextCursor' }
  /v3/createStocktake:
    post:
      operationId: createStocktake
      tags: [Inventory]
      summary: Start a stocktake at one location
      description: |
        Writing call: needs „Lager-API schreiben“ for the account (`inventory_api_not_enabled`)
        and an `idempotencyKey`. Freezes the scope at this moment: one item `sellable` per
        stock-tracked article in the scope, plus one item `defective` where defective stock
        lies at the location; at most 5000 items (`too_many_positions`). The answer is the
        stocktake in status `counting` (see *Stocktake* in the tag *Inventory*).

        - `scope.type: all`: every stock-tracked article kept at the location or with stock
          there (deactivated ones with stock included). A count of a stock-tracked article
          that is not on the list adds it later (`addedLater: true`).
        - `scope.type: groups` with `groupIds` (1–50), `articles` with `articleIds` (1–5000,
          each stock-tracked, else `article_not_tracked`): the list is fixed; counting
          another article is `article_not_in_scope`.
        - `type: key_date` needs `keyDate` (`YYYY-MM-DD`, the balance sheet date);
          `perpetual` has none (`keyDate: null`).
        - `blind` (default `true`): counters never see a stock figure. With `blind: false`
          they see today's book stock (`bookStockNow`) while counting, never the expected
          quantity.
        - `name` (1–100 characters, optional): default „Inventur <location> <day>“.

        At most one open stocktake per location: a second one is `stocktake_location_busy`
        with `data.stocktakeId` of the open one. A repeat with the same key returns the first
        answer, also after the stocktake moved on.

        Errors: `validation` (`data.errors[].field` e.g. `scope.groupIds`, `keyDate`),
        `location_not_found`, `location_inactive`, `article_not_found` and
        `article_not_tracked` (`data.articleId`), `too_many_positions`,
        `stocktake_location_busy`, `idempotency_conflict`, `idempotency_key_required`,
        `inventory_api_not_enabled`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  allOf:
                    - type: object
                      required: [idempotencyKey, locationId, scope, type]
                      properties:
                        idempotencyKey: { $ref: '#/components/schemas/InventoryIdempotencyKey' }
                    - $ref: '#/components/schemas/CreateStocktakeRequest'
            examples:
              keyDate:
                summary: Year-end stocktake of the bakery van, pastries only
                value: { params: { idempotencyKey: "shop-inventur-lw-1", name: "Inventur Lieferwagen Oktober", locationId: lieferwagen, scope: { type: groups, groupIds: [gebaeck] }, type: key_date, keyDate: "2026-10-31" } }
              perpetual:
                summary: Perpetual stocktake of one article, not blind
                value: { params: { idempotencyKey: "shop-inventur-haupt-1", locationId: haupt, scope: { type: articles, articleIds: [roggenbrot] }, type: perpetual, blind: false } }
      responses:
        "200":
          description: "`data: { stocktake: Stocktake }`."
          headers:
            Retry-After: { $ref: '#/components/headers/RetryAfter' }
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InventoryEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          stocktake: { $ref: '#/components/schemas/Stocktake' }
              examples:
                keyDate:
                  value:
                    status: success
                    message: ""
                    data:
                      stocktake: { id: auto78, name: "Inventur Lieferwagen Oktober", locationId: lieferwagen, scope: { type: groups, groupIds: [gebaeck], articleIds: [] }, type: key_date, keyDate: "2026-10-31", blind: true, status: counting, progress: { items: 1, recountOpen: false }, createdAt: "2026-10-06T08:03:04.000Z", createdBy: { type: api, id: kornblum, name: null }, source: api, updatedAt: "2026-10-06T08:03:06.000Z", review: null, closing: null, cancellation: null }
  /v3/listStocktakes:
    post:
      operationId: listStocktakes
      tags: [Inventory]
      summary: List stocktakes, also changed ones since a point in time
      description: |
        Reading call: needs no writing switch. Without `updatedSince` sorted by `updatedAt`
        descending, same time by `id` descending, also with `status`: recently changed ones
        first, open or not (a stocktake closed yesterday comes before an open one created a
        week ago and unchanged since). With `updatedSince` only stocktakes changed at or after
        that moment (**inclusive**, `>=`), sorted by `updatedAt` **ascending**, same time by
        `id` ascending, like `listArticles`: repeat with the `updatedAt` of the last stocktake you
        processed and nothing is lost. Filters: `status` (one value), `locationId`.
        Cancelled and closed stocktakes are listed too. `progress.counted` is only in
        `getStocktake`.
        Errors: `validation` (also an unknown `status`), `invalid_cursor`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  additionalProperties: false
                  properties:
                    status: { $ref: '#/components/schemas/StocktakeStatus' }
                    locationId: { type: string }
                    updatedSince: { type: string, format: date-time, description: "ISO 8601, inclusive; switches the order to ascending." }
                    limit: { $ref: '#/components/schemas/PageLimit' }
                    cursor: { type: string, description: "`nextCursor` of the previous page." }
            examples:
              open:
                summary: Stocktakes being counted
                value: { params: { status: counting } }
              sync:
                summary: Everything changed since the last sync
                value: { params: { updatedSince: "2026-10-06T08:00:00.000Z" } }
      responses:
        "200":
          description: "`data: { stocktakes: Stocktake[], nextCursor }`."
          headers:
            Retry-After: { $ref: '#/components/headers/RetryAfter' }
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InventoryEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          stocktakes: { type: array, items: { $ref: '#/components/schemas/Stocktake' } }
                          nextCursor: { $ref: '#/components/schemas/NextCursor' }
  /v3/getStocktake:
    post:
      operationId: getStocktake
      tags: [Inventory]
      summary: Read one stocktake with its progress
      description: |
        Reading call. Like an entry of `listStocktakes`, plus `progress.counted` (items with
        at least one active count). Poll it while `review.complete` is `false` or the status
        is `closing`. From `review` on the stocktake carries the result of the closing as soon
        as it is there (`totals`, `warnings`, `seal`, `checksum`, `inventoryAsOf`, `pdf`);
        value sums only with purchase values enabled.
        Errors: `stocktake_not_found`, `validation`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [stocktakeId]
                  additionalProperties: false
                  properties:
                    stocktakeId: { type: string }
            examples:
              one:
                value: { params: { stocktakeId: auto78 } }
      responses:
        "200":
          description: "`data: { stocktake: Stocktake }`."
          headers:
            Retry-After: { $ref: '#/components/headers/RetryAfter' }
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InventoryEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          stocktake: { $ref: '#/components/schemas/Stocktake' }
              examples:
                closed:
                  summary: Closed, with purchase values enabled
                  value:
                    status: success
                    message: ""
                    data:
                      stocktake: { id: auto78, name: "Inventur Lieferwagen Oktober", locationId: lieferwagen, scope: { type: groups, groupIds: [gebaeck], articleIds: [] }, type: key_date, keyDate: "2026-10-31", blind: true, status: closed, progress: { items: 1, counted: 1, recountOpen: false }, createdAt: "2026-10-06T08:03:04.000Z", createdBy: { type: api, id: kornblum, name: null }, source: api, updatedAt: "2026-10-06T08:06:12.000Z", review: { startedAt: "2026-10-06T08:03:36.000Z", startedBy: { type: api, id: kornblum, name: null }, complete: true, expectedAsOf: "2026-10-06T08:03:38.000Z", recountUncounted: 0 }, closing: { startedAt: "2026-10-06T08:03:40.000Z", startedBy: { type: api, id: kornblum, name: null }, uncountedAsZero: false, parts: 1, bookedParts: 1, completedAt: "2026-10-06T08:06:12.000Z" }, totals: { items: 1, counted: 1, uncounted: 0, recounted: 1, withDifference: 1, needsCheck: 1, notBooked: 0, differenceValueCents: -122, inventoryValueCents: 856 }, warnings: [], seal: { fromDay: null, toDay: "2026-10-05", daysChecked: 0, verified: true, firstBreak: null, gaps: [], gapCount: 0 }, checksum: "5ad6dc60c7f1b9a4062a35c4f70897be77212607c2fea776ec9ad9740dd8c9c6", inventoryAsOf: count_date, pdf: { available: true, valuesSha256: "952eda0669f9b416e1653ba140a1c014db29fa058fb0ef553ba96023bb9627d9", quantitiesSha256: "a271816287c89e663f21ba4afbf51c3ae8a68175ef4558c54ec07636b873f7dc" }, cancellation: null }
  /v3/listStocktakeItems:
    post:
      operationId: listStocktakeItems
      tags: [Inventory]
      summary: List the items of a stocktake
      description: |
        Reading call. Items by their ID (article and condition), page by page. `openOnly:
        true` lists only the items still to count; in `review` only those open for recount.
        While `counting` an item never carries an expected quantity, a difference or a value
        (blind, see *Stocktake*); with `blind: false` it carries `bookStockNow`. From `review`
        on it carries `expectedQuantity`, `differenceQuantity`, `needsCheck` and
        `checkReasons`, after the closing `bookedQuantity`, `notBooked` and `inventory`.
        Values only with purchase values enabled.
        Errors: `stocktake_not_found`, `validation`, `invalid_cursor`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [stocktakeId]
                  additionalProperties: false
                  properties:
                    stocktakeId: { type: string }
                    openOnly: { type: boolean, description: "Only items not counted yet (in `review`: open for recount)." }
                    limit: { $ref: '#/components/schemas/PageLimit' }
                    cursor: { type: string, description: "`nextCursor` of the previous page." }
            examples:
              open:
                summary: What is still to count
                value: { params: { stocktakeId: auto78, openOnly: true } }
      responses:
        "200":
          description: "`data: { items: StocktakeItem[], nextCursor }`."
          headers:
            Retry-After: { $ref: '#/components/headers/RetryAfter' }
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InventoryEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          items: { type: array, items: { $ref: '#/components/schemas/StocktakeItem' } }
                          nextCursor: { $ref: '#/components/schemas/NextCursor' }
              examples:
                counting:
                  summary: Counting (blind)
                  value:
                    status: success
                    message: ""
                    data:
                      items: [{ articleId: kipferl, condition: sellable, name: Butterkipferl, number: A-200, unit: Stk, round: 1, counted: true, quantity: 12000, counts: 1, firstCountedAt: "2026-10-06T08:03:11.000Z", referenceTime: "2026-10-06T08:03:11.000Z", countedBy: [{ type: api, id: kornblum, name: null }], serialNumbers: [], recountRequested: false, addedLater: false }]
                      nextCursor: null
                review:
                  summary: Review, the expected quantity is there
                  value:
                    status: success
                    message: ""
                    data:
                      items: [{ articleId: kipferl, condition: sellable, name: Butterkipferl, number: A-200, unit: Stk, round: 1, counted: true, quantity: 12000, counts: 1, firstCountedAt: "2026-10-06T08:03:11.000Z", referenceTime: "2026-10-06T08:03:11.000Z", countedBy: [{ type: api, id: kornblum, name: null }], serialNumbers: [], recountRequested: false, addedLater: false, expectedQuantity: 24000, differenceQuantity: -12000, needsCheck: true, checkReasons: [far_from_key_date], expectedAsOf: "2026-10-06T08:03:11.000Z", missingSerialNumbers: [], extraSerialNumbers: [] }]
                      nextCursor: null
                closed:
                  summary: Closed, with purchase values enabled
                  value:
                    status: success
                    message: ""
                    data:
                      items: [{ articleId: kipferl, condition: sellable, name: Butterkipferl, number: A-200, unit: Stk, round: 2, counted: true, quantity: 21000, counts: 1, firstCountedAt: "2026-10-06T08:03:33.000Z", referenceTime: "2026-10-06T08:03:33.000Z", countedBy: [{ type: api, id: kornblum, name: null }], serialNumbers: [], recountRequested: true, recount: { reason: "Kiste hinten fehlt", requestedAt: "2026-10-06T08:03:30.000Z", requestedBy: { type: api, id: kornblum, name: null }, round: 2 }, addedLater: false, expectedQuantity: 24000, differenceQuantity: -3000, needsCheck: true, checkReasons: [far_from_key_date], expectedAsOf: "2026-10-06T08:03:33.000Z", differenceValueCents: -122, missingSerialNumbers: [], extraSerialNumbers: [], bookedQuantity: -3000, notBooked: null, inventory: { quantity: 21000, unitValueMicros: 407474, valueCents: 856, countedOn: "2026-10-06" } }]
                      nextCursor: null
  /v3/recordStocktakeCount:
    post:
      operationId: recordStocktakeCount
      tags: [Inventory]
      summary: Record a count
      description: |
        Writing call (see `createStocktake`). One count of one article at the location of the
        stocktake; several counts of the same item **add up** („shelf A“ + „shelf B“).
        `quantity` in thousandths, `0` means counted empty (the item counts as counted).
        Articles counted by the piece take whole pieces only (`invalid_quantity`); articles
        with `stockKind: serial` need one unique serial number per piece
        (`serial_required`, at most 200 per count, a number twice in a round is
        `serial_already_counted`). Allowed while `counting`, and in `review` only on items
        open for recount. The server time of the count is the reference time of the item
        (see *Reference time*); the time of your device never counts.

        The answer is the count and the item after it (without serial numbers of the item,
        never an expected quantity). A repeat with the same key **on the same stocktake**
        returns the first answer; after an unclear outcome send the same count with the same
        key again, never with a new one (that would count twice).

        Errors: `stocktake_not_found`, `stocktake_not_open`, `stocktake_closed`,
        `stocktake_closing`, `article_not_found`, `article_not_in_scope`,
        `article_not_tracked`, `invalid_quantity`, `serial_required`, `serial_not_allowed`,
        `invalid_serial`, `serial_already_counted`, `too_many_counts` (200 counts per item and
        round, 1000 serial numbers per item), `validation`, `idempotency_conflict`,
        `idempotency_key_required`, `inventory_api_not_enabled`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  allOf:
                    - type: object
                      required: [idempotencyKey, stocktakeId, articleId, quantity]
                      properties:
                        idempotencyKey: { $ref: '#/components/schemas/InventoryIdempotencyKey' }
                    - $ref: '#/components/schemas/RecordStocktakeCountRequest'
            examples:
              box:
                summary: The front box on the van
                value: { params: { idempotencyKey: "shop-zaehlung-1", stocktakeId: auto78, articleId: kipferl, quantity: 12000, note: "Kiste vorne" } }
      responses:
        "200":
          description: "`data: { count: StocktakeCount, item: StocktakeItem }`."
          headers:
            Retry-After: { $ref: '#/components/headers/RetryAfter' }
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InventoryEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          count: { $ref: '#/components/schemas/StocktakeCount' }
                          item: { $ref: '#/components/schemas/StocktakeItem' }
              examples:
                second:
                  summary: A second box adds up
                  value:
                    status: success
                    message: ""
                    data:
                      count: { id: c4bcbef939611668aec06aeda0ccb5ffec860093571702e7f569aa9a26f49b8d, articleId: kipferl, condition: sellable, quantity: 9000, serialNumbers: [], round: 1, countedBy: { type: api, id: kornblum, name: null }, source: api, cashregisterId: null, countedAt: "2026-10-06T08:03:14.000Z", note: "Kiste hinten", voided: null }
                      item: { articleId: kipferl, condition: sellable, name: Butterkipferl, number: A-200, unit: Stk, round: 1, counted: true, quantity: 21000, counts: 2, firstCountedAt: "2026-10-06T08:03:11.000Z", referenceTime: "2026-10-06T08:03:14.000Z", countedBy: [{ type: api, id: kornblum, name: null }], recountRequested: false, addedLater: false }
  /v3/voidStocktakeCount:
    post:
      operationId: voidStocktakeCount
      tags: [Inventory]
      summary: Void a count
      description: |
        Writing call (see `createStocktake`). Marks one count as voided with a `reason`
        (1–500 characters) and adds up the item again from its other active counts of the
        round; the count stays in the record. The API may void any count. Allowed while
        `counting`, and in `review` on items open for recount; a count of an earlier round
        is `stocktake_not_open`.

        Errors: `stocktake_not_found`, `count_not_found`, `count_already_voided`,
        `stocktake_not_open`, `stocktake_closed`, `stocktake_closing`, `too_many_counts`,
        `validation` (`reason` missing), `idempotency_conflict`, `idempotency_key_required`,
        `inventory_api_not_enabled`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [idempotencyKey, stocktakeId, countId, reason]
                  additionalProperties: false
                  properties:
                    idempotencyKey: { $ref: '#/components/schemas/InventoryIdempotencyKey' }
                    stocktakeId: { type: string }
                    countId: { type: string }
                    reason: { type: string, minLength: 1, maxLength: 500 }
            examples:
              double:
                summary: A box was counted twice
                value: { params: { idempotencyKey: "shop-zaehlung-2-storno", stocktakeId: auto78, countId: c4bcbef939611668aec06aeda0ccb5ffec860093571702e7f569aa9a26f49b8d, reason: "Kiste doppelt gezählt" } }
      responses:
        "200":
          description: "`data: { count: StocktakeCount, item: StocktakeItem }`."
          headers:
            Retry-After: { $ref: '#/components/headers/RetryAfter' }
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InventoryEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          count: { $ref: '#/components/schemas/StocktakeCount' }
                          item: { $ref: '#/components/schemas/StocktakeItem' }
  /v3/listStocktakeCounts:
    post:
      operationId: listStocktakeCounts
      tags: [Inventory]
      summary: List the counts of a stocktake
      description: |
        Reading call. Every count, newest first, also voided ones (`voided` with reason, time
        and actor) and those of earlier rounds; with `articleId` only the counts of that
        article. A count never carries an expected quantity.
        Errors: `stocktake_not_found`, `validation`, `invalid_cursor`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [stocktakeId]
                  additionalProperties: false
                  properties:
                    stocktakeId: { type: string }
                    articleId: { type: string }
                    limit: { $ref: '#/components/schemas/PageLimit' }
                    cursor: { type: string, description: "`nextCursor` of the previous page." }
            examples:
              all:
                value: { params: { stocktakeId: auto78 } }
      responses:
        "200":
          description: "`data: { counts: StocktakeCount[], nextCursor }`."
          headers:
            Retry-After: { $ref: '#/components/headers/RetryAfter' }
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InventoryEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          counts: { type: array, items: { $ref: '#/components/schemas/StocktakeCount' } }
                          nextCursor: { $ref: '#/components/schemas/NextCursor' }
  /v3/reviewStocktake:
    post:
      operationId: reviewStocktake
      tags: [Inventory]
      summary: Stop counting and compute the expected quantities
      description: |
        Writing call (see `createStocktake`). `counting` → `review`; counting ends (except
        recounts). The expected quantity of every item at its reference time, the
        difference, `needsCheck` with `checkReasons` and the expected value of the difference
        are computed **in the background**: the answer comes at once with
        `review.complete: false`; poll `getStocktake` until it is `true`, then read the items.
        Called again in `review` it computes again (after a recount: only the recounted
        items) and ends an open recount.

        Errors: `stocktake_not_found`, `stocktake_closed`, `stocktake_closing`,
        `idempotency_conflict`, `idempotency_key_required`, `inventory_api_not_enabled`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [idempotencyKey, stocktakeId]
                  additionalProperties: false
                  properties:
                    idempotencyKey: { $ref: '#/components/schemas/InventoryIdempotencyKey' }
                    stocktakeId: { type: string }
            examples:
              review:
                value: { params: { idempotencyKey: "shop-inventur-lw-pruefen-1", stocktakeId: auto78 } }
      responses:
        "200":
          description: "`data: { stocktake: Stocktake }`."
          headers:
            Retry-After: { $ref: '#/components/headers/RetryAfter' }
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InventoryEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          stocktake: { $ref: '#/components/schemas/Stocktake' }
  /v3/recountStocktake:
    post:
      operationId: recountStocktake
      tags: [Inventory]
      summary: Order a recount of some items
      description: |
        Writing call (see `createStocktake`). Only in `review` and only after the review is
        complete (`stocktake_review_running`). Each item (1–200 per call, `condition`
        default `sellable`) starts a new round: its counts so far stay in the record but no
        longer count, `quantity` is `null` again and `recountRequested: true`;
        `progress.recountOpen` turns `true`. Count the items with `recordStocktakeCount`,
        then call `reviewStocktake` again before closing (`stocktake_recount_open`).

        Errors: `stocktake_not_found`, `stocktake_not_in_review`, `stocktake_review_running`,
        `stocktake_closed`, `stocktake_closing`, `article_not_in_scope` (`data.articleId`),
        `validation` (`items`, `reason`), `idempotency_conflict`, `idempotency_key_required`,
        `inventory_api_not_enabled`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  allOf:
                    - type: object
                      required: [idempotencyKey, stocktakeId, items, reason]
                      properties:
                        idempotencyKey: { $ref: '#/components/schemas/InventoryIdempotencyKey' }
                    - $ref: '#/components/schemas/RecountStocktakeRequest'
            examples:
              recount:
                value: { params: { idempotencyKey: "shop-inventur-lw-nachzaehlen-1", stocktakeId: auto78, items: [{ articleId: kipferl }], reason: "Kiste hinten fehlt" } }
      responses:
        "200":
          description: "`data: { stocktake: Stocktake }`."
          headers:
            Retry-After: { $ref: '#/components/headers/RetryAfter' }
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InventoryEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          stocktake: { $ref: '#/components/schemas/Stocktake' }
  /v3/closeStocktake:
    post:
      operationId: closeStocktake
      tags: [Inventory]
      summary: Close the stocktake and book the differences
      description: |
        Writing call (see `createStocktake`). Only in `review`, after the review is complete
        (`stocktake_review_running`) and with no recount open (`stocktake_recount_open`).
        `review` → `closing`: the differences are booked **in the background, in parts** (see
        *Closing in parts*); the answer comes at once. Poll `getStocktake` until the status is
        `closed`. Calling it again while `closing` is no error: it answers with the state and
        starts the background work again.

        `uncountedAsZero` (default `false`): items never counted are not booked and are listed
        as „not counted“ in the record; with `true` they are booked as counted empty (`0`).
        Items ordered for recount and not counted again are never booked, not even with
        `uncountedAsZero`; then the answer carries the notice `recount_uncounted` in
        `warnings[]` (`items` = how many).

        Errors: `stocktake_not_found`, `stocktake_not_in_review`, `stocktake_review_running`,
        `stocktake_recount_open`, `stocktake_closed`, `validation`, `idempotency_conflict`,
        `idempotency_key_required`, `inventory_api_not_enabled`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [idempotencyKey, stocktakeId]
                  additionalProperties: false
                  properties:
                    idempotencyKey: { $ref: '#/components/schemas/InventoryIdempotencyKey' }
                    stocktakeId: { type: string }
                    uncountedAsZero: { type: boolean, default: false, description: "Book items never counted as counted empty." }
            examples:
              close:
                value: { params: { idempotencyKey: "shop-inventur-lw-schluss-1", stocktakeId: auto78 } }
      responses:
        "200":
          description: "`data: { stocktake: Stocktake, warnings?: StocktakeWarning[] }`."
          headers:
            Retry-After: { $ref: '#/components/headers/RetryAfter' }
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InventoryEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          stocktake: { $ref: '#/components/schemas/Stocktake' }
                          warnings: { type: array, items: { $ref: '#/components/schemas/StocktakeWarning' }, description: "Only when there is a notice (`recount_uncounted`)." }
              examples:
                closing:
                  value:
                    status: success
                    message: ""
                    data:
                      stocktake: { id: auto78, name: "Inventur Lieferwagen Oktober", locationId: lieferwagen, scope: { type: groups, groupIds: [gebaeck], articleIds: [] }, type: key_date, keyDate: "2026-10-31", blind: true, status: closing, progress: { items: 1, recountOpen: false }, createdAt: "2026-10-06T08:03:04.000Z", createdBy: { type: api, id: kornblum, name: null }, source: api, updatedAt: "2026-10-06T08:03:40.000Z", review: { startedAt: "2026-10-06T08:03:36.000Z", startedBy: { type: api, id: kornblum, name: null }, complete: true, expectedAsOf: "2026-10-06T08:03:38.000Z", recountUncounted: 0 }, closing: { startedAt: "2026-10-06T08:03:40.000Z", startedBy: { type: api, id: kornblum, name: null }, uncountedAsZero: false, parts: null, bookedParts: 0 }, cancellation: null }
  /v3/cancelStocktake:
    post:
      operationId: cancelStocktake
      tags: [Inventory]
      summary: Cancel a stocktake
      description: |
        Writing call (see `createStocktake`). From `creating`, `counting` or `review`, with a
        `reason` (1–500 characters): status `cancelled`, nothing is booked, the location is
        free for a new stocktake. Counts stay readable. A closing cannot be cancelled
        (`stocktake_closing`).

        Errors: `stocktake_not_found`, `stocktake_closed`, `stocktake_closing`, `validation`,
        `idempotency_conflict`, `idempotency_key_required`, `inventory_api_not_enabled`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [idempotencyKey, stocktakeId, reason]
                  additionalProperties: false
                  properties:
                    idempotencyKey: { $ref: '#/components/schemas/InventoryIdempotencyKey' }
                    stocktakeId: { type: string }
                    reason: { type: string, minLength: 1, maxLength: 500 }
            examples:
              wrong:
                value: { params: { idempotencyKey: "shop-inventur-haupt-abbruch", stocktakeId: auto81, reason: "Falscher Standort" } }
      responses:
        "200":
          description: "`data: { stocktake: Stocktake }`."
          headers:
            Retry-After: { $ref: '#/components/headers/RetryAfter' }
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InventoryEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          stocktake: { $ref: '#/components/schemas/Stocktake' }
  /v3/getStocktakePdf:
    post:
      operationId: getStocktakePdf
      tags: [Inventory]
      summary: Stocktake record as PDF
      description: |
        Reading call. The record of a closed stocktake (A4): header, counters, summary,
        inventory list, all counts (also voided ones with reason), operation IDs, seal status
        and checksum. With purchase values enabled the version with values, otherwise the one
        with quantities only. It is made once when the stocktake closes and never changes;
        `pdf.valuesSha256` / `pdf.quantitiesSha256` of `getStocktake` are its SHA-256.

        - Up to 9 MiB the answer is the file itself: `application/pdf`, with a
          `Content-Disposition` file name `stocktake-<id>.pdf` (quantities only:
          `stocktake-<id>-quantities.pdf`).
        - Above 9 MiB the answer is JSON: `data.download` with a signed `url` that is valid
          for **15 minutes** (`expiresAt`), `sizeBytes`, `sha256`, `fileName` and
          `contentType`. Fetch the file with a plain `GET` (no API key) and check it against
          `sha256`; after `expiresAt` call `getStocktakePdf` again.

        Errors (always JSON): `stocktake_not_found`, `stocktake_not_closed` (not closed yet,
        or cancelled), `validation`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [stocktakeId]
                  additionalProperties: false
                  properties:
                    stocktakeId: { type: string }
            examples:
              record:
                value: { params: { stocktakeId: auto78 } }
      responses:
        "200":
          description: "The PDF file; above 9 MiB the JSON envelope with `data.download`; on error the JSON envelope."
          headers:
            Retry-After: { $ref: '#/components/headers/RetryAfter' }
          content:
            application/pdf:
              schema: { type: string, format: binary }
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InventoryEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          download: { $ref: '#/components/schemas/StocktakePdfDownload' }
              examples:
                download:
                  summary: Above 9 MiB (here shortened)
                  value:
                    status: success
                    message: ""
                    data:
                      download: { url: "https://storage.googleapis.com/kasseneck.appspot.com/users/kornblum/lager_inventuren/auto78/inventurprotokoll-mengen.pdf?X-Goog-Expires=900&X-Goog-Signature=EXAMPLE1791274887000", expiresAt: "2026-10-06T08:21:27.000Z", sizeBytes: 44, sha256: a271816287c89e663f21ba4afbf51c3ae8a68175ef4558c54ec07636b873f7dc, fileName: stocktake-auto78-quantities.pdf, contentType: application/pdf }
  /v3/createWebhook:
    post:
      operationId: createWebhook
      tags: [Inventory]
      summary: Create a webhook for inventory events (the secret is only in this answer)
      description: |
        At most 5 webhooks per account (`webhook_limit`, as for partner webhooks). The webhook is active right
        away. `url` must be a full `https://` address without credentials and not point to a
        private host (`invalid_webhook_url`); a missing `url` or an unknown event is
        `validation`; an event whose module the account lacks is `webhook_event_not_available`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [url, events]
                  additionalProperties: false
                  properties:
                    url: { type: string, format: uri, maxLength: 500, example: "https://shop.example.at/kasseneck" }
                    events: { type: array, minItems: 1, items: { $ref: '#/components/schemas/InventoryWebhookEventType' } }
                    description: { type: [string, "null"], maxLength: 120 }
            examples:
              shop:
                value: { params: { url: "https://shop.example.at/kasseneck", events: [stock.changed, article.updated], description: "Online-Shop Bäckerei Kornblum" } }
      responses:
        "200":
          description: "`data: { webhook: InventoryWebhook, secret }`; `secret` (`whsec_…`) is never shown again."
          headers:
            Retry-After: { $ref: '#/components/headers/RetryAfter' }
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InventoryEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          webhook: { $ref: '#/components/schemas/InventoryWebhook' }
                          secret: { type: string, description: "Only here and in `rotateWebhookSecret`: HMAC secret for the signature check." }
  /v3/updateWebhook:
    post:
      operationId: updateWebhook
      tags: [Inventory]
      summary: Change a webhook (address, events, description, active)
      description: |
        Only the given fields change; at least one is required (`validation`).
        `active: false` stops all deliveries and drops the pending ones. `description: null`
        removes the description.

        Errors: `webhook_not_found`, `invalid_webhook_url`, `validation`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [webhookId]
                  additionalProperties: false
                  properties:
                    webhookId: { type: string }
                    url: { type: string, format: uri, maxLength: 500 }
                    events: { type: array, minItems: 1, items: { $ref: '#/components/schemas/InventoryWebhookEventType' } }
                    active: { type: boolean }
                    description: { type: [string, "null"], maxLength: 120 }
            examples:
              events:
                value: { params: { webhookId: "Wh3kq9ZtA1bC", events: [stock.changed, stock.below_minimum] } }
      responses:
        "200":
          description: "`data: { webhook: InventoryWebhook }`."
          headers:
            Retry-After: { $ref: '#/components/headers/RetryAfter' }
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InventoryEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          webhook: { $ref: '#/components/schemas/InventoryWebhook' }
  /v3/deleteWebhook:
    post:
      operationId: deleteWebhook
      tags: [Inventory]
      summary: Delete a webhook
      description: Pending deliveries are dropped. Error `webhook_not_found`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema: { $ref: '#/components/schemas/WebhookIdParams' }
      responses:
        "200":
          description: "`data: { webhookId, deleted: true }`."
          headers:
            Retry-After: { $ref: '#/components/headers/RetryAfter' }
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InventoryEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          webhookId: { type: string }
                          deleted: { type: boolean, const: true }
  /v3/listWebhooks:
    post:
      operationId: listWebhooks
      tags: [Inventory]
      summary: List the webhooks of the account
      description: Oldest first, never with the secret. `events` lists every event a webhook can subscribe to. Takes no parameters.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema: { $ref: '#/components/schemas/EmptyParams' }
      responses:
        "200":
          description: "`data: { webhooks: InventoryWebhook[], events: InventoryWebhookEventType[] }`."
          headers:
            Retry-After: { $ref: '#/components/headers/RetryAfter' }
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InventoryEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          webhooks: { type: array, items: { $ref: '#/components/schemas/InventoryWebhook' } }
                          events: { type: array, items: { $ref: '#/components/schemas/InventoryWebhookEventType' } }
  /v3/sendWebhookTest:
    post:
      operationId: sendWebhookTest
      tags: [Inventory]
      summary: Test delivery of an event to your own endpoint
      description: |
        Sends `event` to this one webhook with a payload shaped exactly like the real one and
        recognisably invented values (see the examples under *Webhooks*). **Every test
        delivery carries `test: true` in the envelope.** The webhook must subscribe to the
        event (`event_not_subscribed`) and be active (`webhook_inactive`); an unknown event is
        `validation` on `event`. Error `webhook_not_found`.

        At most 20 test deliveries per account and calendar day in Vienna (live and test
        environment count separately; rejected calls do not count). After that
        `rate_limited` with `data.retryAfterSec` up to midnight in Vienna and the header
        `Retry-After`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [webhookId, event]
                  additionalProperties: false
                  properties:
                    webhookId: { type: string }
                    event: { $ref: '#/components/schemas/InventoryWebhookEventType' }
            examples:
              stock:
                value: { params: { webhookId: "Wh3kq9ZtA1bC", event: stock.changed } }
      responses:
        "200":
          description: "`data: { eventId, event, deliveries[] }`; `status` is the result of the first attempt."
          headers:
            Retry-After: { $ref: '#/components/headers/RetryAfter' }
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InventoryEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          eventId: { type: string }
                          event: { $ref: '#/components/schemas/InventoryWebhookEventType' }
                          deliveries:
                            type: array
                            items:
                              type: object
                              properties:
                                deliveryId: { type: string, description: ID of the delivery (header `X-Kasseneck-Delivery`). }
                                webhookId: { type: string }
                                status: { $ref: '#/components/schemas/WebhookDeliveryStatus' }
                                statusCode: { type: [integer, "null"] }
  /v3/rotateWebhookSecret:
    post:
      operationId: rotateWebhookSecret
      tags: [Inventory]
      summary: Issue a new secret (only in this answer)
      description: |
        From now on only the new secret signs; there is no transition period. Deliveries that
        fail in between are retried with the new one. Error `webhook_not_found`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema: { $ref: '#/components/schemas/WebhookIdParams' }
      responses:
        "200":
          description: "`data: { webhook: InventoryWebhook, secret }`."
          headers:
            Retry-After: { $ref: '#/components/headers/RetryAfter' }
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InventoryEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          webhook: { $ref: '#/components/schemas/InventoryWebhook' }
                          secret: { type: string, description: "The new HMAC secret (`whsec_…`), never shown again." }
  /v3/listWebhookDeliveries:
    post:
      operationId: listWebhookDeliveries
      tags: [Inventory]
      summary: Deliveries with status, attempts and response
      description: |
        Newest first, of all webhooks or of one (`webhookId`); kept for 90 days. No paging:
        `limit` (1–200, default 50) takes the newest ones. Error `webhook_not_found`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  additionalProperties: false
                  properties:
                    webhookId: { type: string }
                    limit: { $ref: '#/components/schemas/PageLimit' }
      responses:
        "200":
          description: "`data: { deliveries: InventoryWebhookDelivery[] }`."
          headers:
            Retry-After: { $ref: '#/components/headers/RetryAfter' }
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/InventoryEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          deliveries: { type: array, items: { $ref: '#/components/schemas/InventoryWebhookDelivery' } }
  /v3/orderSignatureCard:
    post:
      operationId: orderSignatureCard
      tags: [Signature cards]
      summary: Order a signature card for your own account
      description: |
        Reserves the next empty card of the card pool. The answer is the order (`status: pending`); poll
        `getSignatureCardOrder` until `activated` and `run.state: done`. Errors: `validation`, `not_permitted`, `order_open`
        (with `orderId`), `card_pool_empty`, `card_pool_unavailable`, `tax_number_missing`, `test_environment`,
        `invalid_selection`, `too_many_orders`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  additionalProperties: false
                  properties:
                    registerWithFinanzOnline: { type: boolean, default: true, description: Verify the card and register it with FinanzOnline. }
                    cashRegisterIds: { type: array, items: { type: string }, maxItems: 10, description: Cash registers that get the new card (needs registerWithFinanzOnline). }
                    replaceCardId: { type: [string, "null"], description: Old card to decommission once every register signs with the new one. }
            examples:
              order:
                value: { params: { cashRegisterIds: ["KASSE-1"], replaceCardId: "sigAlt" } }
      responses:
        "200":
          description: "`data: { order: SignatureCardOrder }`."
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Envelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          order: { $ref: '#/components/schemas/SignatureCardOrder' }
  /v3/getSignatureCardOrder:
    post:
      operationId: getSignatureCardOrder
      tags: [Signature cards]
      summary: State of a signature card order
      description: |
        With `orderId` that order (only your own), without it the latest order of your account (`order: null` if none).
        Errors: `validation`, `order_not_found`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  additionalProperties: false
                  properties:
                    orderId: { type: string }
      responses:
        "200":
          description: "`data: { order: SignatureCardOrder | null }`."
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Envelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          order: { oneOf: [{ $ref: '#/components/schemas/SignatureCardOrder' }, { type: "null" }] }
  /v3/registerTerminalDevice:
    post:
      operationId: registerTerminalDevice
      tags: [Card terminals]
      summary: Register a device for Genius Pay
      description: |
        Registers one installation of your payment app. Call it once and keep `deviceId` and `deviceSecret` in the
        secure storage of the device (Keychain, Keystore). **`deviceSecret` is returned only here**; Kasseneck stores
        only its hash, so a lost secret means a new registration. Never log it. At most 10 registrations per business
        and day. Errors: `terminal_not_enabled`, `terminal_test_environment`, `too_many_terminal_devices`,
        `invalid_terminal_device` (a parameter is missing or out of range).
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [label, platform, app]
                  properties:
                    label: { type: string, minLength: 1, maxLength: 60, description: "Name of the device as people know it, e.g. the car or the driver; shown in the TID list of `getTerminalAccess`." }
                    platform: { type: string, enum: [android, ios] }
                    app: { type: string, minLength: 1, maxLength: 40, description: Name of your app. }
                    requestedBy: { type: string, maxLength: 80, description: "Optional: who registered the device (name of the driver)." }
            examples:
              register:
                value: { params: { label: "Taxi 7", platform: android, app: "Fahrer-App" } }
      responses:
        "200":
          description: "`data: { deviceId, deviceSecret }`, or an error."
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/TerminalEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          deviceId: { type: string }
                          deviceSecret: { type: string, description: "Secret of the device, only in this answer. Store securely, never log." }
  /v3/getTerminalAccess:
    post:
      operationId: getTerminalAccess
      tags: [Card terminals]
      summary: Genius Pay login and TID of this device
      description: |
        Returns the Genius Pay login of the TID this device holds. A TID fixed to this device always comes first. A
        device without a TID gets a free TID of the business (the one unused for the longest time); a TID is free when
        it is not fixed to another device, has no device or its device has not called any of these endpoints for
        7 days, and no receipt of the business has a card payment on it for 7 days (`payments[].providerData.terminalID`
        in `createReceipt`, so devices with an older app count too). Call it at every start of the app and at least
        once a day while it runs, so that your TID does not count as free. A fixed TID never becomes free, however long
        its device is away.

        Every answer lists the TIDs of **your own business** in `terminals` (`TerminalListEntry`), as seen from this
        device. If no TID is free: `available: false` with `reason: no_free_terminal`; take one over with
        `claimTerminal`.

        `password` is a secret: use it only to sign in to Genius Pay, never show or log it. `codeFormat` describes the
        one-time code of Genius Pay (for checking a pasted code); `autoCode: true` means Kasseneck can fetch the code
        (`requestTerminalCode`), otherwise the driver types it. Errors: `terminal_not_enabled`,
        `terminal_test_environment`, `terminal_device_unknown` (unknown `deviceId` or wrong `deviceSecret`, the same
        answer for both), `terminal_device_blocked`, `invalid_terminal_device`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [deviceId, deviceSecret]
                  properties:
                    deviceId: { type: string }
                    deviceSecret: { type: string }
                    platform: { type: string, enum: [android, ios], description: Optional; updates the device. }
                    app: { type: string, maxLength: 40, description: Optional; updates the device. }
                    label: { type: string, maxLength: 60, description: Optional; updates the name shown in the TID list. }
            examples:
              access:
                value: { params: { deviceId: "g7Kp2Qx9", deviceSecret: "…" } }
      responses:
        "200":
          description: "`data: TerminalAccess` (`available: true`) or `TerminalUnavailable` (`available: false`), or an error."
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/TerminalEnvelope'
                  - type: object
                    properties:
                      data:
                        oneOf:
                          - $ref: '#/components/schemas/TerminalAccess'
                          - $ref: '#/components/schemas/TerminalUnavailable'
  /v3/claimTerminal:
    post:
      operationId: claimTerminal
      tags: [Card terminals]
      summary: Take over a TID of your business
      description: |
        Moves a TID of your own business to this device, for example after `getTerminalAccess` answered
        `available: false`. The device that held it loses it, and its open code request for this TID expires. A TID
        that does not exist, is inactive or belongs to another business gets the same answer
        (`terminal_not_in_business`).

        `fixed: true` binds the TID to this device (a TID fixed to this device before becomes free); `fixed: false`
        removes the binding of this TID to this device, the device keeps the TID; without `fixed` a binding stays as
        it is. Calling it again for a TID the device already holds only changes the binding. A TID fixed to another
        device cannot be taken over (`terminal_fixed`); a device with a fixed TID moves to another one only with
        `fixed: true` (`terminal_device_fixed`). Errors as `getTerminalAccess`, plus `terminal_not_in_business`,
        `terminal_fixed`, `terminal_device_fixed`, and `invalid_terminal_device` when `fixed` is not a boolean.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [deviceId, deviceSecret, terminalId]
                  properties:
                    deviceId: { type: string }
                    deviceSecret: { type: string }
                    terminalId: { type: string, description: "TID from the list of `getTerminalAccess`." }
                    label: { type: string, maxLength: 60, description: Optional; updates the name shown in the TID list. }
                    fixed: { type: boolean, description: "Optional. `true`: fix the TID to this device; `false`: remove the binding of this TID to this device; missing: keep the binding as it is." }
                    requestedBy: { type: string, maxLength: 80, description: "Optional; who asked for it (e.g. your support), noted in the log of Kasseneck." }
            examples:
              fix:
                value: { params: { deviceId: "g7Kp2Qx9", deviceSecret: "…", terminalId: "12345678", fixed: true } }
      responses:
        "200":
          description: "`data: TerminalAccess` (always `available: true`), or an error."
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/TerminalEnvelope'
                  - type: object
                    properties:
                      data: { $ref: '#/components/schemas/TerminalAccess' }
  /v3/unfixTerminal:
    post:
      operationId: unfixTerminal
      tags: [Card terminals]
      summary: Remove the fixed TID of this device
      description: |
        Removes every binding of a TID to this device (see `claimTerminal` with `fixed: true`). Nothing moves: the
        device keeps the TID it holds, which can now be handed out or taken over by the normal rules. Calling it again
        changes nothing. Use it when a device is replaced or lost; for a device whose `deviceSecret` is gone, ask the
        Kasseneck support. Errors as `getTerminalAccess`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [deviceId, deviceSecret]
                  properties:
                    deviceId: { type: string }
                    deviceSecret: { type: string }
                    requestedBy: { type: string, maxLength: 80, description: "Optional; who asked for it, noted in the log of Kasseneck." }
      responses:
        "200":
          description: "`data: {}`, or an error."
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TerminalEnvelope'
  /v3/requestTerminalCode:
    post:
      operationId: requestTerminalCode
      tags: [Card terminals]
      summary: Ask Kasseneck for the Genius Pay code
      description: |
        Genius Pay asks for a one-time code at the first sign-in on a device. With `autoCode: true` (see
        `getTerminalAccess`) Kasseneck fetches it from the mailbox of the account; then poll `getTerminalCode`. Tapping
        twice is harmless: an open request younger than 6 minutes stays. At most 6 requests per device and hour
        (`terminal_code_rate_limited`). Without automatic code the answer is `terminal_code_manual`: let the driver
        type the code. A device without a TID gets `terminal_not_assigned` (call `getTerminalAccess` first). Other
        errors as `getTerminalAccess`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [deviceId, deviceSecret, platform]
                  properties:
                    deviceId: { type: string }
                    deviceSecret: { type: string }
                    platform: { type: string, enum: [android, ios], description: "Decides how often `getTerminalCode` returns the code." }
                    requestedBy: { type: string, maxLength: 80, description: "Optional: who asks (name of the driver)." }
      responses:
        "200":
          description: "`data: { status }` (usually `searching`), or an error."
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/TerminalEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          status: { $ref: '#/components/schemas/TerminalCodeStatus' }
  /v3/getTerminalCode:
    post:
      operationId: getTerminalCode
      tags: [Card terminals]
      summary: State of the code request and of the set-up
      description: |
        Returns the state of the code request of this device and the set-up state. Poll it after
        `requestTerminalCode` (every few seconds) until `status` is `found`, `delivered`, `unclear`, `no_code` or
        `expired`. Without a request: `status: none`, so the call also tells the set-up state.

        `code` (`codeFormat.length` characters, currently 6, **case-sensitive**, never change it) comes with `found`: on Android exactly once (the next call answers
        `delivered` without code), on iOS until `validUntil`, because the driver types it into Genius Pay. `code` is a
        secret: never log it. `no_code` (nothing within 9 minutes) and `expired`: let the driver type the code or
        request again. `unclear`: one mail fitted several open requests; the Kasseneck support may still set the code.
        A code is valid 20 minutes from the mail. Errors as `getTerminalAccess`.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [deviceId, deviceSecret]
                  properties:
                    deviceId: { type: string }
                    deviceSecret: { type: string }
      responses:
        "200":
          description: "`data: { status, code?, source?, validUntil?, setup }`, or an error."
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/TerminalEnvelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          status: { $ref: '#/components/schemas/TerminalCodeStatus' }
                          code: { type: string, description: "Only with `found` (iOS also with `delivered` until `validUntil`). Case-sensitive." }
                          source: { type: string, enum: [mailbox, support], description: "Where the code came from: the mailbox of the account or the Kasseneck support." }
                          validUntil: { type: [string, "null"], format: date-time }
                          setup: { $ref: '#/components/schemas/TerminalSetup' }
  /v3/reportTerminalLogin:
    post:
      operationId: reportTerminalLogin
      tags: [Card terminals]
      summary: Report the result of the Genius Pay sign-in
      description: |
        Report after every sign-in to Genius Pay whether it worked. `newOnDevice: true` for the first sign-in of this
        TID on this device (the set-up starts, `setup.state: setting_up`); `success: false` sets `failed`. A
        `terminalId` other than the one assigned to the device is only noted. Errors as `getTerminalAccess`
        (`invalid_terminal_device` when `success`, `newOnDevice` or `terminalId` is missing or of the wrong type).
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [deviceId, deviceSecret, terminalId, success, newOnDevice]
                  properties:
                    deviceId: { type: string }
                    deviceSecret: { type: string }
                    terminalId: { type: string }
                    success: { type: boolean }
                    newOnDevice: { type: boolean, description: First sign-in of this TID on this device. }
      responses:
        "200":
          description: "`data: {}`, or an error."
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TerminalEnvelope'
  /v3/reportTerminalReady:
    post:
      operationId: reportTerminalReady
      tags: [Card terminals]
      summary: Report that Genius Pay is set up
      description: |
        Report when Genius Pay is ready to take payments on this device (`setup.state: ready`). Errors as
        `getTerminalAccess`, plus `terminal_not_assigned` for a device that is not known any more.
      security:
        - ApiKeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [deviceId, deviceSecret]
                  properties:
                    deviceId: { type: string }
                    deviceSecret: { type: string }
      responses:
        "200":
          description: "`data: {}`, or an error."
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TerminalEnvelope'
  /v3/getPartnerInfo:
    post:
      operationId: getPartnerInfo
      tags: [Partner]
      summary: Am I connected? Partner, environment, key, apps
      description: |
        The first call of every integration. Scope `partner:read`. `apps[].id` is the `appId`
        for `createPartnerCustomer`.

        `partner.canCreateAccess` says whether you may have a customer-panel login created for
        your businesses (`access.invite: true` in `createPartnerCustomer`). **The default is
        `false`**; Kasseneck enables it per partner. Without it the call answers
        `access_not_allowed` (`zugang_nicht_erlaubt` on `/v1`), and nothing is created.
      security:
        - PartnerKey: []
      requestBody:
        required: true
        content:
          application/json:
            schema: { $ref: '#/components/schemas/EmptyParams' }
            examples:
              call: { value: { params: {} } }
      responses:
        "200":
          description: Envelope with partner, environment, key and apps.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Envelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          partner:
                            type: object
                            properties:
                              id: { type: string, example: "p_…" }
                              name: { type: string }
                              status: { type: string, example: active, description: "`active`. A locked partner account gets an error without code instead." }
                              canCreateAccess: { type: boolean, default: false, description: "May customer-panel logins be created for your businesses (`access.invite: true`)? Enabled per partner by Kasseneck." }
                          env: { type: string, enum: [live, test], description: The environment of the key. }
                          scopes: { type: array, items: { type: string }, description: The scopes of this key. }
                          key:
                            type: object
                            properties:
                              hint: { type: string, description: The first characters of the key. }
                              label: { type: [string, "null"] }
                              createdAt: { type: [integer, "null"], description: Unix milliseconds. }
                              scopes: { type: array, items: { type: string } }
                          apps:
                            type: array
                            items:
                              type: object
                              properties:
                                id: { type: string, description: Use as `appId`. }
                                name: { type: string }
                                platform: { type: string }
                                status: { type: string, enum: [draft, in_review, approved, blocked] }
                                distributions: { type: array, items: { type: object } }
                                platforms: { type: array, items: { type: object } }
                                symbol: { type: [object, "null"], properties: { url: { type: string } } }
                                published: { type: boolean }
                                listingAllowed: { type: boolean }
              examples:
                test_key:
                  value:
                    status: success
                    message: ""
                    data:
                      partner: { id: "p_…", name: "Taxi Software GmbH", status: active, canCreateAccess: false }
                      env: test
                      scopes: ["partner:read", "customers:read", "customers:write", "webhooks:read", "webhooks:write"]
                      key: { hint: "pk_test_9fK2…", label: "Backend Test", createdAt: 1756460000000, scopes: ["partner:read", "customers:read", "customers:write", "webhooks:read", "webhooks:write"] }
                      apps:
                        - { id: "a_…", name: "Fahrer-App", platform: other, status: approved, distributions: [], platforms: [], symbol: null, published: false, listingAllowed: false }
  /v3/createPartnerCustomer:
    post:
      operationId: createPartnerCustomer
      tags: [Partner]
      summary: Create a business, everything in one call
      description: |
        Creates a business (Betrieb): everything in one call, no draft. Either the account is
        created completely or not at all. Scope `customers:write`.

        Every field is checked with the same rules as in Kasseneck's customer intake
        (`kreiseck_validator`). If something is wrong, **no** account is created; the answer
        is `code: "validation"` with `errors[{ field, message }]`, one entry per field with its
        path (e.g. `taxDetails.taxNumber`, `contacts.0.email`) and a German sentence for the
        user. Two guarantees: **one wrong value is one error** (a wrong `state` does not also
        report `companyName`, `address.*` or `legalForm` as missing), and **unknown fields are
        rejected, not dropped**, also nested and per contact (`iban`, `address.land`,
        `taxDetails.ustid`, `contacts.1.abteilung`).

        **What must be unique:**

        | Field | Unique where | Otherwise |
        |---|---|---|
        | `taxDetails.taxNumber` | across all of Kasseneck, per environment (the nine digits are compared, not the spelling) | your own business: `customer_exists` with its `customerId`; someone else's: `customer_conflict` with no further detail. Both carry the normalised tax number in `data.taxNumber` (a shorter, German field name on `/v1`). |
        | `business.email` | only with `access.invite: true` (then it becomes the login) | `email_taken`; without an invitation an address in use is no obstacle |
        | `idempotencyKey` | per partner | not an error: the same key returns the stored answer with `replayed: true`. Only a successful answer is stored. |

        **A rejected call leaves nothing behind**: no account, no login, no cash register, no
        used-up daily quota (the daily counter is the last check). The business is written in
        one batch; only the invitation mail can fail afterwards, and then the business exists
        anyway.

        A business created with a **live** key is **enabled immediately** and has the module
        `registrierkasse`; a live business needs an approved version of the app
        (`app_not_accepted`). If a price is agreed for new businesses in your terms, the
        response also carries the booked charge (`fee`).
      security:
        - PartnerKey: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  $ref: '#/components/schemas/CreatePartnerCustomerParams'
            examples:
              business:
                summary: Complete business (test environment)
                value:
                  params:
                    appId: "a_…"
                    idempotencyKey: "customer-4711"
                    business:
                      companyName: "Café Beispiel e.U."
                      legalForm: eu
                      email: "office@cafe-beispiel.at"
                      address: { street: "Musterstraße", number: "49/5", zip: "5020", city: "Salzburg" }
                      state: AT-5
                      taxDetails: { taxNumber: "91-123/4565", vatId: "ATU12345675", smallBusiness: false }
                      contacts:
                        - { name: "Anna Beispiel", email: "office@cafe-beispiel.at", phone: "+43 664 1234567", roles: [management] }
      responses:
        "200":
          description: Envelope with the new business or an error code.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Envelope'
                  - type: object
                    properties:
                      data:
                        oneOf:
                          - $ref: '#/components/schemas/PartnerCustomerCreated'
                          - $ref: '#/components/schemas/PartnerError'
              examples:
                created:
                  summary: Created (test key, so a test business)
                  value:
                    status: success
                    message: ""
                    data:
                      customerId: "ptest_…"
                      status: created
                      env: test
                      companyName: "Café Beispiel e.U."
                      appId: "a_…"
                      access: { invited: false, sentTo: null }
                      nextSteps:
                        - "FinanzOnline-Zugang einrichten lassen: Einrichtungs-Link an den Betrieb senden (sendPartnerCustomerFonLink)."
                        - "Signatureinheit beantragen (requestCustomerSignature) und auf das Ereignis signature.ready warten."
                        - "Zugangsdaten des Betriebs holen (getCustomerCredentials), um Belege zu signieren."
                        - "Testumgebung: die Kette läuft ohne uns durch, die Belege daraus sind aber keine gültigen RKSV-Belege."
                invalid:
                  summary: Validation error
                  value:
                    status: error
                    message: "Bitte Eingaben prüfen."
                    code: validation
                    data:
                      code: validation
                      errors:
                        - { field: "taxDetails.taxNumber", message: "Steuernummer bitte so: 12-345/6789 (steht auf jedem Schreiben des Finanzamts)." }
                        - { field: "contacts.0.email", message: "Bitte eine gültige E-Mail-Adresse eingeben (z. B. name@firma.at)." }
  /v3/checkPartnerCustomerEmail:
    post:
      operationId: checkPartnerCustomerEmail
      tags: [Partner]
      summary: Does this e-mail address already have a Kasseneck login?
      description: |
        Checks in advance whether an e-mail address already has a Kasseneck login, for forms
        that check the address while it is typed instead of failing with `email_taken` on
        submit. Only relevant with `access.invite: true`. Scope `customers:write`.

        `available: false` means: `createPartnerCustomer` with `access.invite: true` would
        answer `email_taken`. The business can be linked to you; contact hello@kasseneck.at.
        An invalid address is a `validation` error on `email`. The answer contains **only**
        `available`: never who owns the address, which partner it belongs to or since when the
        account exists, not even for your own businesses.

        **Tightly limited: 60 checks per hour and key** (a separate counter, on top of the
        general 600 calls per hour); above that `rate_limited` with `retryAfterSec`. The
        number of checks is recorded per partner and day. The partner portal uses the same
        endpoint with the owner's login.
      security:
        - PartnerKey: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [email]
                  properties:
                    email:
                      type: string
                      format: email
                      description: The planned `business.email`.
                      example: "office@cafe-beispiel.at"
            examples:
              check:
                value:
                  params: { email: "office@cafe-beispiel.at" }
      responses:
        "200":
          description: Envelope with the answer or an error code.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Envelope'
                  - type: object
                    properties:
                      data:
                        oneOf:
                          - type: object
                            required: [available]
                            properties:
                              available:
                                type: boolean
                                description: true = no Kasseneck login with this address yet.
                          - $ref: '#/components/schemas/PartnerError'
              examples:
                available:
                  value: { status: success, message: "", data: { available: true } }
                taken:
                  value: { status: success, message: "", data: { available: false } }
                too_many:
                  value: { status: error, message: "Zu viele Abfragen, bitte später erneut versuchen.", code: rate_limited, data: { code: rate_limited, retryAfterSec: 1840 } }
  /v3/listPartnerCustomers:
    post:
      operationId: listPartnerCustomers
      tags: [Partner]
      summary: List your businesses, newest first
      description: |
        Scope `customers:read`. Use it for reconciliation; for progress prefer webhooks.
        `fon` in each row shows, without one call per business, who has been sent the setup
        link, who opened it and who completed it.
      security:
        - PartnerKey: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  properties:
                    status: { type: string, description: "One of the status values (schema `CustomerStatus`); an unknown value is ignored." }
                    limit: { type: integer, minimum: 1, maximum: 200, default: 50 }
                    cursor: { type: string, description: The `cursor` of the previous page. }
            examples:
              all: { value: { params: {} } }
      responses:
        "200":
          description: Envelope with the list, cursor and total.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Envelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          customers: { type: array, items: { $ref: '#/components/schemas/PartnerCustomerRow' } }
                          cursor: { type: [string, "null"] }
                          total: { type: integer }
  /v3/getPartnerBilling:
    post:
      operationId: getPartnerBilling
      tags: [Partner]
      summary: Your billing – running month and closed months
      description: |
        Scope `billing:read`. `current` is the provisional figure for the running month
        (status `open`). `months` lists the running month first (`open`, with `projectionCents`),
        then the previous month as `pending_close` while its close is still pending, then the
        fixed months (`closed`, `invoiced`), newest first. Amounts are whole cents, net.
        A cancelled version (`void`) is never listed: each month appears once, with its valid
        version. A month that was re-issued shows `version` greater than 1.
      security:
        - PartnerKey: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params: { type: object }
            examples:
              all: { value: { params: {} } }
      responses:
        "200":
          description: Envelope with `current` and `months`.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Envelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          current: { $ref: '#/components/schemas/BillingView' }
                          months: { type: array, items: { $ref: '#/components/schemas/BillingMonthItem' } }
  /v3/getPartnerBillingMonth:
    post:
      operationId: getPartnerBillingMonth
      tags: [Partner]
      summary: One billing month with businesses and total
      description: |
        Scope `billing:read`. `month` is `YYYY-MM`; a malformed or future month answers `billing_month_invalid`.
        Returns the businesses with their cash registers, the lines and `totalNetCents`.
      security:
        - PartnerKey: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [month]
                  properties:
                    month: { type: string, pattern: '^\d{4}-\d{2}$', example: "2026-09" }
            examples:
              month: { value: { params: { month: "2026-09" } } }
      responses:
        "200":
          description: Envelope with the billing month.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Envelope'
                  - type: object
                    properties:
                      data: { $ref: '#/components/schemas/BillingView' }
  /v3/getPartnerCustomer:
    post:
      operationId: getPartnerCustomer
      tags: [Partner]
      summary: One business in detail
      description: |
        Scope `customers:read`. Secrets (the business's API key, FinanzOnline access) are
        never included. A business of another partner and an unknown ID both get the message
        „Betrieb nicht gefunden.“ without a code.
      security:
        - PartnerKey: []
      requestBody:
        required: true
        content:
          application/json:
            schema: { $ref: '#/components/schemas/CustomerIdParams' }
      responses:
        "200":
          description: Envelope with the business.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Envelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          customer: { $ref: '#/components/schemas/PartnerCustomer' }
  /v3/sendPartnerCustomerFonLink:
    post:
      operationId: sendPartnerCustomerFonLink
      tags: [Partner]
      summary: Send the business the setup link for FinanzOnline and its contracts
      description: |
        Sends the business (to `business.email`) the link (`einrichten.kasseneck.at`) to set up
        its FinanzOnline web service user. The business also confirms its contracts with
        Kasseneck through this link. Scope `customers:write`.

        The link is valid for 14 days; a new link replaces the old one. At most 3 links per
        business within 24 hours; above that `rate_limited` (without `retryAfterSec`). Without
        an e-mail address on file: `no_email`; without a tax number on file: `tax_number_missing`
        (`kennung_fehlt` on `/v1`).
      security:
        - PartnerKey: []
      requestBody:
        required: true
        content:
          application/json:
            schema: { $ref: '#/components/schemas/CustomerIdParams' }
      responses:
        "200":
          description: Envelope with `customerId`, `sentTo` (masked) and `expiresAt`.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Envelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          customerId: { type: string }
                          sentTo: { type: string, example: "o***@cafe-beispiel.at", description: Masked address. }
                          expiresAt: { type: integer, description: Unix milliseconds. }
  /v3/requestCustomerSignature:
    post:
      operationId: requestCustomerSignature
      tags: [Partner]
      summary: Request the signature creation unit of a business
      description: |
        Requests the signature creation unit (Signaturerstellungseinheit) of the business.
        Scope `customers:write`. You do not create a card: Kasseneck has it issued for this
        business by the trust service provider (that only works with its tax number) or
        activates a blank card from its own stock, and then registers it with FinanzOnline.

        The call **immediately creates a signature object**: `requestId` is also the
        `signatureRequestId` a cash register can refer to, even while the card does not exist.

        The business's FinanzOnline access is **not** needed to request; only the registration
        with FinanzOnline needs it. If it is still missing, the request is still created, the
        answer carries a `note`, and the request stays at `assigned` until the access is set up
        (`sendPartnerCustomerFonLink`).

        **One open request per business** (`requested`, `assigned`, `registered` and `failed`
        count as open): a second call returns the running one with `replayed: true` and creates
        nothing new; the same applies when a signature is already ready. **A business can have
        several signatures** (spare card, second location, replaced card): a further one is
        only created with `additional: true`. At most 10 requests per business, whatever their
        state (`signature_limit`). If the only existing signature has been decommissioned, a
        new one is created even without `additional`.

        Request status: `requested` → `assigned` (card data entered) → `registered`
        (registered with FinanzOnline) → `ready` (end state); `failed` with
        `error { code, message, rc }` (`rc` is the FinanzOnline return code; `code` names the
        underlying cause, only the webhook `signature.failed` carries `signature_failed`),
        after which Kasseneck retries; `cancelled`. `registered` means "FinanzOnline knows the unit",
        `ready` means "it may sign receipts". In the test environment `ready` is reached without
        `registered`: a background job fulfils open test requests every five minutes, then
        `signature.ready` fires. `statusText`, `note` and `error.message` are German text.

        When Kasseneck has blank cards in stock and has enabled this for your partner account, the request is fulfilled
        automatically (`fulfillment: automatic`): `signature.requested` immediately, `signature.ready` once the card may sign
        (without FinanzOnline access: after `customer.fon_verified`), `signature.failed` only if FinanzOnline rejects the
        registration. The answer then carries a `note` saying so.

        If a price is agreed for signatures in your terms, the response also carries the charge
        that was booked.
      security:
        - PartnerKey: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [customerId]
                  properties:
                    customerId: { type: string }
                    kind: { type: string, enum: [signature_card], default: signature_card, description: "Currently the only value. Any other value is a `validation` error (reported on the field `kind`; `art` on `/v1`)." }
                    additional: { type: boolean, default: false, description: "`true` requests a further signature although one already exists." }
      responses:
        "200":
          description: Envelope with `request`, optionally `replayed` and `note`.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Envelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          request: { $ref: '#/components/schemas/SignatureRequest' }
                          replayed: { type: boolean }
                          note: { type: string, description: German text for humans. }
              examples:
                requested:
                  value:
                    status: success
                    message: ""
                    data:
                      request:
                        requestId: "8Kx2mQ7vLp0R"
                        status: requested
                        statusText: "Beantragt"
                        kind: signature_card
                        vdaId: null
                        signatureId: null
                        error: null
                        requestedVia: api
                        createdAt: 1788052010642
                        updatedAt: 1788052010642
                        history: [{ from: null, to: requested, at: 1788052010642, reason: api }]
  /v3/getCustomerSignatureStatus:
    post:
      operationId: getCustomerSignatureStatus
      tags: [Partner]
      summary: Signature state of a business
      description: |
        Scope `customers:read`. `signature` says whether there is any usable signature;
        `signatures[]` lists **every** signature of the business separately, the view you need
        when a business has more than one. For the normal case listen for `signature.ready`
        instead.
      security:
        - PartnerKey: []
      requestBody:
        required: true
        content:
          application/json:
            schema: { $ref: '#/components/schemas/CustomerIdParams' }
      responses:
        "200":
          description: Envelope with the signature state.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Envelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          customerId: { type: string }
                          signature:
                            type: object
                            properties:
                              ready: { type: boolean }
                              signatureId: { type: [string, "null"] }
                              vdaId: { type: [string, "null"] }
                          signatures: { type: array, items: { $ref: '#/components/schemas/Signature' } }
                          requests: { type: array, description: "Newest first, with history.", items: { $ref: '#/components/schemas/SignatureRequest' } }
                          fon:
                            type: object
                            properties:
                              present: { type: boolean }
                              verifiedAt: { type: [integer, "null"] }
  /v3/createCustomerCashregister:
    post:
      operationId: createCustomerCashregister
      tags: [Partner]
      summary: Create a cash register for a business
      description: |
        Creates a cash register (Registrierkasse) for the business. Scope `customers:write`.

        **Cash register names are assigned automatically.** A name cannot be given: the cash
        register carries its ID (`KECK-1`, `KECK-2`, …) and the field `name` stays `null`. A
        `name` sent anyway is answered with `validation` (`errors: [{ field: "name", … }]`).

        **A cash register needs a signature reference.** Without at least one signature,
        finished or still in progress, no cash register is created: `signature_missing`. With
        exactly one usable signature it is preselected; with several, `signatureRequestId`
        must name one (otherwise `signature_ambiguous` with `choices[]`). An unknown, cancelled
        or decommissioned one: `signature_unknown`.

        If the referenced signature is not ready yet, the cash register stays `draft`
        (`activation: { "started": false, "reason": "signature_not_ready" }`) and goes live
        later by itself. **Its** signature counts: another, already ready signature does not
        start it. With `automatic: false` the reason is `automation_off` and you choose the
        moment yourself (`activateCashregister`). If the activation started but stopped,
        `activation` is `{ "started": true, "ok": false, "step": … }`. If the cash register
        goes live right when it is created, **both** webhooks fire: `cashregister.created`,
        then `cashregister.live`.

        At most 20 cash registers per business (`cashregister_limit`). If the module
        `registrierkasse` is not booked for the business: `module_inactive` (businesses created
        with a live key have it from the start).
      security:
        - PartnerKey: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [customerId]
                  properties:
                    customerId: { type: string }
                    automatic: { type: boolean, default: true, description: The cash register goes live by itself once its signature is ready. }
                    signatureRequestId: { type: string, description: "The signature the cash register refers to (`getCustomerSignatureStatus` → `signatures[].signatureRequestId`). Required if the business has more than one." }
      responses:
        "200":
          description: Envelope with `cashregister` and `activation`.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Envelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          cashregister: { $ref: '#/components/schemas/Cashregister' }
                          activation: { $ref: '#/components/schemas/Activation' }
              examples:
                live_right_away:
                  value:
                    status: success
                    message: ""
                    data:
                      cashregister:
                        cashregisterId: "KECK-1"
                        name: null
                        status: live
                        statusText: "In Betrieb"
                        automatic: true
                        step: null
                        stepText: null
                        completedSteps: [signature, register_cashregister, start_receipt, transmit_start_receipt]
                        steps: [{ key: signature, text: "Signaturkarte zuweisen" }]
                        signatureId: "0mGmHPN26SkZ"
                        signatureRequestId: "8Kx2mQ7vLp0R"
                        attempts: 0
                        lastError: null
                        createdAt: 1788052010642
                      activation: { started: true, ok: true, step: null }
  /v3/activateCashregister:
    post:
      operationId: activateCashregister
      tags: [Partner]
      summary: Put a cash register into operation
      description: |
        Scope `customers:write`. Runs the chain:

        | Step | What happens |
        |---|---|
        | `signature` | the ready signature creation unit is assigned to the cash register |
        | `register_cashregister` | the cash register is registered with FinanzOnline |
        | `start_receipt` | the start receipt (Startbeleg) is created and signed |
        | `transmit_start_receipt` | the start receipt is transmitted to FinanzOnline |

        In the test environment `register_cashregister` and `transmit_start_receipt` are
        skipped; the steps that apply are in the cash register's field `steps`.

        **Every step is idempotent.** Under RKSV the start receipt may exist exactly once; an
        existing one is detected. A repetition resumes where it stopped. A cash register that
        is already live answers with `{ "cashregister": …, "unchanged": true }`.

        Errors, each with `step`, `rc` (if FinanzOnline sent one) and the current
        `cashregister` in `data`: `signature_not_ready`, `fon_missing` (live only),
        `activation_failed` (call again to resume); these three also fire
        `cashregister.failed`. `contracts_pending` (`vertrag_offen` on `/v1`, live only): the
        business has not confirmed its contracts yet through the setup link; nothing has been
        changed (`step` and `rc` are `null`), call again after the confirmation.
        `activation_in_progress`: another activation of the same cash register (for example
        the automatic one after `signature.ready`) is running. Two calls for the same cash
        register are worked off one after the other: the second waits and then only does what
        is still missing (if the cash register is live by then, it answers with
        `unchanged: true`). If the first takes too long, the second answers with this code
        (`step` and `rc` are `null`); not a failure and no `cashregister.failed`, check the
        status later or call again. Also possible: `cashregister_not_found`, `module_inactive`.
      security:
        - PartnerKey: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [customerId, cashregisterId]
                  properties:
                    customerId: { type: string }
                    cashregisterId: { type: string, example: "KECK-1" }
      responses:
        "200":
          description: Envelope with `cashregister`, optionally `unchanged`.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Envelope'
                  - type: object
                    properties:
                      data:
                        oneOf:
                          - type: object
                            properties:
                              cashregister: { $ref: '#/components/schemas/Cashregister' }
                              unchanged: { type: boolean }
                          - $ref: '#/components/schemas/PartnerError'
  /v3/listCustomerCashregisters:
    post:
      operationId: listCustomerCashregisters
      tags: [Partner]
      summary: Cash registers of a business with their state
      description: |
        Scope `customers:read`. Never contains tokens. `signatures[]` are the signatures a new
        cash register can refer to (without cancelled and decommissioned ones).
      security:
        - PartnerKey: []
      requestBody:
        required: true
        content:
          application/json:
            schema: { $ref: '#/components/schemas/CustomerIdParams' }
      responses:
        "200":
          description: Envelope with `cashregisters[]`, `signatureReady` and `signatures[]`.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Envelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          customerId: { type: string }
                          cashregisters: { type: array, items: { $ref: '#/components/schemas/Cashregister' } }
                          signatureReady: { type: boolean }
                          signatures: { type: array, items: { $ref: '#/components/schemas/Signature' } }
  /v3/getCustomerCredentials:
    post:
      operationId: getCustomerCredentials
      tags: [Partner]
      summary: Credentials of the business for your app
      description: |
        Scope **`credentials:read`**, which is not in the standard set and is never added to
        existing keys: whoever holds these values can sign receipts in the name of the
        business. Create a dedicated key for it.

        With these values your app calls `createReceipt`: `Authorization: Bearer <apiKey>` and
        the header `cashregister-token: <cashregisterToken>`. The values belong to the
        business, not to you: store them encrypted only, never in logs, error messages or
        e-mails. **Every retrieval is logged** (partner, key, time) and visible to the business
        and Kasseneck.
      security:
        - PartnerKey: []
      requestBody:
        required: true
        content:
          application/json:
            schema: { $ref: '#/components/schemas/CustomerIdParams' }
      responses:
        "200":
          description: Envelope with the API key and the cash register tokens.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Envelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          customerId: { type: string }
                          companyName: { type: string }
                          env: { type: string, enum: [live, test] }
                          apiKey: { type: string, example: "kr_live_…" }
                          cashregisters:
                            type: array
                            items:
                              type: object
                              properties:
                                cashregisterId: { type: string, example: "KECK-1" }
                                name: { type: [string, "null"] }
                                live: { type: boolean }
                                cashregisterToken: { type: string, example: "cb_live_…" }
                          note: { type: string, description: German text for humans. }
  /v3/createPartnerWebhook:
    post:
      operationId: createPartnerWebhook
      tags: [Partner]
      summary: Create a webhook (the secret is only in this answer)
      description: |
        Scope `webhooks:write`. At most 10 webhooks per partner (`webhook_limit`). An unknown
        event name in `events` is a `validation` error. A webhook with `active: false`
        receives nothing.
      security:
        - PartnerKey: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [url, events]
                  properties:
                    url: { type: string, format: uri, description: "Full `https://` address, no credentials, no private host.", example: "https://api.example.at/kasseneck" }
                    events: { type: array, items: { $ref: '#/components/schemas/WebhookEventType' } }
                    description: { type: string, maxLength: 120 }
                    active: { type: boolean, default: true }
            examples:
              production:
                value: { params: { url: "https://api.example.at/kasseneck", events: [customer.status_changed, signature.ready, cashregister.live, webhook.test], description: "Production" } }
      responses:
        "200":
          description: Envelope with `webhook` and, only here, `secret` (`whsec_…`).
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Envelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          webhook: { $ref: '#/components/schemas/Webhook' }
                          secret: { type: string, description: "Only here: HMAC secret for the signature check." }
  /v3/updatePartnerWebhook:
    post:
      operationId: updatePartnerWebhook
      tags: [Partner]
      summary: Change a webhook (address, events, description, active)
      description: Scope `webhooks:write`. An unknown `webhookId` is answered with „Webhook nicht gefunden.“ (no code).
      security:
        - PartnerKey: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [webhookId, patch]
                  properties:
                    webhookId: { type: string }
                    patch:
                      type: object
                      properties:
                        url: { type: string, format: uri }
                        events: { type: array, items: { $ref: '#/components/schemas/WebhookEventType' } }
                        description: { type: string, maxLength: 120 }
                        active: { type: boolean }
      responses:
        "200":
          description: Envelope with `webhook`.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Envelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          webhook: { $ref: '#/components/schemas/Webhook' }
  /v3/deletePartnerWebhook:
    post:
      operationId: deletePartnerWebhook
      tags: [Partner]
      summary: Delete a webhook
      description: Scope `webhooks:write`. Pending deliveries of the webhook are dropped.
      security:
        - PartnerKey: []
      requestBody:
        required: true
        content:
          application/json:
            schema: { $ref: '#/components/schemas/WebhookIdParams' }
      responses:
        "200":
          description: "Envelope with `webhookId` and `deleted: true`."
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Envelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          webhookId: { type: string }
                          deleted: { type: boolean, const: true }
  /v3/rotatePartnerWebhookSecret:
    post:
      operationId: rotatePartnerWebhookSecret
      tags: [Partner]
      summary: New secret for an existing webhook
      description: |
        Scope `webhooks:write`. If your secret has been lost, change it here. The webhook keeps
        its `webhookId`, its events and its delivery history.

        **The old secret stops working immediately**; a grace period would be exactly the
        window you want to close with the change. Store the new one before you expect the next
        delivery; anything in between is retried anyway.
      security:
        - PartnerKey: []
      requestBody:
        required: true
        content:
          application/json:
            schema: { $ref: '#/components/schemas/WebhookIdParams' }
      responses:
        "200":
          description: Envelope with `webhook` and the new `secret`, again only here.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Envelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          webhook: { $ref: '#/components/schemas/Webhook' }
                          secret: { type: string }
  /v3/listPartnerWebhooks:
    post:
      operationId: listPartnerWebhooks
      tags: [Partner]
      summary: Your webhooks and the event catalog
      description: Scope `webhooks:read`. `events[]` lists all events you can subscribe to.
      security:
        - PartnerKey: []
      requestBody:
        required: true
        content:
          application/json:
            schema: { $ref: '#/components/schemas/EmptyParams' }
      responses:
        "200":
          description: Envelope with webhooks and event catalog.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Envelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          webhooks: { type: array, items: { $ref: '#/components/schemas/Webhook' } }
                          events: { type: array, items: { type: object, properties: { key: { $ref: '#/components/schemas/WebhookEventType' }, text: { type: string } } } }
  /v3/sendPartnerWebhookTest:
    post:
      operationId: sendPartnerWebhookTest
      tags: [Partner]
      summary: Test delivery of any event to your own endpoint
      description: |
        Scope `webhooks:write`. Without `event` you get `webhook.test`, the check that
        address, signature verification and response time are right. With `event` you get
        exactly that event with a payload filled as in the real case, with recognisably
        invented values: if your server writes to your customer on `signature.ready`, trigger
        exactly that once instead of waiting for a real signature card.

        **Every test delivery carries `test: true` in the envelope**; real events do not carry
        the field. Both require that the webhook **subscribes** to the event (otherwise
        `event_not_subscribed`) and is active (otherwise `webhook_inactive`). An event that
        does not exist is a field error on `event`.
      security:
        - PartnerKey: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [webhookId]
                  properties:
                    webhookId: { type: string }
                    event:
                      allOf: [{ $ref: '#/components/schemas/WebhookEventType' }]
                      description: The event to send. Default `webhook.test`.
                      example: signature.ready
      responses:
        "200":
          description: Envelope with `eventId`, `event` and `deliveries[]`.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Envelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          eventId: { type: string }
                          event: { $ref: '#/components/schemas/WebhookEventType' }
                          deliveries:
                            type: array
                            items:
                              type: object
                              properties:
                                deliveryId: { type: string }
                                webhookId: { type: string }
                                status: { type: string }
                                statusCode: { type: [integer, "null"] }
  /v3/listPartnerWebhookDeliveries:
    post:
      operationId: listPartnerWebhookDeliveries
      tags: [Partner]
      summary: Deliveries with status, attempts and response
      description: Scope `webhooks:read`. Newest first. Without `webhookId` the latest deliveries of all your webhooks.
      security:
        - PartnerKey: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  properties:
                    webhookId: { type: string }
                    limit: { type: integer, minimum: 1, maximum: 200, default: 50 }
      responses:
        "200":
          description: Envelope with `deliveries[]`.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Envelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          deliveries: { type: array, items: { $ref: '#/components/schemas/WebhookDelivery' } }

  /v3/reportCustomerContract:
    post:
      operationId: reportCustomerContract
      tags: [Partner]
      summary: Report a business's acceptance of the data processing agreement (power of attorney)
      description: |
        Scope `customers:write`. Only for partner accounts whose `avv.mode` is
        `power_of_attorney`: the partner reports that the business has accepted the data
        processing agreement (AVV) through the partner, with the partner contract's
        power-of-attorney chapter confirmed. `kind` can only be `avv` here
        (`kind_not_allowed` otherwise); a partner account without the power-of-attorney path
        gets `mode_not_allowed`, one without the confirmed chapter `power_of_attorney_missing`.
        A `customerId` that is not yours is `not_found`. `version` and `textHash` must be the
        version currently in force (`no_version`, `unknown_version`, `text_changed` with
        `data.textHash`); a version already confirmed is `already_accepted` with
        `data.contractId`. The event `customer.avv_accepted` follows.

        On `/v1` this endpoint is called `reportCustomerVertrag`, with German parameter names;
        see the migration table.
      security:
        - PartnerKey: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required: [params]
              properties:
                params:
                  type: object
                  required: [customerId, kind, version, textHash, name, signerRole]
                  properties:
                    customerId: { type: string }
                    kind: { type: string, enum: [avv, terms], description: "Only `avv` is accepted on this path." }
                    version: { type: string, description: The contract version in force. }
                    textHash: { type: string, description: Checksum of the contract text in force. }
                    name: { type: string, description: Name of the person who accepted. }
                    signerRole: { type: string, description: "Their role in the business, e.g. Geschäftsführer." }
                    acceptedAt: { type: integer, description: "Unix ms of the acceptance; not in the future, at most one year back. Default: now." }
      responses:
        "200":
          description: Envelope with the confirmed contract, or a `PartnerError`.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/Envelope'
                  - type: object
                    properties:
                      data:
                        type: object
                        properties:
                          contractId: { type: string }
                          confirmedAt: { type: integer, description: Unix ms. }
                          kind: { type: string, enum: [avv, terms] }
                          version: { type: string }
webhooks:
  customer.created:
    post:
      operationId: webhookCustomerCreated
      tags: [Partner]
      security: []
      summary: A business was created
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/WebhookEvent'
                - properties:
                    data:
                      type: object
                      properties:
                        customerId: { type: string }
                        companyName: { type: string }
                        appId: { type: [string, "null"] }
                        env: { type: string, enum: [live, test] }
                        status: { $ref: '#/components/schemas/CustomerStatus' }
      responses:
        "200": { description: Acknowledge with any 2xx within 10 seconds. }
  customer.updated:
    post:
      operationId: webhookCustomerUpdated
      tags: [Partner]
      security: []
      summary: A business was changed
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/WebhookEvent'
                - properties:
                    data:
                      type: object
                      properties:
                        customerId: { type: string }
                        companyName: { type: string }
                        appId: { type: [string, "null"] }
                        changed: { type: array, items: { type: string }, description: "List of changed fields, currently `[\"appId\"]` after an app was assigned in the portal." }
      responses:
        "200": { description: Acknowledge with any 2xx within 10 seconds. }
  customer.status_changed:
    post:
      operationId: webhookCustomerStatusChanged
      tags: [Partner]
      security: []
      summary: The status of a business changed
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/WebhookEvent'
                - properties:
                    data:
                      type: object
                      properties:
                        customerId: { type: string }
                        companyName: { type: string }
                        from: { $ref: '#/components/schemas/CustomerStatus' }
                        to: { $ref: '#/components/schemas/CustomerStatus' }
                        reason: { type: string, description: "e.g. `fon_verified`, `signature_requested`, `signature_ready`, `cashregister_created`, `live_enabled`" }
            example:
              id: "evt_…"
              type: customer.status_changed
              createdAt: 1756460000000
              partnerId: "p_…"
              data: { customerId: "ptest_…", companyName: "Café Beispiel e.U.", from: created, to: fon_configured, reason: fon_verified }
      responses:
        "200": { description: Acknowledge with any 2xx within 10 seconds. }
  customer.fon_verified:
    post:
      operationId: webhookCustomerFonVerified
      tags: [Partner]
      security: []
      summary: The FinanzOnline web service user of a business was verified
      description: "Arrives exactly once per business, when its FinanzOnline access is verified through the setup link, whatever the status is at that moment (without a `customer.status_changed` if the status had already moved past `fon_configured`)."
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/WebhookEvent'
                - properties:
                    data:
                      type: object
                      properties:
                        customerId: { type: string }
                        companyName: { type: string }
                        verifiedAt: { type: integer }
      responses:
        "200": { description: Acknowledge with any 2xx within 10 seconds. }
  customer.live_enabled:
    post:
      operationId: webhookCustomerLiveEnabled
      tags: [Partner]
      security: []
      summary: Kasseneck enabled live operation for a business
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/WebhookEvent'
                - properties:
                    data:
                      type: object
                      properties:
                        customerId: { type: string }
                        companyName: { type: string }
                        enabledAt: { type: integer }
      responses:
        "200": { description: Acknowledge with any 2xx within 10 seconds. }
  customer.avv_accepted:
    post:
      operationId: webhookCustomerAvvAccepted
      tags: [Partner]
      security: []
      summary: The business confirmed the data processing agreement (AVV)
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/WebhookEvent'
                - properties:
                    data:
                      type: object
                      properties:
                        customerId: { type: string }
                        companyName: { type: string }
                        kind: { type: string, const: avv }
                        version: { type: string }
                        confirmedAt: { type: integer }
                        source: { type: string, enum: [setup_link, process_link, partner_power_of_attorney, admin_paper, paper_upload], description: "Where the business confirmed. Shown here for a webhook with `apiVersion: \"v3\"`; a `v1` webhook sends the German values (`einrichten`, `prozess`, `partner_vollmacht`, `admin_papier`, `papier_upload`)." }
      responses:
        "200": { description: Acknowledge with any 2xx within 10 seconds. }
  customer.terms_accepted:
    post:
      operationId: webhookCustomerTermsAccepted
      tags: [Partner]
      security: []
      summary: The business confirmed the terms of use
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/WebhookEvent'
                - properties:
                    data:
                      type: object
                      properties:
                        customerId: { type: string }
                        companyName: { type: string }
                        kind: { type: string, const: terms, description: "A webhook with `apiVersion: \"v1\"` sends the German value `nutzung` here instead." }
                        version: { type: string }
                        confirmedAt: { type: integer }
                        source: { type: string, enum: [setup_link, process_link, partner_power_of_attorney, admin_paper, paper_upload], description: "Where the business confirmed. Shown here for a webhook with `apiVersion: \"v3\"`; a `v1` webhook sends the German values (`einrichten`, `prozess`, `partner_vollmacht`, `admin_papier`, `papier_upload`)." }
      responses:
        "200": { description: Acknowledge with any 2xx within 10 seconds. }
  signature.requested:
    post:
      operationId: webhookSignatureRequested
      tags: [Partner]
      security: []
      summary: A signature was requested
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/WebhookEvent'
                - properties:
                    data:
                      type: object
                      properties:
                        customerId: { type: string }
                        companyName: { type: string }
                        requestId: { type: string }
                        kind: { type: string, enum: [signature_card] }
                        env: { type: string, enum: [live, test] }
      responses:
        "200": { description: Acknowledge with any 2xx within 10 seconds. }
  signature.ready:
    post:
      operationId: webhookSignatureReady
      tags: [Partner]
      security: []
      summary: A signature creation unit is ready
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/WebhookEvent'
                - properties:
                    data:
                      type: object
                      properties:
                        customerId: { type: string }
                        companyName: { type: string }
                        requestId: { type: string }
                        kind: { type: string, enum: [signature_card] }
                        vdaId: { type: [string, "null"], example: "AT1" }
                        env: { type: string, enum: [live, test] }
      responses:
        "200": { description: Acknowledge with any 2xx within 10 seconds. }
  signature.failed:
    post:
      operationId: webhookSignatureFailed
      tags: [Partner]
      security: []
      summary: FinanzOnline rejected the registration of a signature creation unit
      description: "`code` is `signature_failed`; Kasseneck retries."
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/WebhookEvent'
                - properties:
                    data:
                      type: object
                      properties:
                        customerId: { type: string }
                        companyName: { type: string }
                        requestId: { type: string }
                        code: { type: string }
                        rc: { type: [string, "null"], description: FinanzOnline return code. }
                        message: { type: string, description: German text. }
      responses:
        "200": { description: Acknowledge with any 2xx within 10 seconds. }
  cashregister.created:
    post:
      operationId: webhookCashregisterCreated
      tags: [Partner]
      security: []
      summary: A cash register was created
      description: Always precedes `cashregister.live`, also when the cash register goes live right away.
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/WebhookEvent'
                - properties:
                    data:
                      type: object
                      properties:
                        customerId: { type: string }
                        companyName: { type: string }
                        cashregisterId: { type: string }
                        name: { type: [string, "null"] }
                        automatic: { type: boolean }
                        signatureRequestId: { type: [string, "null"] }
                        env: { type: string, enum: [live, test] }
      responses:
        "200": { description: Acknowledge with any 2xx within 10 seconds. }
  cashregister.live:
    post:
      operationId: webhookCashregisterLive
      tags: [Partner]
      security: []
      summary: A cash register went live
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/WebhookEvent'
                - properties:
                    data:
                      type: object
                      properties:
                        customerId: { type: string }
                        companyName: { type: string }
                        cashregisterId: { type: string }
                        name: { type: [string, "null"] }
                        env: { type: string, enum: [live, test] }
                        signatureId: { type: string }
      responses:
        "200": { description: Acknowledge with any 2xx within 10 seconds. }
  cashregister.failed:
    post:
      operationId: webhookCashregisterFailed
      tags: [Partner]
      security: []
      summary: A step of the activation failed
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/WebhookEvent'
                - properties:
                    data:
                      type: object
                      properties:
                        customerId: { type: string }
                        companyName: { type: string }
                        cashregisterId: { type: string }
                        step: { type: [string, "null"] }
                        code: { type: string }
                        rc: { type: [string, "null"] }
                        message: { type: string, description: German text. }
                        env: { type: string, enum: [live, test] }
      responses:
        "200": { description: Acknowledge with any 2xx within 10 seconds. }
  app.version.accepted:
    post:
      operationId: webhookAppVersionAccepted
      tags: [Partner]
      security: []
      summary: Kasseneck approved a version of your app
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/WebhookEvent'
                - properties:
                    data: { $ref: '#/components/schemas/AppVersionEventData' }
      responses:
        "200": { description: Acknowledge with any 2xx within 10 seconds. }
  app.version.rejected:
    post:
      operationId: webhookAppVersionRejected
      tags: [Partner]
      security: []
      summary: Kasseneck rejected a version of your app
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/WebhookEvent'
                - properties:
                    data: { $ref: '#/components/schemas/AppVersionEventData' }
      responses:
        "200": { description: Acknowledge with any 2xx within 10 seconds. }
  webhook.test:
    post:
      operationId: webhookTest
      tags: [Partner]
      security: []
      summary: Test delivery without a real event
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/WebhookEvent'
                - properties:
                    data:
                      type: object
                      properties:
                        webhookId: { type: string }
                        hello: { type: string, const: Kasseneck }
                        note: { type: string, description: German text. }
                        triggeredBy: { type: string, enum: [partner, api] }
      responses:
        "200": { description: Acknowledge with any 2xx within 10 seconds. }

  stock.changed:
    post:
      operationId: webhookStockChanged
      tags: [Inventory]
      security: []
      summary: The stock of an article at a location changed
      description: "Coalesced: at most one event per article and location within about 10 seconds, always with the newest state. Overwrite your state only when `sequence` is greater than the one you stored."
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/InventoryWebhookEvent'
                - properties:
                    type: { const: stock.changed }
                    data: { $ref: '#/components/schemas/StockChangedData' }
            example: {"id": "evt_4fJ2kL9mQ1xZ7pR3sT6v", "type": "stock.changed", "createdAt": 1791274510000, "accountId": "aB3dE5fG7hJ9kL1mN3pQ5rS7tU9", "data": {"articleId": "beispiel_roggenbrot", "locationId": "haupt", "onHand": 12000, "reserved": 0, "available": 12000, "defective": 0, "sequence": 42, "updatedAt": "2026-10-06T08:15:00.000Z", "cause": "sale", "movementId": "beispiel_bewegung_1"}}
      responses:
        "200": { description: Acknowledge with any 2xx within 10 seconds. }
  stock.below_minimum:
    post:
      operationId: webhookStockBelowMinimum
      tags: [Inventory]
      security: []
      summary: The available stock fell below the minimum stock
      description: "Sent right away when `available` (on hand minus reserved) falls below the minimum stock set for the location (`minStockByLocation`; the legacy `minStock` of the article never triggers it); `minStock` is that threshold. A reservation alone can trigger it. Sent again only after `available` was back at or above it."
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/InventoryWebhookEvent'
                - properties:
                    type: { const: stock.below_minimum }
                    data: { $ref: '#/components/schemas/StockBelowMinimumData' }
            example: {"id": "evt_4fJ2kL9mQ1xZ7pR3sT6v", "type": "stock.below_minimum", "createdAt": 1791274510000, "accountId": "aB3dE5fG7hJ9kL1mN3pQ5rS7tU9", "data": {"articleId": "beispiel_roggenbrot", "locationId": "haupt", "available": 4000, "minStock": 5000}}
      responses:
        "200": { description: Acknowledge with any 2xx within 10 seconds. }
  article.created:
    post:
      operationId: webhookArticleCreated
      tags: [Inventory]
      security: []
      summary: An article was created
      description: "The article as `getArticle` returns it, never with `purchasePriceMicros`."
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/InventoryWebhookEvent'
                - properties:
                    type: { const: article.created }
                    data: { $ref: '#/components/schemas/Article' }
            example: {"id": "evt_4fJ2kL9mQ1xZ7pR3sT6v", "type": "article.created", "createdAt": 1791274510000, "accountId": "aB3dE5fG7hJ9kL1mN3pQ5rS7tU9", "data": {"id": "beispiel_roggenbrot", "name": "Roggenbrot 1 kg", "description": null, "unitPriceCents": 450, "vatRate": 10, "unit": "Stk", "number": "A-100", "ean": "9001234567896", "internalCode": null, "groupId": "brot", "revenueGroupId": null, "stockTracked": true, "stockKind": "quantity", "minStock": null, "active": true, "createdAt": "2026-10-01T06:00:00.000Z", "updatedAt": "2026-10-06T08:15:00.000Z", "stockLocationIds": ["haupt"], "minStockByLocation": {"haupt": 5000}}}
      responses:
        "200": { description: Acknowledge with any 2xx within 10 seconds. }
  article.updated:
    post:
      operationId: webhookArticleUpdated
      tags: [Inventory]
      security: []
      summary: An article was changed
      description: "Only when a field the API shows changed; stock bookings alone (sales, goods receipts) do not send it. The article as `getArticle` returns it, never with `purchasePriceMicros`."
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/InventoryWebhookEvent'
                - properties:
                    type: { const: article.updated }
                    data: { $ref: '#/components/schemas/Article' }
            example: {"id": "evt_4fJ2kL9mQ1xZ7pR3sT6v", "type": "article.updated", "createdAt": 1791274510000, "accountId": "aB3dE5fG7hJ9kL1mN3pQ5rS7tU9", "data": {"id": "beispiel_roggenbrot", "name": "Roggenbrot 1 kg", "description": null, "unitPriceCents": 450, "vatRate": 10, "unit": "Stk", "number": "A-100", "ean": "9001234567896", "internalCode": null, "groupId": "brot", "revenueGroupId": null, "stockTracked": true, "stockKind": "quantity", "minStock": null, "active": true, "createdAt": "2026-10-01T06:00:00.000Z", "updatedAt": "2026-10-06T08:15:00.000Z", "stockLocationIds": ["haupt"], "minStockByLocation": {"haupt": 5000}}}
      responses:
        "200": { description: Acknowledge with any 2xx within 10 seconds. }
  article.deactivated:
    post:
      operationId: webhookArticleDeactivated
      tags: [Inventory]
      security: []
      summary: An article was deactivated
      description: "The article as `getArticle` returns it (`active: false`), never with `purchasePriceMicros`."
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/InventoryWebhookEvent'
                - properties:
                    type: { const: article.deactivated }
                    data: { $ref: '#/components/schemas/Article' }
            example: {"id": "evt_4fJ2kL9mQ1xZ7pR3sT6v", "type": "article.deactivated", "createdAt": 1791274510000, "accountId": "aB3dE5fG7hJ9kL1mN3pQ5rS7tU9", "data": {"id": "beispiel_roggenbrot", "name": "Roggenbrot 1 kg", "description": null, "unitPriceCents": 450, "vatRate": 10, "unit": "Stk", "number": "A-100", "ean": "9001234567896", "internalCode": null, "groupId": "brot", "revenueGroupId": null, "stockTracked": true, "stockKind": "quantity", "minStock": null, "active": false, "createdAt": "2026-10-01T06:00:00.000Z", "updatedAt": "2026-10-06T08:15:00.000Z", "stockLocationIds": ["haupt"], "minStockByLocation": {"haupt": 5000}}}
      responses:
        "200": { description: Acknowledge with any 2xx within 10 seconds. }
  reservation.expired:
    post:
      operationId: webhookReservationExpired
      tags: [Inventory]
      security: []
      summary: A reservation expired
      description: "The reservation reached its `expiresAt` before it was redeemed or released: the open quantity went back to `available`. The reservation as `getReservation` returns it, with `status: expired`."
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/InventoryWebhookEvent'
                - properties:
                    type: { const: reservation.expired }
                    data: { $ref: '#/components/schemas/Reservation' }
            example: {"id": "evt_4fJ2kL9mQ1xZ7pR3sT6v", "type": "reservation.expired", "createdAt": 1791273757000, "accountId": "aB3dE5fG7hJ9kL1mN3pQ5rS7tU9", "data": {"id": "beispiel_reservierung_1001", "status": "expired", "reference": "Bestellung 1001", "items": [{"articleId": "beispiel_roggenbrot", "locationId": "haupt", "quantity": 2000, "redeemed": 0, "released": 2000}, {"articleId": "beispiel_kipferl", "locationId": "lieferwagen", "quantity": 6000, "redeemed": 0, "released": 6000}], "expiresAt": "2026-10-06T07:02:23.000Z", "createdAt": "2026-10-06T06:02:17.000Z"}}
      responses:
        "200": { description: Acknowledge with any 2xx within 10 seconds. }
  reservation.released:
    post:
      operationId: webhookReservationReleased
      tags: [Inventory]
      security: []
      summary: A reservation was released
      description: "Sent for every `releaseReservation` that changes something, also a partial one. The reservation as `getReservation` returns it, with the status after the release (`active` while anything is still open, else `released`)."
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/InventoryWebhookEvent'
                - properties:
                    type: { const: reservation.released }
                    data: { $ref: '#/components/schemas/Reservation' }
            example: {"id": "evt_4fJ2kL9mQ1xZ7pR3sT6v", "type": "reservation.released", "createdAt": 1791266545000, "accountId": "aB3dE5fG7hJ9kL1mN3pQ5rS7tU9", "data": {"id": "beispiel_reservierung_1001", "status": "active", "reference": "Bestellung 1001", "items": [{"articleId": "beispiel_roggenbrot", "locationId": "haupt", "quantity": 2000, "redeemed": 0, "released": 0}, {"articleId": "beispiel_kipferl", "locationId": "lieferwagen", "quantity": 6000, "redeemed": 0, "released": 2000}], "expiresAt": "2026-10-06T07:02:23.000Z", "createdAt": "2026-10-06T06:02:17.000Z"}}
      responses:
        "200": { description: Acknowledge with any 2xx within 10 seconds. }
  reservation.redeemed:
    post:
      operationId: webhookReservationRedeemed
      tags: [Inventory]
      security: []
      summary: An invoice redeemed a reservation
      description: "Sent when the stock booking of an invoice (`issueInvoice` with `items[].reservationId`) redeemed the reservation, also partly. The reservation as `getReservation` returns it, with the status after it (`redeemed` once nothing is open)."
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/InventoryWebhookEvent'
                - properties:
                    type: { const: reservation.redeemed }
                    data: { $ref: '#/components/schemas/Reservation' }
            example: {"id": "evt_4fJ2kL9mQ1xZ7pR3sT6v", "type": "reservation.redeemed", "createdAt": 1791266555000, "accountId": "aB3dE5fG7hJ9kL1mN3pQ5rS7tU9", "data": {"id": "beispiel_reservierung_1005", "status": "redeemed", "reference": "Bestellung 1005", "items": [{"articleId": "beispiel_roggenbrot", "locationId": "haupt", "quantity": 1000, "redeemed": 1000, "released": 0}], "expiresAt": "2026-10-13T06:02:35.000Z", "createdAt": "2026-10-06T06:02:35.000Z"}}
      responses:
        "200": { description: Acknowledge with any 2xx within 10 seconds. }
  variant_group.created:
    post:
      operationId: webhookVariantGroupCreated
      tags: [Inventory]
      security: []
      summary: A variant group was created
      description: "Sent once per `createVariantGroup`, after the group and its variants were written (each variant also sends `article.created`). The group as `getVariantGroup` returns it."
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/InventoryWebhookEvent'
                - properties:
                    type: { const: variant_group.created }
                    data: { $ref: '#/components/schemas/VariantGroup' }
            example: {"id": "evt_4fJ2kL9mQ1xZ7pR3sT6v", "type": "variant_group.created", "createdAt": 1791273761000, "accountId": "aB3dE5fG7hJ9kL1mN3pQ5rS7tU9", "data": {"id": "beispiel_schuerze", "name": "Schürze", "attributes": [{"key": "groesse", "label": "Größe", "values": ["S", "M", "L"]}, {"key": "farbe", "label": "Farbe", "values": ["rot", "blau"]}], "defaults": {"unitPriceCents": 2490, "vatRate": 20, "stockTracked": true}, "active": true, "variants": [{"articleId": "beispiel_schuerze_m_rot", "variantAttributes": {"farbe": "rot", "groesse": "M"}}, {"articleId": "beispiel_schuerze_m_blau", "variantAttributes": {"farbe": "blau", "groesse": "M"}}, {"articleId": "beispiel_schuerze_l_rot", "variantAttributes": {"farbe": "rot", "groesse": "L"}}], "createdAt": "2026-10-06T08:02:41.000Z", "updatedAt": "2026-10-06T08:02:41.000Z"}}
      responses:
        "200": { description: Acknowledge with any 2xx within 10 seconds. }
  variant_group.updated:
    post:
      operationId: webhookVariantGroupUpdated
      tags: [Inventory]
      security: []
      summary: A variant group changed
      description: "Sent when a field of the group that the API shows changed: name, defaults, new values, `active`, or the list of variants (`addVariant`, deactivating a variant or the group). Not sent when nothing visible changed. The group as `getVariantGroup` returns it. It can arrive more than once and out of order: keep the payload with the newest `updatedAt`."
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/InventoryWebhookEvent'
                - properties:
                    type: { const: variant_group.updated }
                    data: { $ref: '#/components/schemas/VariantGroup' }
            example: {"id": "evt_4fJ2kL9mQ1xZ7pR3sT6v", "type": "variant_group.updated", "createdAt": 1791273769000, "accountId": "aB3dE5fG7hJ9kL1mN3pQ5rS7tU9", "data": {"id": "beispiel_schuerze", "name": "Schürze", "attributes": [{"key": "groesse", "label": "Größe", "values": ["S", "M", "L", "XL"]}, {"key": "farbe", "label": "Farbe", "values": ["rot", "blau"]}], "defaults": {"unitPriceCents": 2490, "vatRate": 20, "stockTracked": true}, "active": true, "variants": [{"articleId": "beispiel_schuerze_m_rot", "variantAttributes": {"farbe": "rot", "groesse": "M"}}, {"articleId": "beispiel_schuerze_m_blau", "variantAttributes": {"farbe": "blau", "groesse": "M"}}, {"articleId": "beispiel_schuerze_l_rot", "variantAttributes": {"farbe": "rot", "groesse": "L"}}, {"articleId": "beispiel_schuerze_xl_rot", "variantAttributes": {"farbe": "rot", "groesse": "XL"}}], "createdAt": "2026-10-06T08:02:41.000Z", "updatedAt": "2026-10-06T08:02:49.000Z"}}
      responses:
        "200": { description: Acknowledge with any 2xx within 10 seconds. }
  receipt.created:
    post:
      operationId: webhookReceiptCreated
      tags: [Inventory]
      security: []
      summary: A receipt was signed
      description: "Sent for every new signed receipt of any kind (sale, cancellation, start, zero, monthly, annual, final and training receipt), from the web register, the app and the API. Needs the cash register module. `receipt` is exactly the receipt of `listReceipts` with `view: full`. The `id` is fixed per receipt and event: deduplicate on it. A cancellation also sends `receipt.cancelled`."
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/InventoryWebhookEvent'
                - properties:
                    type: { const: receipt.created }
                    data: { $ref: '#/components/schemas/ReceiptCreatedData' }
            example: {"id": "evt_0aB1cD2eF3gH4iJ5kL6m", "type": "receipt.created", "createdAt": 1791274501000, "accountId": "aB3dE5fG7hJ9kL1mN3pQ5rS7tU9", "data": {"receipt": {"counter": 42, "receiptType": "standard", "zeroKind": null, "receiptId": "KECK-1-ID-42", "cashregisterId": "KECK-1", "timeStamp": "2026-10-06T10:15:00", "items": [{"name": "Semmel", "amount": 4, "priceOneCents": 79, "vat": 10, "priceOne": 0.79}, {"name": "Roggenbrot 1 kg", "amount": 1, "priceOneCents": 450, "vat": 10, "priceOne": 4.5}], "vouchers": [], "paymentMethod": "cash", "payments": [{"id": "p1", "method": "cash", "amountCents": 766}], "amountRateStandard": 0, "amountRateReduced1": 7.66, "amountRateReduced2": 0, "amountRateZero": 0, "amountRateSpecial": 0, "legalMessage": null, "fullReceiptId": "beispiel_frid_42", "testSignature": false}}}
      responses:
        "200": { description: Acknowledge with any 2xx within 10 seconds. }
  receipt.cancelled:
    post:
      operationId: webhookReceiptCancelled
      tags: [Inventory]
      security: []
      summary: A cancellation receipt was signed
      description: "Sent in addition to `receipt.created` when the new receipt is a cancellation. `cancelledItems` and `refunds` come from the cancellation receipt itself. `refunds[].amountCents` is always positive; the direction follows from the cancellation (sale: money back to the customer; payout: money back to the business), the sign stays in `receipt.payments[]`. The deprecated cancellation without reference has `cancellationOf: null`."
      requestBody:
        content:
          application/json:
            schema:
              allOf:
                - $ref: '#/components/schemas/InventoryWebhookEvent'
                - properties:
                    type: { const: receipt.cancelled }
                    data: { $ref: '#/components/schemas/ReceiptCancelledData' }
            example: {"id": "evt_9zY8xW7vU6tS5rQ4pO3n", "type": "receipt.cancelled", "createdAt": 1791274801000, "accountId": "aB3dE5fG7hJ9kL1mN3pQ5rS7tU9", "data": {"cancellationOf": "KECK-1-ID-42", "cancelledItems": [{"index": null, "quantity": 1}], "refunds": [{"refundOf": "p1", "amountCents": 450, "method": "cash"}], "receipt": {"counter": 43, "receiptType": "cancellation", "receiptId": "KECK-1-ID-43", "cashregisterId": "KECK-1", "timeStamp": "2026-10-06T10:20:00", "items": [{"name": "Roggenbrot 1 kg", "quantity": 1, "unitPriceCents": -450, "vatRate": 10}], "payments": [{"id": "p1", "method": "cash", "amountCents": -450, "refundOf": "p1"}], "amountRateReduced1": -4.5, "cancellationOf": {"receiptId": "KECK-1-ID-42", "fullReceiptId": "beispiel_frid_42", "timeStamp": "2026-10-06T10:15:00"}, "cancellationReason": "input_error", "testSignature": false}}}
      responses:
        "200": { description: Acknowledge with any 2xx within 10 seconds. }

components:
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      description: API key of the business in the bearer header (`kr_live_…` / `kr_test_…`).
    CashregisterToken:
      type: apiKey
      in: header
      name: cashregister-token
      description: Token of the cash register (`cb_live_…` / `cb_test_…`).
    PartnerKey:
      type: http
      scheme: bearer
      description: Partner key from the partner portal (`pk_live_…` / `pk_test_…`), with scopes. No `cashregister-token`.
  headers:
    RetryAfter:
      description: "Only with `rate_limited`: seconds to wait before the next call (same value as `data.retryAfterSec`)."
      schema: { type: integer, minimum: 1 }
  schemas:
    EmptyParams:
      type: object
      required: [params]
      properties:
        params: { type: object }
    CustomerIdParams:
      type: object
      required: [params]
      properties:
        params:
          type: object
          required: [customerId]
          properties:
            customerId: { type: string, description: ID of the business (from `createPartnerCustomer`). }
    WebhookIdParams:
      type: object
      required: [params]
      properties:
        params:
          type: object
          required: [webhookId]
          properties:
            webhookId: { type: string }
    Envelope:
      type: object
      properties:
        status: { type: string, enum: [success, error] }
        message: { type: string, description: German text for humans. }
        code: { type: string, description: "On errors with a code: the same value as `data.code`." }
        data: { type: object }
    PartnerErrorCode:
      type: string
      description: |
        Machine-readable reason in `data.code` (HTTP 200, `status: "error"`). The code is the
        truth: it stays stable, the German `message` may change. Same order as the list `api`
        in `/fehlercodes.json` (translated through its `v3` map). One entry is reserved and
        one only reaches you through a webhook; the table says so. This enum is the `/v3`
        code; `/v1` returns the German original for the handful that differ (see the
        migration table above) and otherwise the same code.

        | `code` | When | Extra fields in `data` |
        |---|---|---|
        | `validation` | one or more fields are invalid or unknown | `errors[{ field, message }]` |
        | `rate_limited` | 600 calls per key and hour, 60 e-mail checks per key and hour (`checkPartnerCustomerEmail`), 3 setup links per business within 24 hours (`sendPartnerCustomerFonLink`) | `retryAfterSec` (not for setup links) |
        | `app_not_found` | the `appId` does not belong to you | none |
        | `app_not_accepted` | a live business, but no version of the app has been approved yet | none |
        | `live_not_allowed` | `env: "live"` with a test key | none |
        | `customer_exists` | the tax number already belongs to one of your businesses in this environment | `customerId`, `taxNumber` |
        | `customer_conflict` | the tax number is already registered with Kasseneck, but not with you; contact hello@kasseneck.at | `taxNumber` |
        | `customer_limit` | 20 live or 100 test businesses per partner and day (Europe/Vienna); only successful calls count | `max`, `resetAt` (Unix ms, next day 00:00 Vienna time) |
        | `access_not_allowed` | `access.invite: true` although customer-panel logins are not enabled for your partner account (`getPartnerInfo` → `partner.canCreateAccess`); nothing is created, not even the business | none |
        | `email_taken` | `business.email` already has a Kasseneck login (checked only with `access.invite: true`) | `field: "email"` |
        | `no_email` | no e-mail address is on file for the business | none |
        | `tax_number_missing` | `sendPartnerCustomerFonLink`, but no tax number is on file for the business; without it no setup link can be created | none |
        | `fon_missing` | the business has no FinanzOnline access yet; from the FinanzOnline steps of `activateCashregister`, never from requesting a signature | `step`, `rc`, `cashregister` |
        | `signature_pending` | reserved, currently not returned (a second request returns the open one with `replayed: true`) | none |
        | `signature_missing` | `createCustomerCashregister` without any signature | `signatures` (empty) |
        | `signature_unknown` | `signatureRequestId` is not a usable signature of this business | `signatures` |
        | `signature_ambiguous` | several signatures and `signatureRequestId` is missing | `choices`, `signatures` |
        | `signature_not_ready` | the cash register is to go live, but **its** signature is not ready yet | `step`, `cashregister` |
        | `signature_limit` | the business already has 10 signature requests (every state counts) | none |
        | `signature_failed` | FinanzOnline rejected the registration of the signature creation unit; only as `code` in the `signature.failed` webhook, never as an API error; `error` of the signature request names the underlying cause instead | `rc` |
        | `module_inactive` | the module registrierkasse (fiscal cash register) is not active for this business | `module` |
        | `cashregister_limit` | the business already has 20 cash registers | none |
        | `cashregister_not_found` | this `cashregisterId` does not exist for the business | none |
        | `contracts_pending` | live only: the business has not confirmed its data processing agreement and terms of use yet (through the setup link); nothing is changed, call `activateCashregister` again after the confirmation | `cashregister` (`step` and `rc` are `null`) |
        | `kind_not_allowed` | `reportCustomerContract` with a `kind` other than `avv`; the power-of-attorney path only accepts the data processing agreement (AVV) | none |
        | `mode_not_allowed` | the power-of-attorney path is not enabled for this partner account | none |
        | `power_of_attorney_missing` | the partner contract including the power-of-attorney chapter has not been confirmed yet | none |
        | `not_found` | `reportCustomerContract` for a `customerId` that does not belong to you or does not exist | none |
        | `no_version` | no version of the reported contract type is currently in force | none |
        | `unknown_version` | the reported contract version does not exist | none |
        | `text_changed` | `textHash` does not match the version currently in force; the text shown has changed since | `textHash` (the checksum currently in force) |
        | `already_accepted` | this version has already been confirmed | `contractId` |
        | `activation_failed` | a step of the activation failed; calling `activateCashregister` again resumes there | `step`, `rc`, `cashregister` |
        | `activation_in_progress` | another activation of the same cash register is running right now (for example automatically after `signature.ready`); the call waited, but it has not finished yet. Not a failure, no `cashregister.failed`; check the status later or call again | `cashregister` |
        | `webhook_limit` | you already have 10 webhooks | none |
        | `webhook_inactive` | test delivery to an inactive webhook | none |
        | `event_not_subscribed` | test delivery of an event the webhook does not subscribe to | none |

        Without a code (only `message`): missing or wrongly typed parameters, a request that is
        not `POST`, an invalid or revoked key, a locked partner account, a missing scope,
        „Betrieb nicht gefunden.“ (also for businesses of other partners), „Webhook nicht
        gefunden.“ and „Aktion fehlgeschlagen.“ (unexpected server error; retry later).

        Codes of the partner portal never come through the API (list `portal` in
        `/fehlercodes.json`).
      enum: [validation, rate_limited, app_not_found, app_not_accepted, live_not_allowed, customer_exists, customer_conflict, customer_limit, access_not_allowed, email_taken, no_email, tax_number_missing, fon_missing, signature_pending, signature_missing, signature_unknown, signature_ambiguous, signature_not_ready, signature_limit, signature_failed, module_inactive, cashregister_limit, cashregister_not_found, contracts_pending, kind_not_allowed, mode_not_allowed, power_of_attorney_missing, not_found, no_version, unknown_version, text_changed, already_accepted, activation_failed, activation_in_progress, webhook_limit, webhook_inactive, event_not_subscribed]
    PartnerError:
      type: object
      required: [code]
      properties:
        code: { $ref: '#/components/schemas/PartnerErrorCode' }
        errors:
          type: array
          description: Only with `validation`; one entry per field with path and German sentence.
          items: { type: object, properties: { field: { type: string, example: "taxDetails.taxNumber" }, message: { type: string } } }
        customerId: { type: string, description: Only with `customer_exists`. }
        taxNumber: { type: string, description: "With `customer_exists` and `customer_conflict`: the normalised tax number." }
        field: { type: string, description: "Only with `email_taken`: `email`." }
        retryAfterSec: { type: integer, description: With `rate_limited` (not for setup links). }
        max: { type: integer, description: Only with `customer_limit`. }
        resetAt: { type: integer, description: "Only with `customer_limit`: Unix ms, next day 00:00 Europe/Vienna." }
        step: { type: [string, "null"], description: "With `activation_failed`, `fon_missing`, `signature_not_ready`: the step where the activation stopped (`null` with `contracts_pending`)." }
        rc: { type: [string, "null"], description: "FinanzOnline return code, if one was sent." }
        cashregister: { $ref: '#/components/schemas/Cashregister' }
        signatures: { type: array, items: { $ref: '#/components/schemas/Signature' }, description: "With `signature_missing`, `signature_unknown`, `signature_ambiguous`." }
        choices: { type: array, items: { type: string }, description: "Only with `signature_ambiguous`: the signatureRequestId of each signature to choose from." }
        module: { type: string, description: "Only with `module_inactive`: the missing module, `cash_register`." }
        detail: { type: string, description: "Only with `module_inactive`: a German sentence for humans." }
        textHash: { type: string, description: "Only with `text_changed`: the checksum of the version currently in force." }
        contractId: { type: string, description: "Only with `already_accepted`: the confirmed contract's id." }
    CustomerStatus:
      type: string
      description: |
        `created` → `fon_configured` → `signature_requested` → `signature_ready` →
        `cashregister_created`; `live` (Kasseneck enabled live operation by hand, from any
        status); `blocked` (Kasseneck disabled live operation, back to any other status). The
        status names the furthest milestone reached and only moves forward. Every change fires
        `customer.status_changed`.
      enum: [created, fon_configured, signature_requested, signature_ready, cashregister_created, live, blocked]
    Business:
      type: object
      description: |
        The data of the business, checked like Kasseneck's customer intake
        (`kreiseck_validator`). **Unknown fields are rejected** with `validation`, also nested
        and per contact.
      required: [companyName, email, legalForm, address, state, taxDetails, contacts]
      properties:
        companyName: { type: string, description: "Registered company name, up to 120 characters (longer values are cut)." }
        email: { type: string, format: email, description: "E-mail address of the business. The setup link and notices go here. Only with `access.invite: true` does it also become the login; then it must not have a Kasseneck login yet (`email_taken`)." }
        legalForm: { type: string, enum: [sole_proprietor, eu, og, kg, gmbh, gmbhcokg, ag, association, other], description: "`sole_proprietor` = Einzelunternehmen, `association` = Verein, `other` = sonstige; `eu`, `og`, `kg`, `gmbh`, `gmbhcokg`, `ag` are the Austrian short forms and stay as they are." }
        address:
          type: object
          required: [street, zip, city]
          properties:
            street: { type: string, description: "Street (legacy data: street including house number)." }
            number: { type: string, description: "Recommended. House number, short and alphanumeric: 49, 12a, 49/5.", example: "49/5" }
            zip: { type: string, pattern: '^\d{4}$', description: Austrian postal code (4 digits). }
            city: { type: string }
        state: { type: string, enum: [AT-1, AT-2, AT-3, AT-4, AT-5, AT-6, AT-7, AT-8, AT-9], description: "ISO 3166-2: AT-1 Burgenland, AT-2 Kärnten, AT-3 Niederösterreich, AT-4 Oberösterreich, AT-5 Salzburg, AT-6 Steiermark, AT-7 Tirol, AT-8 Vorarlberg, AT-9 Wien." }
        taxDetails:
          type: object
          required: [taxNumber, smallBusiness]
          properties:
            taxNumber: { type: string, example: "12-345/6789", description: "Austrian tax number, format 12-345/6789 (check digit is verified)." }
            smallBusiness: { type: boolean, description: "Small business under § 6 (1) no. 27 UStG (VAT exemption)." }
            vatId: { type: string, example: "ATU12345675", description: "VAT ID (UID), check digit is verified." }
            gln: { type: string, pattern: '^\d{13}$', description: "GLN, 13 digits." }
        contacts:
          type: array
          minItems: 1
          maxItems: 10
          items:
            type: object
            required: [name, email]
            properties:
              name: { type: string }
              email: { type: string, format: email }
              phone: { type: string, example: "+43 664 1234567" }
              roles: { type: array, description: "Unknown roles are dropped.", items: { type: string, enum: [management, accounting, technical, pos] } }
        billingEmail: { type: string, format: email, description: E-mail for invoices; defaults to `business.email`. }
        companyRegister: { type: string, example: "FN 123456 d", description: Company register number. }
        court: { type: string, description: "Company register court as code (`LG_SALZBURG`, `HG_WIEN`, `LG_ZRS_GRAZ`, `LG_ST_POELTEN`, …), official name or free text. Known courts come back as `court` (name) plus `courtCode`; anything else stays free text." }
        web: { type: string, description: Website URL. }
        phone: { type: string, description: "Austrian format, e.g. +43 664 1234567." }
        industry: { type: string, description: Free text. }
        taxAdvisor:
          type: object
          description: The business's accountant, if questions should go there.
          properties:
            name: { type: string }
            email: { type: string, format: email }
            phone: { type: string }
            mayContact: { type: boolean }
    CreatePartnerCustomerParams:
      type: object
      required: [appId, business]
      properties:
        appId: { type: string, description: "The app the business comes through (`getPartnerInfo` → `apps[].id`). For a live business a version of the app must be approved." }
        business: { $ref: '#/components/schemas/Business' }
        idempotencyKey: { type: string, description: "Recommended, e.g. your own customer ID. Up to 120 characters (longer keys are cut). The same key returns the same answer (`replayed: true`) instead of a second account, even if the body has changed: the key counts, not the content." }
        env:
          type: string
          enum: [live, test]
          description: |
            Without it the key decides. With a **live** key you may create a **test** business
            explicitly and rehearse the whole chain. Never the other way round: a test key with
            `env: "live"` answers `live_not_allowed`, and nothing is created. Any other value is
            a `validation` error on `env`.
        access:
          type: object
          description: |
            **Default `{ "invite": false }`**: no customer-panel login and no invitation mail. With
            `{ "invite": true }` Kasseneck creates a login (without password) for
            `business.email` and sends the invitation „Willkommen bei Kasseneck“ with a link to
            set a password; an address that already has a login is rejected (`email_taken`).
            Requires that Kasseneck has enabled customer-panel logins for your partner account
            (`getPartnerInfo` → `partner.canCreateAccess`), otherwise `access_not_allowed`
            (`zugang_nicht_erlaubt` on `/v1`) and nothing is created. A login can be added later
            only in the partner portal.
          properties:
            invite: { type: boolean, default: false }
    PartnerCustomerCreated:
      type: object
      properties:
        customerId: { type: string, description: "Starts with `ptest_` for test businesses." }
        status: { $ref: '#/components/schemas/CustomerStatus' }
        env: { type: string, enum: [live, test] }
        companyName: { type: string }
        appId: { type: [string, "null"] }
        access:
          type: object
          properties:
            invited: { type: boolean }
            sentTo: { type: [string, "null"], description: Masked address of the invitation. }
        nextSteps: { type: array, items: { type: string }, description: German text for humans; do not parse it. }
        fee:
          type: object
          description: "Only if a price for new businesses is agreed in your terms: the booked charge."
          properties:
            cents: { type: [integer, "null"] }
            interval: { type: [string, "null"], enum: [monthly, yearly, once, null], description: Billing interval. }
            test: { type: boolean }
        replayed: { type: boolean, description: "`true` on a repetition with the same `idempotencyKey`." }
    FonShort:
      type: object
      description: FinanzOnline state in short form.
      properties:
        configured: { type: boolean, description: FinanzOnline access verified. }
        linkSentAt: { type: [integer, "null"], description: "When the setup link went out (Unix ms); null if never." }
        linkOpenedAt: { type: [integer, "null"], description: "First opening of the current link; reset when a replacement link is sent." }
    ContractState:
      type: object
      description: State of a contract of the business with Kasseneck (see *Contracts of the business*).
      properties:
        status: { type: string, enum: [pending, confirmed, outdated, not_required, via_partner], description: "`outdated`: a newer version must be confirmed. `not_required`: test environment. `via_partner` (AVV only): your partner contract covers the AVV." }
        version: { type: [string, "null"] }
        confirmedAt: { type: [integer, "null"] }
        mode: { type: string, enum: [direct, power_of_attorney, subprocessor], description: "AVV only: how your partner account handles the AVV." }
    BillingStatus:
      type: string
      enum: [open, pending_close, closed, invoiced, void]
      description: |
        `open` = running month, provisional. `pending_close` = past month whose close is still pending, the figure is calculated but not binding yet.
        `closed` = fixed. `invoiced` = fixed and invoiced (credit note only). `void` = cancelled version; it never appears in `months` (a re-issued month is listed once, with `version` greater than 1).
    BillingRegister:
      type: object
      properties:
        registerId: { type: string }
        name: { type: string }
        days: { type: integer, description: "Days the register was active in the month." }
        receipts: { type: integer }
        package: { type: [string, "null"] }
        contractMonth: { type: integer, description: Month of the contract term the register is in. }
        costCents: { type: integer, description: "Net, discounts included." }
        listCents: { type: [integer, "null"], description: "Regular price in cents, where known." }
    BillingBusiness:
      type: object
      properties:
        customerId: { type: string }
        name: { type: string }
        test: { type: boolean }
        registers: { type: array, items: { $ref: '#/components/schemas/BillingRegister' } }
    BillingLine:
      type: object
      properties:
        source: { type: string, enum: [base, one_off, adjustment], description: "`base` = base price, `one_off` = one-time item, `adjustment` = surcharge or discount." }
        component:
          type: [string, "null"]
          enum: [package, flat, tiered_by_count, tiered_by_term, free_units, starter_discount, volume_discount, percentage, fixed_adjustment, minimum_amount, maximum_amount, null]
          description: Building block of the conditions that produced the line; `null` for one-off items and registers without conditions.
        customerId: { type: [string, "null"] }
        registerId: { type: [string, "null"] }
        registerName: { type: [string, "null"] }
        quantity: { type: [integer, "null"] }
        unitCents: { type: [integer, "null"] }
        amountCents: { type: integer, description: "Net; negative for discounts." }
        package: { type: [string, "null"] }
        test: { type: boolean }
        description: { type: string, description: Explanation text (German). }
    BillingView:
      type: object
      properties:
        month: { type: string, example: "2026-09" }
        status: { $ref: '#/components/schemas/BillingStatus' }
        version: { type: [integer, "null"], description: Version of a closed month; null while not closed. }
        preliminary: { type: boolean, description: true for `open` and `pending_close`. }
        totalNetCents: { type: integer }
        costSoFarCents: { type: integer, description: Only while `open`. }
        projectionCents: { type: [integer, "null"], description: "Only while `open`; estimate for the whole month (see `projection`). `null` only when the server has no estimate (older cached figure)." }
        asOf: { type: [integer, "null"], description: "Only while `open`: time of the figure (ms)." }
        projection:
          description: "Only while `open`: estimate for the whole month, available from the 1st. During the first 48 hours of the month (Vienna time) each register counts with its receipts of the previous month, unscaled (`method: previous_month`; a register without receipts last month keeps its actual count so far). After that, receipts of each register are extrapolated from its operating time so far in the month to its full operating time in the month (`method: operating_time`; a register with less than 48 hours of operation this month keeps its actual count). Priced like at month end, so packages and discounts apply as they would. Not binding: the month is closed with the actual receipts. `null` only when the server has no estimate (older cached figure); `projectionCents` equals `projection.totalNetCents` when present."
          anyOf:
            - { $ref: '#/components/schemas/BillingProjection' }
            - { type: "null" }
        conditionsHash: { type: [string, "null"] }
        metrics:
          type: object
          properties:
            activeRegisters: { type: integer }
            activeBusinesses: { type: integer }
            partnerMonth: { type: [integer, "null"] }
        businesses: { type: array, items: { $ref: '#/components/schemas/BillingBusiness' } }
        lines: { type: array, items: { $ref: '#/components/schemas/BillingLine' } }
        notes:
          type: array
          description: "Hints about the calculation. `no_conditions` = no conditions on file, nothing billed. `stats_not_final` = receipt statistics not final yet. `conditions_from_mid_month` = conditions start within the month. `unpriced_item` = a one-off item without a price. `conditions_invalid` = conditions could not be read. `position_not_billed:<n>` = position n of the conditions (0-based) could not be calculated. Unknown codes may be added; ignore what you do not know."
          items:
            anyOf:
              - { type: string, enum: [no_conditions, stats_not_final, conditions_from_mid_month, unpriced_item, conditions_invalid] }
              - { type: string, pattern: '^position_not_billed:[0-9]+$' }
        savingsCents: { type: integer, description: What the conditions save this month compared with the regular price (stepped prices plus discounts granted). }
        outlook:
          type: object
          properties:
            volumeDiscount:
              type: [object, "null"]
              properties:
                fromRegisters: { type: integer }
                percentBp: { type: integer, description: Discount in basis points. }
                packages: { type: [array, "null"], items: { type: string } }
        invoiceId: { type: [string, "null"] }
    BillingProjection:
      type: object
      description: Estimate for the running month (during the first 48 hours of the month the previous month's receipts per register; afterwards each register's receipts extrapolated from its operating time so far, registers with under 48 hours of operation are not scaled). Same shape as the corresponding fields of BillingView.
      properties:
        totalNetCents: { type: integer }
        businesses: { type: array, items: { $ref: '#/components/schemas/BillingBusiness' } }
        lines: { type: array, items: { $ref: '#/components/schemas/BillingLine' } }
        savingsCents: { type: integer }
        method: { type: string, enum: [previous_month, operating_time], description: "`previous_month` = first 48 hours of the month, each register counts with its previous month's receipts. `operating_time` = receipts extrapolated from each register's operating time so far in the month." }
    BillingMonthItem:
      type: object
      description: One row of the month list. `projectionCents` only for `open`; `version` and `closedAt` only for fixed months.
      properties:
        month: { type: string, example: "2026-09" }
        status: { $ref: '#/components/schemas/BillingStatus' }
        totalNetCents: { type: integer }
        projectionCents: { type: [integer, "null"], description: "Only for `open`; `null` only when the server has no estimate (older cached figure)." }
        version: { type: integer }
        closedAt: { type: [integer, "null"] }
        invoiceId: { type: [string, "null"] }
    PartnerCustomerRow:
      type: object
      properties:
        customerId: { type: string }
        companyName: { type: string }
        status: { $ref: '#/components/schemas/CustomerStatus' }
        appId: { type: [string, "null"] }
        env: { type: string, enum: [live, test] }
        createdAt: { type: [integer, "null"], description: Unix milliseconds. }
        fon: { $ref: '#/components/schemas/FonShort' }
        avv: { $ref: '#/components/schemas/ContractState' }
        terms: { $ref: '#/components/schemas/ContractState' }
        usage:
          type: [object, "null"]
          description: |
            Usage and cost of the running month, from the same calculation as the billing.
            Only with scope `billing:read`; without it the field is missing. `null` if it could not
            be calculated in time (the list is never held back for it) or the business has no
            usage this month.
          properties:
            activeRegisters: { type: integer }
            receipts: { type: integer }
            packages:
              type: array
              description: One entry per register with a package.
              items:
                type: object
                properties:
                  registerId: { type: string }
                  name: { type: string, description: Package name. }
                  receipts: { type: integer }
                  limit: { type: [integer, "null"], description: Receipts included in the package; null without a limit. }
                  nextFrom: { type: [integer, "null"], description: Receipt count from which the next package applies (limit + 1); null if there is none. }
                  days: { type: integer, description: Days the register was active in the month. }
            costCents: { type: integer, description: "Net, in cents, discounts on the register included." }
            preliminary: { type: boolean, description: true while the month is running. }
            test: { type: boolean }
    PartnerCustomer:
      type: object
      properties:
        customerId: { type: string }
        companyName: { type: string }
        status: { $ref: '#/components/schemas/CustomerStatus' }
        statusAt: { type: [integer, "null"], description: When the status was reached. }
        env: { type: string, enum: [live, test] }
        liveEnabled: { type: boolean, description: Whether live operation is enabled. }
        appId: { type: [string, "null"] }
        createdAt: { type: [integer, "null"] }
        createdVia: { type: [string, "null"], enum: [api, portal, null] }
        business:
          description: The master data in the same field names as in `createPartnerCustomer`, plus `courtCode`.
          allOf:
            - $ref: '#/components/schemas/Business'
            - type: object
              properties:
                courtCode: { type: [string, "null"], example: "LG_SALZBURG" }
        fon:
          type: object
          properties:
            configured: { type: boolean }
            verifiedAt: { type: [integer, "null"] }
            linkSentAt: { type: [integer, "null"] }
            linkSentTo: { type: [string, "null"], description: Masked address the setup link went to. }
            linkOpenedAt: { type: [integer, "null"] }
        access:
          type: [object, "null"]
          description: "Customer-panel login; `null` if there is none."
          properties:
            email: { type: string }
            invitedAt: { type: [integer, "null"] }
            acceptedAt: { type: [integer, "null"], description: Set at the first sign-in. }
        avv: { $ref: '#/components/schemas/ContractState' }
        terms: { $ref: '#/components/schemas/ContractState' }
    SignatureRequest:
      type: object
      description: A signature request. `ready` is the end state.
      properties:
        requestId: { type: string, description: "Also the `signatureRequestId` a cash register refers to." }
        status: { type: string, enum: [requested, assigned, registered, ready, failed, cancelled] }
        statusText: { type: string, description: The same state as a German sentence for user interfaces. }
        kind: { type: string, enum: [signature_card] }
        vdaId: { type: [string, "null"], example: "AT1", description: "Trust service provider, once card data is entered." }
        signatureId: { type: [string, "null"] }
        fulfillment:
          type: string
          enum: [automatic, manual]
          description: |
            How the request is fulfilled: `automatic` = a blank card from Kasseneck's stock is activated, checked and registered
            without anyone's hands (it may pass `assigned` without your action); `manual` = a person does it. A request can switch
            from `automatic` to `manual`; the events stay the same.
        error:
          type: [object, "null"]
          properties:
            code: { type: [string, "null"] }
            message: { type: [string, "null"] }
            rc: { type: [string, "null"], description: "FinanzOnline return code, if one was sent." }
        requestedVia: { type: [string, "null"], example: api }
        createdAt: { type: [integer, "null"] }
        updatedAt: { type: [integer, "null"] }
        history:
          type: array
          items: { type: object, properties: { from: { type: [string, "null"] }, to: { type: string }, at: { type: integer }, reason: { type: [string, "null"], description: "e.g. `api`, `card_entered` (the card data was entered), `finanzonline` (registered with FinanzOnline), `card_pool_activated` (a card from the stock was activated), `activation_run` (the activation run checked and registered it), `finanzonline_completed` (registered after the FinanzOnline access was verified)." } } }
    Signature:
      type: object
      description: |
        One signature of a business: its own object with its own ID, created when it is
        requested, long before a card exists. A cash register refers to exactly this. States:
        `requested` → `assigned` → `registered` → `ready`, plus `failed`, `cancelled` and
        `decommissioned` (the card was deregistered at FinanzOnline; the request still reads
        `ready`, the signature no longer is; here the card wins).
      properties:
        signatureRequestId: { type: string }
        status: { type: string, enum: [requested, assigned, registered, ready, failed, cancelled, decommissioned] }
        statusText: { type: string }
        inProgress: { type: boolean, description: "Not ready yet, but on its way; a cash register may refer to it and waits." }
        ready: { type: boolean }
        kind: { type: string, enum: [signature_card] }
        vdaId: { type: [string, "null"], example: "AT1" }
        requestId: { type: [string, "null"] }
        signatureId: { type: [string, "null"] }
        fulfillment: { type: string, enum: [automatic, manual], description: "See SignatureRequest.fulfillment." }
        error:
          type: [object, "null"]
          properties:
            code: { type: [string, "null"] }
            message: { type: [string, "null"] }
            rc: { type: [string, "null"] }
        createdAt: { type: [integer, "null"] }
        updatedAt: { type: [integer, "null"] }
    Cashregister:
      type: object
      description: |
        A cash register with the state of its activation. Never contains the
        `cashregister-token`; that comes only from `getCustomerCredentials`.
      properties:
        cashregisterId: { type: string, example: "KECK-1" }
        name: { type: [string, "null"], description: "Currently always `null`: names are assigned automatically, the ID is the name." }
        status: { type: string, enum: [draft, in_progress, live, failed, ended, decommissioned], description: "`in_progress`: activation running. `ended`: closing receipt written, deregistration at FinanzOnline still open. `decommissioned`: deregistered at FinanzOnline. Both are end states; `activateCashregister` changes nothing (`unchanged: true`)." }
        statusText: { type: string }
        automatic: { type: boolean, description: Goes live by itself once its signature is ready. }
        step: { type: [string, "null"], enum: [signature, register_cashregister, start_receipt, transmit_start_receipt, null], description: The next open step. }
        stepText: { type: [string, "null"] }
        completedSteps: { type: array, items: { type: string } }
        steps:
          type: array
          description: "The steps that apply to THIS cash register; in the test environment only `signature` and `start_receipt`."
          items: { type: object, properties: { key: { type: string }, text: { type: string } } }
        signatureId: { type: [string, "null"], description: The signature creation unit that actually signs; set once the cash register goes live. }
        signatureRequestId: { type: [string, "null"], description: The signature the cash register refers to; set at creation. }
        attempts: { type: integer }
        lastError:
          type: [object, "null"]
          properties:
            code: { type: [string, "null"] }
            message: { type: [string, "null"] }
            rc: { type: [string, "null"] }
            step: { type: [string, "null"] }
            at: { type: [integer, "null"] }
        createdAt: { type: [integer, "null"] }
    Activation:
      type: object
      description: |
        Whether the activation started right away. `{ started: false, reason }` when the cash
        register waits; `{ started: true, ok, step }` when it ran.
      properties:
        started: { type: boolean }
        ok: { type: boolean }
        step: { type: [string, "null"] }
        reason: { type: string, enum: [signature_not_ready, automation_off] }
    WebhookEventType:
      type: string
      enum: [customer.created, customer.updated, customer.status_changed, customer.fon_verified, customer.live_enabled, customer.avv_accepted, customer.terms_accepted, signature.requested, signature.ready, signature.failed, cashregister.created, cashregister.live, cashregister.failed, app.version.accepted, app.version.rejected, webhook.test]
    Webhook:
      type: object
      properties:
        webhookId: { type: string }
        apiVersion: { type: string, enum: [v1, v3], description: "The API version this webhook's payloads speak. Set from the version it was created through; missing on old webhooks means `v1`. Change it with `updatePartnerWebhook` and `patch: { apiVersion: \"v3\" }` (there is no way back from `v3` to `v1`)." }
        url: { type: string, format: uri }
        events: { type: array, items: { $ref: '#/components/schemas/WebhookEventType' } }
        active: { type: boolean }
        description: { type: [string, "null"] }
        createdAt: { type: [integer, "null"] }
        lastDelivery:
          type: [object, "null"]
          properties:
            at: { type: integer }
            status: { type: string, enum: [delivered, pending, failed, dropped], description: "Branch on `statusCode` for HTTP detail." }
            statusCode: { type: [integer, "null"] }
        consecutiveFailures: { type: integer }
    WebhookDelivery:
      type: object
      properties:
        deliveryId: { type: string }
        webhookId: { type: string }
        event: { $ref: '#/components/schemas/WebhookEventType' }
        eventId: { type: string }
        status: { type: string, enum: [pending, delivered, failed, dropped], description: "`dropped`: the webhook was deactivated or deleted before the delivery was due." }
        attempts: { type: integer }
        lastAttemptAt: { type: [integer, "null"] }
        nextAttemptAt: { type: [integer, "null"] }
        statusCode: { type: [integer, "null"] }
        response: { type: [string, "null"], description: The first 500 characters of your answer. }
        createdAt: { type: [integer, "null"] }
    WebhookEvent:
      type: object
      description: |
        Envelope of every delivery (POST, JSON). Headers `X-Kasseneck-Event`,
        `X-Kasseneck-Delivery`, `X-Kasseneck-Signature`, `User-Agent: Kasseneck-Webhooks/1`.
      required: [id, type, createdAt, partnerId, data]
      properties:
        id: { type: string, example: "evt_…", description: "ID of the event, the same on every retry: the basis for detecting duplicates." }
        type: { $ref: '#/components/schemas/WebhookEventType' }
        createdAt: { type: integer, description: "Unix ms, when the event occurred (not the delivery attempt)." }
        partnerId: { type: string }
        test: { type: boolean, const: true, description: "**Test deliveries only.** Real events do not carry the field." }
        data: { type: object }
    AppVersionEventData:
      type: object
      properties:
        appId: { type: string }
        appName: { type: string }
        versionId: { type: string }
        version: { type: string }
        note: { type: [string, "null"], description: German text. }
    CreateReceiptParams:
      type: object
      required: [receiptType]
      properties:
        receiptType:
          type: string
          enum: [start, standard, zero, training]
          description: |
            `start` = start receipt (once, first, without line items). `standard` = sales
            receipt. `training` = training receipt (no revenue). `zero` = zero receipt
            (Nullbeleg). Cancellations go through `cancelReceipt`; `cancellation` here is
            answered with `payments_not_allowed` under `/v3`.
        items:
          type: array
          description: Line items (required for `standard` and `training`).
          items:
            $ref: '#/components/schemas/ReceiptItem'
        payments:
          type: array
          maxItems: 20
          description: |
            **Required under `/v3`** for `standard` and `training`: the payments that settle
            the receipt. Their sum must equal the amount due (`payments_sum_mismatch`,
            `data.expectedCents`). Not allowed on `start` and `zero` receipts.
          items:
            $ref: '#/components/schemas/Payment'
        tip:
          $ref: '#/components/schemas/Tip'
        vouchers:
          type: array
          description: Optional voucher operations (sale or redemption).
          items:
            $ref: '#/components/schemas/Voucher'
        zeroKind:
          type: string
          enum: [monthly, annual, annual_replacement, outage_end, final, manual]
          description: "Occasion of a zero receipt; only with `receiptType: zero` (default `manual`)."
        customerDetails:
          type: string
          description: Optional customer details printed on the receipt.
        legalMessage:
          type: string
          description: Optional legal note.
        customProjectId:
          type: string
          description: Optional own project or reference ID.
        manualReceipt:
          $ref: '#/components/schemas/ManualReceipt'
        confirmHighAmount:
          type: boolean
          description: "`true` books a receipt above the plausibility limit after the cashier confirmed it (`receipt_limit_exceeded`)."
        idempotencyKey:
          type: string
          minLength: 1
          maxLength: 120
          description: |
            Optional: your own ID of this receipt, 1–120 characters, not only blanks; longer or
            of another type is `validation` (never shortened). A repeat with the same key and the
            same parameters returns the stored receipt with `replayed: true`; other parameters
            are `idempotency_conflict`. Per cash register. See the description of `createReceipt`.
        drawerId:
          $ref: '#/components/schemas/DrawerId'
        autoDeposits:
          type: boolean
          description: |
            Deposit (Pfand): `true` lets the server derive the deposit lines from the deposit rule of
            the articles (`items[].articleId`); it computes amount, VAT rate and quantity itself and
            inserts the lines right behind the line that triggers them. Without it, or with `false`, the
            server derives nothing; only explicit `deposit` lines are checked.
            With deposit switched off the server ignores it silently (cash registers always send it);
            only `deposit` and `deposit_return` lines give `deposit_not_enabled` then.
        onPremises:
          type: boolean
          description: "Deposit: `true` when the goods are consumed on the premises; only the single-use deposit the server derives is left out; lines you send yourself are never dropped, leave them out. Without it the default of the cash register applies. Only a boolean."
    DrawerId:
      type: string
      description: |
        Optional: the cash drawer (Lade) of the cash register the money of the receipt counts
        into, for businesses that work with several drawers and shifts in the Kasseneck cash
        register. Without it, or with an unknown, inactive or foreign drawer, the receipt counts
        into the main drawer of the cash register: the receipt never fails because of it.
      pattern: '^[A-Za-z0-9_-]{1,128}$'
    ReceiptItem:
      type: object
      description: >
        Recommended form `{ name, quantity, unitPriceCents, vatRate }`. The older fields
        (`amount`, `priceOne`, `vat`) are still accepted but deprecated.
      required: [name, quantity, unitPriceCents, vatRate]
      properties:
        name: { type: string, description: Description of the line item. }
        quantity: { type: number }
        unitPriceCents:
          type: integer
          description: Unit price (gross) in whole cents; no floating point (avoids rounding errors).
        vatRate:
          type: number
          enum: [20, 10, 13, 0, 19, 4.9]
          description: VAT rate in percent (Austrian rates including special and staple food rates).
        articleId:
          type: string
          description: |
            Optional: the inventory article sold on this line. With the inventory module (Lager)
            active, the sale is booked out of the stock location of the cash register a few
            seconds after the receipt (`listStockMovements`, source `receipt`); the receipt never
            fails because of the stock.
        receivedImmediately:
          type: boolean
          readOnly: true
          description: "Response only, on the tip lines (`kind: tip`) the server builds from `tip`; see `Tip.receivedImmediately`. Tip lines in a request are `tip_invalid`."
        keptByEmployee:
          type: boolean
          readOnly: true
          description: "Response only, on tip lines: see `Tip.keptByEmployee`."
        addOnOf:
          type: integer
          minimum: 0
          description: |
            Add-on line: index of its main line in the same `items` list (an earlier line that is
            not an add-on itself; not on tip, discount or voucher lines). The receipt prints the
            add-on indented under its main line. Only when set; otherwise `invalid_add_on_reference`.
        kind:
          type: string
          enum: [deposit, deposit_return, invoice_payment]
          description: |
            Deposit line (`deposit`) or returned empties (`deposit_return`, negative amount, needs
            the return switched on at the cash register). The server sets name, price and VAT rate
            of these lines itself (optional for plain REST calls; the npm package requires them in its item shape). A `deposit` line with an `articleId` is
            `invalid_deposit`; any other kind with a deposit prefix is `invalid_item_kind`.
            `invoice_payment` comes only in responses: a payment on an invoice of the customer area,
            on a receipt the server writes itself (see `Receipt.invoicePayments`). A request with
            this kind or with `invoicePayments` is `invoice_payment_server_only`.
        depositTypeId:
          type: string
          description: "Deposit and empties lines: the deposit type of the business."
        depositFor:
          type: integer
          minimum: 0
          description: "Deposit lines: index of the line the deposit belongs to. With `autoDeposits` the server sets it."
        depositKind:
          type: string
          enum: [single_use, reusable]
          readOnly: true
          description: "Response only: kind of the deposit type when the receipt was made."
        perUnit:
          type: integer
          readOnly: true
          description: "Response only, on deposit lines: deposit pieces per unit of the main line."
        gtin:
          type: string
          description: "Deposit lines: barcode (GTIN) of the container."
        ean:
          type: string
          readOnly: true
          description: "Response only: barcode of the article or of the single-use deposit register."
        ownFilling:
          type: boolean
          description: "Deposit lines: the container was filled by the business itself (only for accounts with the filler role)."
        codes:
          type: object
          additionalProperties: { type: integer }
          description: "Empties lines: learned codes (GTIN) with their piece count; the sum equals `quantity`."
        amount:
          type: number
          deprecated: true
          description: "Deprecated: quantity; use `quantity` instead."
        priceOne:
          type: number
          deprecated: true
          description: "Deprecated: unit price in euros (floating point); use `unitPriceCents` instead."
        vat:
          type: number
          deprecated: true
          description: "Deprecated: VAT rate; use `vatRate` instead."
    PaymentMethod:
      type: string
      enum: [cash, creditCard, online, uberApp, uberCard, uberCash, boltApp, boltCard, boltCash]
    Payment:
      type: object
      description: |
        One payment of a receipt. On a sale `amountCents` is positive, on a cancellation
        (refund) negative. Card methods (`creditCard`, `uberCard`, `boltCard`) need
        `provider` and, except for provider `custom`, `providerPaymentId`; `online` may carry
        them. Other methods may not (`payment_provider_not_allowed`).

        **In responses** (`receipt.payments[]`) each payment has a server-assigned `id`
        (`p1`, `p2`, …) and, for cash with `tenderedCents`, `changeCents`. `providerPaymentId`
        and `providerData` are returned to the business itself (its API key or a register
        sign-in), in `createReceipt`, `getReceipt`, `cancelReceipt`, `getReportV2` and
        `listReceipts`; a partner access never gets them. `providerData` is the provider's raw
        data without a promised shape: base your logic on `provider`, `providerPaymentId` and
        `id`. `provider` is always returned.
      required: [method, amountCents]
      properties:
        id: { type: string, readOnly: true, description: "Response only: `p1`, `p2`, …" }
        method: { $ref: '#/components/schemas/PaymentMethod' }
        amountCents: { type: integer, description: "Whole cents, not 0." }
        tenderedCents: { type: integer, description: "Cash methods only (`cash`, `uberCash`, `boltCash`), not on a refund or a voucher payout, at least `amountCents`: the amount handed over. Each cash payment may carry its own (split bills); the answer adds `changeCents` to that payment." }
        changeCents: { type: integer, readOnly: true }
        provider:
          type: string
          enum: [custom, gpTomAndroid, gpTomIos, hobexCloudApi, hobexHps, sumup, myposPro, stripe]
        providerPaymentId: { type: string, description: "Transaction ID at the provider. In responses only for the business itself, never for a partner access." }
        providerData: { type: object, description: "Raw data of the terminal, no promised shape. In responses only for the business itself, never for a partner access." }
        refundOf: { type: string, description: "Refunds only (`cancelReceipt`): the `id` of the original payment." }
        tipCents: { type: integer, description: "Tip carried by this payment (whole cents, > 0, at most `amountCents`). Not together with `tip` (`tip_conflict`)." }
    Tip:
      description: |
        Tip on a `standard` or `training` receipt: a number (cents) or an object. With several
        payment methods on the receipt, `paymentMethod` is required
        (`tip_payment_method_required`). Alternatively carry tips per payment with
        `payments[].tipCents`, never both.
      oneOf:
        - type: integer
          minimum: 1
        - type: object
          required: [cents]
          properties:
            cents: { type: integer, minimum: 1 }
            paymentMethod: { $ref: '#/components/schemas/PaymentMethod' }
            receivedImmediately:
              type: boolean
              description: "`true` if the staff member received the tip right away (e.g. in cash); default from the settings of the business."
            keptByEmployee:
              type: boolean
              description: "`true` if the staff member put the cash tip in their pocket right away: it does not count into the cash drawer. Only for a staff tip with a recipient, paid in cash and `receivedImmediately: true`; otherwise it is ignored."
            recipients:
              type: array
              maxItems: 20
              description: Split among users (`listMyTipRecipients`); the `cents` must add up to the tip.
              items:
                type: object
                required: [registerUserId, cents]
                properties:
                  registerUserId: { type: string }
                  cents: { type: integer, minimum: 1 }
    Voucher:
      type: object
      required: [action]
      description: |
        A voucher operation on a receipt (`vouchers[]`). There are two forms.

        **Vouchers with a code** (`type` `multi_purpose`, `single_purpose`, `service`,
        `promotion`): the server issues the voucher with its own code when it is sold, keeps
        its balance and checks every redemption against it.

        | Operation | Fields |
        |---|---|
        | Sell a value voucher (`multi_purpose`, `single_purpose`) | `action: sell`, `typeId` (a voucher type of the business, set up in the customer area), `amountCents`; `type` may be left out, it comes from the voucher type (another one is `voucher_amount_mismatch`) |
        | Sell a service voucher | `action: sell`, `type: service`, `articleId` (an article released for service vouchers), `quantity` 1–100; no `typeId` |
        | Redeem | `action: redeem`, `type`, `code`; `amountCents` for `multi_purpose` and `single_purpose`, `positions` for `service` (the indices of the lines in `items` the voucher pays), nothing more for `promotion` |
        | Pay out the balance | `action: payout`, `type` `multi_purpose` or `single_purpose`, `code`, `amountCents`, `reason` (1–200 characters). A receipt of payouts only is paid in cash: `payments` holds exactly one `cash` payment with the negative amount |

        Amounts are whole cents from 1 to 1,000,000. A `promotion` voucher is never sold at the
        cash register. The plain code of a sold voucher is returned once, in `issuedVouchers` of
        the `createReceipt` answer; the receipt only keeps it masked (`code`, `codeSuffix`).
        Vouchers with a code are not allowed on training receipts, and a receipt that carries
        them can only be cancelled in full. In responses the entry carries the fields the server
        adds (marked *response only*); do not send them (in the older form they are
        `voucher_invalid`).

        **External vouchers** (`source: external`): a voucher of your own system (merchandise
        management, web shop) sold, redeemed or paid out at the cash register. Fields `source`,
        `action` (`sell`, `redeem`, `payout`), `type` (`multi_purpose` or `single_purpose`),
        `number` (1–40 characters of `A-Z a-z 0-9 - _ . /`, spaces at the edges are removed, a valid
        Kasseneck voucher code is `external_voucher_number_is_own_code`) and `amountCents`;
        `single_purpose` with `vatRateBp` (the rate it was sold with, a rate of the cash register,
        `0` = sold exempt), optionally `taxedWith` on `redeem` and `payout`; `payout` with `reason`.
        Kasseneck keeps no balance and checks nothing against your system: the business states kind,
        rate and amount, and a wrong statement leads to wrong VAT. A multi-purpose voucher is sold in
        the 0 % bucket and pays like a payment when redeemed; a single-purpose voucher is taxed when
        sold and redeemed as a minus line in its rate. External vouchers are enabled per account
        (`externalVouchers` in `getMyVoucherSettings`: `off` (default), `multi_purpose`, `all`; the
        test environment always allows both): otherwise `external_voucher_not_enabled` or
        `external_voucher_type_not_enabled`. The same `number` twice in one receipt is
        `external_voucher_duplicate`. A receipt with an external voucher is cancelled in full only;
        before cancelling a sale, check and block the voucher in your system. Your system books
        the balance from the receipt webhooks (`receipt.created`, `receipt.cancelled`).
        `number`, `taxedWith` and `vatRateBp` on an own voucher are `voucher_invalid`.

        **Older form** (`type` `value` or `promo`, without a code of the server, **deprecated** for
        value vouchers with your own `code`: the answer carries `deprecation`; use
        `source: external`): `action` `sell`
        or `redeem`, `valueCents` (or `value` in euros), optional `name` and your own `code`
        (default "no-code"). A `promo` voucher is only redeemed. A real voucher code in `code`
        is `voucher_invalid`: redeem it in the form above. In stored receipts a multi-purpose
        voucher with a code is kept with `type: value` and a promotion voucher with
        `type: promo`; `voucherType` names the kind.
      properties:
        source: { type: string, enum: [external], description: "External voucher of your own system. Left out for vouchers of Kasseneck. In responses kept on the entry." }
        number: { type: string, minLength: 1, maxLength: 40, pattern: '^[A-Za-z0-9_./-]{1,40}$', description: "External voucher: its number in your system, printed in full on the receipt (not a secret)." }
        action: { type: string, enum: [sell, redeem, payout] }
        type:
          type: string
          enum: [multi_purpose, single_purpose, service, promotion, value, promo]
          description: "Kind of voucher. `value` and `promo` are the older form."
        code: { type: string, description: "Redeem and payout: the voucher code as printed (also without dashes). Older form: your own text. In responses masked, e.g. `····-····-XW3Y`." }
        typeId: { type: string, description: "Selling a value voucher: the voucher type of the business. In responses also on the stored sale." }
        amountCents: { type: integer, minimum: 1, maximum: 1000000, description: "Vouchers with a code: amount of the sale, redemption or payout in cents. In responses also the value of a service voucher." }
        articleId: { type: string, description: "Selling a service voucher: the article it is for." }
        quantity: { type: integer, minimum: 1, maximum: 100, description: "Selling a service voucher: how many. In responses on a redemption: how many were redeemed." }
        positions: { type: array, items: { type: integer, minimum: 0 }, description: "Redeeming a service voucher: indices of the lines in `items` it pays, each once." }
        reason: { type: string, minLength: 1, maxLength: 200, description: "Payout: why the balance is paid out." }
        valueCents: { type: integer, description: "Older form: value in cents (takes precedence over `value`)." }
        value: { type: number, description: "Older form: value in euros (> 0). In responses next to `valueCents`." }
        name: { type: string, description: "Older form: name on the receipt. In responses the name the server printed." }
        voucherId: { type: string, readOnly: true, description: "Response only: ID of the voucher with a code." }
        voucherType: { type: string, readOnly: true, enum: [multi_purpose, single_purpose, service, promotion], description: "Response only: kind of the voucher with a code." }
        codeSuffix: { type: string, readOnly: true, description: "Response only: the last four characters of the code." }
        typeName: { type: string, readOnly: true, description: "Response only: name of the voucher type at the sale." }
        payout: { type: string, readOnly: true, enum: [allowed, never], description: "Response only: whether the voucher type allowed paying out the balance at the sale." }
        vatRateBp: { type: integer, description: "External single-purpose voucher: the rate it was sold with, in basis points (2000 = 20 %, `0` = sold exempt); required there. Otherwise response only: VAT rate of a single-purpose or service voucher." }
        article: { type: object, readOnly: true, description: "Response only, service voucher sold: the article as frozen at the sale.", properties: { id: { type: string }, name: { type: string }, vatRateBp: { type: integer }, priceCents: { type: integer } } }
        balanceAfterCents: { type: integer, readOnly: true, description: "Response only, redemption and payout of a value voucher: balance left afterwards." }
        remainingQuantityAfter: { type: integer, readOnly: true, description: "Response only, redemption of a service voucher: quantity left afterwards." }
        taxedWith: { type: [string, "null"], maxLength: 40, description: "External single-purpose voucher, `redeem` and `payout`: optional note of what it was taxed with, e.g. the receipt number in your system (1–40 characters). Otherwise response only, redemption of a single-purpose or service voucher: the receipt of the sale, with which the VAT was paid." }
        exempt: { type: boolean, readOnly: true, description: "Response only, redemption: the voucher was sold VAT-exempt (small business)." }
        zeroRateBucket: { type: boolean, readOnly: true, description: "Response only: booked in the 0 % bucket of the receipt (sale and payout of a multi-purpose voucher); not revenue." }
        fromReturn: { type: boolean, readOnly: true, description: "Response only, on a cancellation receipt: this `redeem` entry is the new voucher the amount went back on (`cancelReceipt` with `refundAs: voucher`), not a redemption." }
    IssuedVoucher:
      type: object
      description: "A voucher sold with this receipt, in `issuedVouchers` of the `createReceipt` answer. The plain `code` is returned only here and only once; print it on the voucher and do not log it."
      properties:
        id: { type: string, description: "ID of the voucher (`voucherId` on the receipt)." }
        code: { type: string, description: "The voucher code in plain text, e.g. `KRNB-7Q4M-XW3Y`." }
        type: { type: string, enum: [multi_purpose, single_purpose, service] }
        index: { type: integer, description: "Index of the entry in `vouchers` of the request." }
        codeSuffix: { type: string, description: "The last four characters of the code." }
        faceValueCents: { type: integer, description: "Value of the voucher in cents (service voucher: price of the article times quantity)." }
        quantity: { type: integer, description: "Service voucher only." }
        articleName: { type: string, description: "Service voucher only: name of the article." }
        typeId: { type: string, description: "Sale through a voucher type only." }
        typeName: { type: string, description: "Sale through a voucher type only." }
        fromReturn: { type: boolean, description: "Only in `cancelReceipt`: the voucher of a refund as a voucher." }
        validity:
          type: object
          properties:
            pattern: { type: string, enum: [unlimited, "1+3", custom], description: "`1+3`: redeemable for some years after the sale (`redeemableYears`, default 1), refundable three years longer." }
            redeemableYears: { type: integer, description: "Only with `1+3`: the years it can be redeemed." }
            redeemableUntil: { type: [string, "null"], format: date }
            refundableUntil: { type: [string, "null"], format: date }
            validUntil: { type: [string, "null"], format: date, description: "Only with `custom`." }
    ReceiptOutput:
      type: object
      description: "One entry of the log of a receipt's outputs: what was printed, sent or opened."
      properties:
        at: { type: string, description: "ISO 8601 with offset (Europe/Vienna)." }
        kind: { type: string, enum: [print, reprint, email, link_shared, pdf_shared, opened] }
        result: { type: string, enum: [ok, failed, unclear] }
        by: { type: [object, "null"], description: "Who did it, or null (for example the customer opening the link).", properties: { id: { type: string }, name: { type: string } } }
        count: { type: integer, description: "Only with `opened`: how often the receipt link was opened in that hour." }
    ReturnDisposition:
      type: string
      enum: [restock, defective, disposed]
      description: "What happens to the goods of a cancelled line with a stock-tracked article: `restock` back into sellable stock, `defective` into defective stock, `disposed` not back into stock."
    CancellationReason:
      type: string
      enum: [input_error, customer_cancelled, wrong_payment_method, duplicate, other]
      description: Reason of a cancellation (`cancelReceipt` parameter `reason`, receipt field `cancellationReason`).
    ReceiptErrorCode:
      type: string
      description: |
        Machine-readable reason in `code` and `data.code` of the receipt endpoints
        `createReceipt`, `cancelReceipt`, `getReceipt` and `sendReceiptEmail` (HTTP 200,
        `status: "error"`). The code is the truth: it stays stable, the German `message` may
        change. Column *Sent by* names the endpoints that send a code. Codes of authentication
        and of the `/v3` edge, which every call can return, are in `CommonErrorCode`;
        `listReceipts`, `getReportV2` and the DEP endpoints list their own codes, the payment
        terminal endpoints, `downloadReport`, `downloadDailyReport` and `financeWebService` send
        no code of their own. The codes for `manualReceipt` are also listed on their own in
        `ManualReceiptErrorCode`. [`fehlercodes.json`](fehlercodes.json) holds the same codes by
        source (lists `storno`, `storno_trinkgeld`, `zahlungen`, `belegmail`, `handbeleg`, `beleg`,
        `gutschein`); its map `v3` gives the `/v3` spelling of each `/v1` code.

        Three codes come only with the sign-in of a cash register user (device and PIN) of the
        Kasseneck cash register app (`kasse.kasseneck.at/api/v3`), never with an API key; the
        table says so.

        **Outcome unknown.** With `receipt_outcome_unknown` and `cancellation_outcome_unknown`
        the receipt may have been signed and stored. Do not just send the request again: read
        the receipts first (`listReceipts`, `getReceipt`). A `createReceipt` with
        `idempotencyKey` may be repeated with the same key: it returns the stored receipt or
        creates it once.

        | `code` | Sent by | When | Extra fields in `data` |
        |---|---|---|---|
        | `validation` | `createReceipt`, `cancelReceipt`, `getReceipt`, `sendReceiptEmail` | a parameter is missing, of the wrong type or invalid (for example `items` empty, `idempotencyKey` longer than 120 characters), or a `/v3` request uses a `/v1` name or value (`reason: "fehleingabe"`, `tip.sofortErhalten`, `sprache`); the last check runs before the endpoint | `errors[{ field, message }]` where the field is known |
        | `receipt_not_found` | `getReceipt`, `cancelReceipt`, `sendReceiptEmail` | no such receipt at this cash register (`receiptId`, `originalReceiptId`, `fullReceiptId`) | none |
        | `receipt_type_not_cancellable` | `cancelReceipt` | the original is not a `standard` receipt (it is a cancellation, zero or start receipt) | none |
        | `training_receipt` | `cancelReceipt` | the original is a training receipt; training receipts are not cancelled | none |
        | `already_cancelled` | `cancelReceipt` | nothing of the original is left to cancel | none |
        | `invalid_line` | `cancelReceipt` | an `items[].index` is unknown or appears twice | none |
        | `quantity_exceeds_remaining` | `cancelReceipt` | an `items[].quantity` is not a whole number of at least 1, or more than is left of the line | none |
        | `unknown_reason` | `cancelReceipt` | `reason` is missing or not one of `CancellationReason` | none |
        | `note_too_long` | `cancelReceipt` | `note` is longer than 200 characters | none |
        | `invalid_items` | `cancelReceipt` | `items` is not a list | none |
        | `cashregister_not_assigned` | `cancelReceipt` | only with the sign-in of a cash register user of the Kasseneck app, never with an API key: the cash register is not assigned to the user | none |
        | `not_permitted` | `createReceipt`, `cancelReceipt` | only with the sign-in of a cash register user of the Kasseneck app, never with an API key: the user lacks the right (selling, cancelling, the voucher operation, assigning or overriding a tip) | none |
        | `own_receipts_only` | `cancelReceipt` | only with the sign-in of a cash register user of the Kasseneck app, never with an API key: the user may only cancel receipts they took | none |
        | `cashregister_incomplete` | `cancelReceipt` | the account or the cash register lacks its API key or token; contact Kasseneck | none |
        | `cancellation_failed` | `cancelReceipt` | the cancellation receipt was refused; the German `message` names the reason (for example the signature creation unit). No cancellation receipt was created | none |
        | `cancellation_payments_required` | `cancelReceipt` | a partial cancellation of a receipt with several payments without `payments` | none |
        | `cancellation_refund_exceeds_payment` | `cancelReceipt` | the refunds on one payment exceed what is left of it | none |
        | `cancellation_refund_reference_required` | `cancelReceipt` | a card refund without `refundOf` naming a card payment of the original | none |
        | `cancellation_refund_reference_unknown` | `cancelReceipt` | `refundOf` names no payment of the original | none |
        | `cancellation_outcome_unknown` | `cancelReceipt` | no clear answer from the cancellation: the cancellation receipt may exist. Do not repeat; after a few minutes read the original (`getReceipt`, `cancellations[]`) | none |
        | `invalid_return_disposition` | `cancelReceipt` | `returnDisposition` (also per line) is not one of `ReturnDisposition` | none |
        | `payments_invalid` | `createReceipt`, `cancelReceipt` | `payments` is not a list, has more than 20 entries or an entry is no object; a voucher payout takes exactly one cash payment | none |
        | `payment_method_invalid` | `createReceipt`, `cancelReceipt` | a `method` is not one of `PaymentMethod`; a voucher payout is in cash only | none |
        | `payment_amount_invalid` | `createReceipt`, `cancelReceipt` | an `amountCents` is not a whole number other than 0 with the right sign: positive on a sale, negative on a refund and on a voucher payout | none |
        | `payment_tendered_invalid` | `createReceipt`, `cancelReceipt` | `tenderedCents` on a method that is not cash (`cash`, `uberCash`, `boltCash`), on a refund or a payout, or smaller than `amountCents` | none |
        | `payment_provider_invalid` | `createReceipt`, `cancelReceipt` | a card method without a valid `provider`, an empty `providerPaymentId` (except provider `custom`), or `providerData` that is no object | none |
        | `payment_provider_not_allowed` | `createReceipt`, `cancelReceipt` | `provider`, `providerPaymentId` or `providerData` on a method other than a card method or `online` | none |
        | `payments_sum_mismatch` | `createReceipt`, `cancelReceipt` | the sum of `payments` is not the amount due; no receipt number is used up | `expectedCents` |
        | `payments_due_negative` | `createReceipt`, `cancelReceipt` | the amount due of a sale would be negative | none |
        | `payments_not_allowed` | `createReceipt`, `cancelReceipt` | `payments` on a `start` or `zero` receipt, or `receiptType: "cancellation"` (cancel with `cancelReceipt`) | none |
        | `payments_conflict` | `createReceipt`, `cancelReceipt` | only on `/v1` and `/v2` (`PAYMENTS_CONFLICT`): `payments` together with `paymentMethod` or a card field. Under `/v3` that request is `payment_method_not_supported` | none |
        | `payments_required` | `createReceipt`, `cancelReceipt` | `payments` is missing on a `standard` or `training` receipt | none |
        | `payment_method_not_supported` | `createReceipt`, `cancelReceipt` | `paymentMethod`, `creditCardProvider`, `cardPaymentId` or `cardPaymentData` under `/v3`; send `payments` | none |
        | `tip_payment_method_invalid` | `createReceipt`, `cancelReceipt` | `tip.paymentMethod` is not among the methods of `payments` | none |
        | `tip_payment_method_required` | `createReceipt`, `cancelReceipt` | a tip on a receipt with several payment methods without `tip.paymentMethod` | none |
        | `tip_exceeds_payment` | `createReceipt`, `cancelReceipt` | the tip exceeds the payments of its method | none |
        | `payment_refund_not_allowed` | `createReceipt`, `cancelReceipt` | `refundOf` on a payment that is no refund | none |
        | `payment_tip_invalid` | `createReceipt`, `cancelReceipt` | `payments[].tipCents` is not a whole number above 0, exceeds `amountCents`, is on a receipt other than `standard` or `training`, or on a voucher payout | none |
        | `tip_conflict` | `createReceipt`, `cancelReceipt` | `tip` and `payments[].tipCents` together | none |
        | `invalid_address` | `sendReceiptEmail` | `to` is not a valid email address | none |
        | `too_many_requests` | `sendReceiptEmail` | too many emails for this receipt or this cash register; try later | none |
        | `send_failed` | `sendReceiptEmail` | the email could not be sent | none |
        | `invalid_manual_receipt` | `createReceipt` | `manualReceipt` breaks one of its rules (see `ManualReceipt`) | none |
        | `manual_receipt_not_allowed` | `createReceipt`, `cancelReceipt` | `manualReceipt` on a receipt type other than `standard`, and on every `cancelReceipt` | none |
        | `manual_receipt_date_in_future` | `createReceipt` | `manualReceipt.date` (with `time`) lies in the future | none |
        | `manual_receipt_range_not_allowed` | `createReceipt` | `manualReceipt.numberTo` with `reason: outside_premises` | none |
        | `manual_receipt_duplicate` | `createReceipt` | the same number, or an overlapping range, is recorded already on the same day and cash register; do not send again | `receiptId` of the receipt that recorded it |
        | `tip_refund_conflict` | `cancelReceipt` | `tipRefundSource` with `refundTip: false`, without a staff tip in the cancellation, or `employee` for a tip the staff member never received | none |
        | `invalid_tip_refund_source` | `cancelReceipt` | `tipRefundSource` is not `drawer` or `employee` | none |
        | `tip_refund_source_requires_cash` | `cancelReceipt` | `tipRefundSource` while the tip does not go back in cash | none |
        | `tip_keep_not_possible_with_voucher` | `cancelReceipt` | `refundTip: false` on a receipt with a value voucher: the tip is cancelled with it | none |
        | `receipt_type_invalid` | `createReceipt` | `receiptType` is not one of `start`, `standard`, `zero`, `training` | none |
        | `tip_not_allowed` | `createReceipt` | `tip` on a receipt other than `standard` or `training` | none |
        | `module_inactive` | `createReceipt` | the module registrierkasse (fiscal cash register) is not active for the account; zero receipts are always allowed | none |
        | `signature_missing` | `createReceipt` | no signature creation unit is assigned to the cash register | none |
        | `signature_incomplete` | `createReceipt` | the data of the signature creation unit of the cash register is incomplete | none |
        | `cashregister_decommissioned` | `createReceipt` | the cash register was taken out of service and deregistered with FinanzOnline; no more receipts | none |
        | `cashregister_closed` | `createReceipt` | the cash register was closed and its final receipt (Schlussbeleg) exists; no more receipts | none |
        | `final_receipt_not_allowed` | `createReceipt` | `zeroKind: final` while the cash register is not being closed (closing starts in the customer area) | none |
        | `final_receipt_expired` | `createReceipt` | the closing of the cash register has expired; start it again in the customer area | none |
        | `signing_failed` | `createReceipt` | a start receipt or a final receipt could not be signed, or no signature could be made at all; nothing was written, try again | none |
        | `small_business_vat_not_allowed` | `createReceipt` | the business is a small business (Kleinunternehmer, § 6 (1) 27 UStG) and a line carries VAT | none |
        | `receipt_limit_exceeded` | `createReceipt` | the gross total of a `standard` receipt is above the plausibility limit of the business (50,000 € unless the business set another limit or switched it off); after checking the amount, send again with `confirmHighAmount: true` | none |
        | `tip_recipient_unknown` | `createReceipt` | a `tip.recipients[].registerUserId` is unknown or blocked | none |
        | `tip_invalid` | `createReceipt` | `tip` breaks one of its rules (`cents`, `receivedImmediately`, `keptByEmployee`, `recipients`), or `items` carries a tip line (send the tip as `tip` or `payments[].tipCents`) | `errors[{ field, message }]` where the field is known |
        | `invalid_add_on_reference` | `createReceipt` | an `items[].addOnOf` is not a whole number, does not point to an earlier line, points to an add-on, or sits on (or points to) a tip, discount or voucher line | `errors[{ field: "items.addOnOf", message }]` |
        | `deposit_not_enabled` | `createReceipt` | a `deposit` or `deposit_return` line is sent although the account has deposit switched off (`autoDeposits` and `onPremises` alone are ignored) | none |
        | `deposit_type_not_found` | `createReceipt` | the deposit type of a line is unknown or switched off | none |
        | `deposit_type_not_issued` | `createReceipt` | reusable empties of a deposit type that was never issued | none |
        | `deposit_set_by_server` | `createReceipt` | a `deposit` line for a main line the server deposits itself (`autoDeposits` set and the article or its group has an effective deposit rule) | none |
        | `invalid_deposit_quantity` | `createReceipt` | deposit on a line with a non-whole quantity, or a deposit quantity that is not a multiple of it | none |
        | `deposit_return_not_offered` | `createReceipt` | empties at a cash register that does not take them back | none |
        | `invalid_deposit` | `createReceipt` | a deposit or empties line breaks a rule (quantity, GTIN, `codes`, deposit with `articleId`, amount not set) | none |
        | `invalid_item_kind` | `createReceipt` | an unknown line kind with a deposit prefix | none |
        | `deposit_follows_item` | `cancelReceipt` | a deposit line is cancelled on its own; cancel its main line, the deposit goes with it | none |
        | `receipt_outcome_unknown` | `createReceipt` | an error after signing: the receipt may be stored. See *Outcome unknown* above | none |
        | `voucher_balance_changed` | `createReceipt`, `cancelReceipt` | the voucher was used elsewhere at the same moment; nothing was written. Check it and send again | none |
        | `server_error` | `createReceipt`, `cancelReceipt` | an unexpected error before anything was written (for example no free voucher code); try again | none |
        | `idempotency_conflict` | `createReceipt`, `cancelReceipt` | the `idempotencyKey` was used at this cash register with other parameters (`cancelReceipt`: for this original with other `items`, `reason` or `refundAs`); nothing was written | none |
        | `voucher_not_found` | `createReceipt` | no voucher with this `code` in this account (and environment) | none |
        | `voucher_expired` | `createReceipt` | the voucher is past its validity | none |
        | `voucher_used_up` | `createReceipt` | nothing is left of the voucher (balance or quantity) | none |
        | `voucher_blocked` | `createReceipt` | the voucher is blocked | none |
        | `voucher_cancelled` | `createReceipt` | the voucher was cancelled | none |
        | `voucher_insufficient_balance` | `createReceipt` | `amountCents` is more than the remaining balance | none |
        | `voucher_rate_mismatch` | `createReceipt` | a single-purpose voucher does not fit the VAT rate of the lines | none |
        | `voucher_item_mismatch` | `createReceipt` | a service voucher does not fit the lines in `positions` (another article, more than its quantity) | none |
        | `voucher_already_used` | `cancelReceipt` | the receipt sold a voucher whose value is not fully available any more (redeemed, paid out, blocked or corrected); its sale cannot be cancelled until the voucher is unused again. `message` names the receipts to cancel first | `receipts`: `[{ cashregisterId, receiptId }]` the receipts the voucher still pays for (empty if none) |
        | `voucher_settings_missing` | `createReceipt` | the voucher settings of the business are not confirmed yet (customer area) | none |
        | `voucher_invalid_code` | `createReceipt` | `code` is not a valid voucher code | none |
        | `voucher_invalid` | `createReceipt` | a voucher entry breaks the rules of `Voucher`: unknown `action` or `type`, a missing or out-of-range field, a field only the server sets, a voucher code in the older form, a voucher with a code on a training receipt, or a voucher line in `items` | none |
        | `voucher_exceeds_total` | `createReceipt` | the voucher covers more than the receipt total (it never covers a tip) | none |
        | `voucher_partial_cancel` | `cancelReceipt` | a receipt with vouchers with a code is only cancelled in full (no `items`, no `refundTip: false`) | none |
        | `voucher_type_required` | `createReceipt` | a sale of a multi- or single-purpose voucher without `typeId` | none |
        | `voucher_type_not_found` | `createReceipt`, `cancelReceipt` | `typeId` names no active voucher type of the business; `cancelReceipt`: the voucher type for returns changed meanwhile, read the settings again | none |
        | `voucher_amount_mismatch` | `createReceipt`, `cancelReceipt` | `amountCents` or `type` does not fit the voucher type; `cancelReceipt`: as with `voucher_type_not_found` | none |
        | `voucher_service_not_allowed` | `createReceipt` | the article in `articleId` is not released for service vouchers | none |
        | `voucher_payout_not_allowed` | `createReceipt` | the voucher type does not allow paying out the balance | none |
        | `external_voucher_not_enabled` | `createReceipt` | a voucher with `source: external`, but external vouchers are not enabled for the account | none |
        | `external_voucher_type_not_enabled` | `createReceipt` | a single-purpose external voucher while the account only allows multi-purpose ones | none |
        | `external_voucher_number_invalid` | `createReceipt` | `number` is missing, longer than 40 characters or contains other characters than `A-Z a-z 0-9 - _ . /` | none |
        | `external_voucher_number_is_own_code` | `createReceipt` | `number` is a valid Kasseneck voucher code; redeem own vouchers with `code` | none |
        | `external_voucher_duplicate` | `createReceipt` | the same `number` twice in one receipt (upper and lower case count) | none |
        | `refund_as_invalid` | `cancelReceipt` | `refundAs` is not `voucher` | none |
        | `refund_as_conflict` | `cancelReceipt` | `refundAs` together with `payments` (or the older `paymentMethod` and card fields) | none |
        | `refund_as_voucher_not_available` | `cancelReceipt` | refund as a voucher is not possible here: no signed-in cash register user, or vouchers with a code not switched on at the cash register (a user without the right to sell vouchers gets `not_permitted`) | none |
        | `refund_as_voucher_reason` | `cancelReceipt` | `reason` is not `customer_cancelled` or `other` | none |
        | `refund_as_voucher_with_voucher` | `cancelReceipt` | the original carries a voucher with a code | none |
        | `refund_as_voucher_no_type` | `cancelReceipt` | no voucher type for returns is set (customer area, vouchers) | none |
        | `refund_as_voucher_amount` | `cancelReceipt` | the amount of the voucher is outside 1.00 € to 10,000 € | none |
        | `idempotency_key_required` | `cancelReceipt` | `refundAs` without `idempotencyKey` | none |
        | `invoice_payment_server_only` | `createReceipt` | a line of kind `invoice_payment` or `invoicePayments` was sent; payments on invoices are recorded at the invoice in the customer area, the server writes their receipt | none |
        | `invoice_payment_not_cancellable` | `cancelReceipt` | the original is a payment receipt (`invoicePayments`); it is cancelled only at its invoice in the customer area | none |
      enum: [validation, receipt_not_found, receipt_type_not_cancellable, training_receipt, already_cancelled, invalid_line, quantity_exceeds_remaining, unknown_reason, note_too_long, invalid_items, cashregister_not_assigned, not_permitted, own_receipts_only, cashregister_incomplete, cancellation_failed, cancellation_payments_required, cancellation_refund_exceeds_payment, cancellation_refund_reference_required, cancellation_refund_reference_unknown, cancellation_outcome_unknown, invalid_return_disposition, payments_invalid, payment_method_invalid, payment_amount_invalid, payment_tendered_invalid, payment_provider_invalid, payment_provider_not_allowed, payments_sum_mismatch, payments_due_negative, payments_not_allowed, payments_conflict, payments_required, payment_method_not_supported, tip_payment_method_invalid, tip_payment_method_required, tip_exceeds_payment, payment_refund_not_allowed, payment_tip_invalid, tip_conflict, invalid_address, too_many_requests, send_failed, invalid_manual_receipt, manual_receipt_not_allowed, manual_receipt_date_in_future, manual_receipt_range_not_allowed, manual_receipt_duplicate, tip_refund_conflict, invalid_tip_refund_source, tip_refund_source_requires_cash, tip_keep_not_possible_with_voucher, receipt_type_invalid, tip_not_allowed, module_inactive, signature_missing, signature_incomplete, cashregister_decommissioned, cashregister_closed, final_receipt_not_allowed, final_receipt_expired, signing_failed, small_business_vat_not_allowed, receipt_limit_exceeded, tip_recipient_unknown, tip_invalid, invalid_add_on_reference, deposit_not_enabled, deposit_type_not_found, deposit_type_not_issued, deposit_set_by_server, invalid_deposit_quantity, deposit_return_not_offered, invalid_deposit, invalid_item_kind, deposit_follows_item, receipt_outcome_unknown, voucher_balance_changed, server_error, idempotency_conflict, voucher_not_found, voucher_expired, voucher_used_up, voucher_blocked, voucher_cancelled, voucher_insufficient_balance, voucher_rate_mismatch, voucher_item_mismatch, voucher_already_used, voucher_settings_missing, voucher_invalid_code, voucher_invalid, voucher_exceeds_total, voucher_partial_cancel, voucher_type_required, voucher_type_not_found, voucher_amount_mismatch, voucher_service_not_allowed, voucher_payout_not_allowed, external_voucher_not_enabled, external_voucher_type_not_enabled, external_voucher_number_invalid, external_voucher_number_is_own_code, external_voucher_duplicate, refund_as_invalid, refund_as_conflict, refund_as_voucher_not_available, refund_as_voucher_reason, refund_as_voucher_with_voucher, refund_as_voucher_no_type, refund_as_voucher_amount, idempotency_key_required, invoice_payment_server_only, invoice_payment_not_cancellable]
    CommonErrorCode:
      type: string
      description: |
        Codes every `/v3` call with the API key of a business can return, whatever the endpoint:
        from authentication, which runs before the endpoint, and from the `/v3` edge, which
        translates request and answer. They come like every other code in `code` and `data.code`
        (HTTP 200, `status: "error"`; `not_found` with HTTP 404). An endpoint's own codes are listed
        with the endpoint (receipts: `ReceiptErrorCode`).

        | `code` | When | Extra fields in `data` |
        |---|---|---|
        | `method_not_allowed` | the request is not `POST` (only `downloadReceipt` is `GET`) | none |
        | `validation` | a required parameter is missing or of the wrong type, the body or `params` is not a JSON object, or a `/v3` request uses a `/v1` name or value | `errors[{ field, message }]` |
        | `cashregister_token_missing` | an endpoint that needs the `cashregister-token` header is called without it | none |
        | `cashregister_token_invalid` | the `cashregister-token` does not belong to the cash register | none |
        | `cashregister_not_found` | the cash register of the `cashregister-token` does not exist in the account of the API key | none |
        | `live_not_enabled` | a `kr_live_…` key of an account that Kasseneck has not released for live use yet; the test environment always works (`createReceipt` with a zero receipt is allowed) | none |
        | `api_not_approved` | a `kr_live_…` key of own software before Kasseneck released the API for the account (customer area, „Entwicklung“); `kr_test_…` keys always work (`createReceipt` with a zero receipt is allowed) | none |
        | `unauthorized` | the `Authorization` header is missing, is not `Bearer <key>`, or the key is unknown | none |
        | `not_found` | HTTP 404: the endpoint name is not known under `/v3` (for example the German name of a renamed endpoint) | none |
        | `internal_translation_error` | the edge could not translate the request; nothing was executed, try again | none |
        | `dialect_mismatch` | a request with the header `Kasseneck-Api-Version: v3` reached `createReceipt`, `cancelReceipt` or `financeWebService` on a `/v1` or `/v2` path; nothing was executed, call `/v3` | none |
        | `response_translation_failed` | the endpoint ran, but its answer could not be translated. `handled: true`: it was executed, read the result instead of repeating (`receiptId` or `id` come along when known). `handled: false`: it was refused, the German `message` says why. `handled: null` (`createReceipt`, `cancelReceipt`, `financeWebService`): the outcome is unknown, read the receipts before repeating | `handled`, `receiptId`, `id` |

        Other sign-ins have codes of their own that never reach an API key: the sign-in of a cash
        register user (device and PIN) of the Kasseneck cash register app
        (`kasse.kasseneck.at/api/v3`) gets `register_user_not_allowed`,
        `register_user_no_business`, `register_user_not_found`, `user_disabled`,
        `session_expired`, `session_other_cashregister` and `cashregister_not_assigned`; partner
        keys are described in the tag *Partner*.
      enum: [method_not_allowed, validation, cashregister_token_missing, cashregister_token_invalid, cashregister_not_found, live_not_enabled, api_not_approved, unauthorized, not_found, internal_translation_error, dialect_mismatch, response_translation_failed]
    DepExportEnvelope:
      type: object
      properties:
        status: { type: string, enum: [success, error] }
        message: { type: string, description: German text for humans. }
        code:
          description: "Codes of all DEP endpoints (section `dep_nachschau` of fehlercodes.json); which ones an endpoint sends is in its description. `export_running` carries `data.exportId`. `manager_only` comes only on the cash register path (`kasse.kasseneck.at/api/v3`) for a register user without the settings right, never with an API key. Besides them the codes of `CommonErrorCode`."
          anyOf:
            - type: string
              enum: [validation, invalid_period, idempotency_conflict, export_running, too_many_exports, export_not_found, export_not_ready, export_failed, invalid_file, file_not_available, too_many_links, link_not_found, manager_only, server_error]
            - $ref: '#/components/schemas/CommonErrorCode'
        data:
          $ref: '#/components/schemas/DepExport'
    DepExport:
      type: object
      description: "A DEP export of the cash register. `createDepExport` returns only `exportId`, `status`, `from` and `to`."
      properties:
        exportId: { type: string, example: "DEP-2026-10-30-0001" }
        status: { type: string, enum: [running, done, failed] }
        from: { type: [string, "null"], format: date }
        to: { type: [string, "null"], format: date }
        createdAt: { type: [string, "null"], format: date-time }
        finishedAt: { type: [string, "null"], format: date-time }
        receiptCount: { type: [integer, "null"] }
        counterFrom: { type: [integer, "null"] }
        counterTo: { type: [integer, "null"] }
        sha256: { type: [string, "null"], description: "SHA-256 of the DEP file (`file: dep`)." }
        size: { type: [integer, "null"], description: "Bytes of the DEP file." }
        findings:
          type: [object, "null"]
          description: "Result of the check of the exported receipts. Receipts without a signature are part of the CSV and are listed here."
          properties:
            receiptCount: { type: [integer, "null"] }
            counterFrom: { type: [integer, "null"] }
            counterTo: { type: [integer, "null"] }
            gaps:
              type: array
              description: Missing counters as ranges.
              items: { type: object, properties: { from: { type: integer }, to: { type: integer } } }
            chainBreaks:
              type: array
              description: The first break of the signature chain, if any.
              items: { type: object, properties: { counter: { type: [integer, "null"] }, expected: {}, found: {} } }
            withoutCounter: { type: array, items: { type: string }, description: "`receiptId` of receipts without a counter." }
            withoutSignature: { type: array, items: { type: string }, description: "`receiptId` of receipts without a signature." }
        items:
          type: [object, "null"]
          description: "The line items file (`file: items`); null for older exports."
          properties:
            rowCount: { type: integer }
            sha256: { type: string }
            size: { type: integer }
        handoverLinks:
          type: array
          items:
            type: object
            properties:
              linkId: { type: string }
              createdAt: { type: [string, "null"], format: date-time }
              expiresAt: { type: [string, "null"], format: date-time }
              revokedAt: { type: [string, "null"], format: date-time }
              firstAccessAt: { type: [string, "null"], format: date-time }
              accessCount: { type: integer }
        error: { type: string, description: "Only with `status: failed`: `export_failed` or `export_stalled` (not finished within 35 minutes)." }
    InvoicePayments:
      type: array
      description: |
        Only on a payment receipt: an invoice from the customer area was paid in cash or by card
        on site (or such a payment was refunded), and the server wrote this receipt into the cash
        register the money went into. One entry per invoice, in the order of the
        `invoice_payment` lines (the n-th line belongs to the n-th entry). The VAT is on the
        invoice, not on this receipt: the lines count in the RKSV field "Null" but are not
        tax-free revenue. Only the server creates such receipts (`invoice_payment_server_only`);
        they are cancelled at the invoice, never with `cancelReceipt`
        (`invoice_payment_not_cancellable`). Not signed, like `cancellationOf`.
      items:
        type: object
        properties:
          invoiceId: { type: string }
          invoiceNumber: { type: string, description: "Number of the invoice, e.g. `2026-0042`." }
          paymentId: { type: string, description: The payment at the invoice. }
          customerId: { type: [string, "null"], description: "The customer of the invoice, or null." }
          amountCents: { type: integer, description: "Amount in cents, never 0; negative on a refund." }
          partial: { type: boolean, description: "true when the payment does not settle the invoice in full." }
          paidOn: { type: [string, "null"], description: "Day of the payment at the invoice (`YYYY-MM-DD`, Vienna) when it differs from the day of the receipt, else null." }
          taxNote:
            type: string
            enum: [incl_vat, zero_percent, see_invoice]
            description: "Tax note printed under the line: `incl_vat` (the invoice shows VAT), `zero_percent` (exempt or not taxable, also a small business), `see_invoice` (reverse charge)."
    ManualReceiptReason:
      type: string
      enum: [network_outage, power_outage, device_failure, system_outage, other, outside_premises]
      description: |
        Why the receipt was written by hand: five reasons for an outage of the cash register
        (§ 17 (5) RKSV: internet, power, broken device, disruption, `other` with `note`) and
        `outside_premises` for a sale outside the business premises (e.g. a house call; § 7 BarUV;
        not for taxi and hire-car rides).
    ManualReceiptErrorCode:
      type: string
      description: |
        Codes for `manualReceipt` (list `handbeleg` in
        [`fehlercodes.json`](fehlercodes.json), `/v3` spelling in map `v3`). All come from
        `createReceipt`; `cancelReceipt` answers `manual_receipt_not_allowed` when a cancellation
        carries `manualReceipt`. `manual_receipt_duplicate` carries `data.receiptId` of the receipt that already recorded
        the handwritten receipt.
      enum: [invalid_manual_receipt, manual_receipt_not_allowed, manual_receipt_date_in_future, manual_receipt_range_not_allowed, manual_receipt_duplicate]
    ManualReceipt:
      type: object
      required: [number, date, reason]
      additionalProperties: false
      description: |
        Recording a handwritten receipt (Nacherfassung). Only on `receiptType: standard`, only under
        `/v3`. The receipt's own `timeStamp` stays the time of recording (no backdating); the
        handwritten receipt's number, day and reason are printed in a block „NACHERFASSUNG“ below the
        header, with „USt: Duplikat …“ (the paper receipt was the invoice). Use the paper pad's own
        number range, never the next register number; a prefix per pad (A-1, B-1) keeps numbers unique.
        A daily summary receipt (`numberTo`) lists the first and last number of one day after an
        outage and carries the sums per VAT rate as its line items; a sale outside the premises is
        always recorded one by one. Errors: `invalid_manual_receipt`, `manual_receipt_not_allowed`,
        `manual_receipt_date_in_future`, `manual_receipt_range_not_allowed`,
        `manual_receipt_duplicate` (same number or overlapping range on the same day and cash
        register; `data.receiptId` names the receipt that already recorded it).
      properties:
        number: { type: string, pattern: '^[A-Za-z0-9][A-Za-z0-9./-]{0,19}$', description: "Number of the handwritten receipt (1-20 characters).", example: H-17 }
        numberTo: { type: string, pattern: '^[A-Za-z0-9][A-Za-z0-9./-]{0,19}$', description: "Last number: makes it a daily summary receipt. Same prefix as `number`, digits at the end, not smaller. Not with `outside_premises`." }
        count: { type: integer, minimum: 1, description: "Number of handwritten receipts in the daily summary (at most the span of the range)." }
        date: { type: string, format: date, description: "Day of the handwritten receipt (Europe/Vienna), never in the future, from 2016-01-01." }
        time: { type: string, pattern: '^([01][0-9]|2[0-3]):[0-5][0-9]$', description: "Time of the handwritten receipt (HH:MM)." }
        reason: { $ref: '#/components/schemas/ManualReceiptReason' }
        note: { type: string, maxLength: 60, description: "Own reason in one line, only and required with `reason: other`." }
    ReceiptSummary:
      type: object
      description: "Short line of a receipt in `listReceipts` (`view: summary`). Amounts in cents."
      properties:
        receiptId: { type: [string, "null"] }
        counter: { type: [integer, "null"] }
        receiptType: { type: [string, "null"], enum: [start, standard, zero, cancellation, training, null] }
        zeroKind: { type: [string, "null"], description: "Only for zero receipts; `manual` when the receipt names none." }
        timeStamp: { type: [string, "null"], description: Local time in Vienna. }
        totalCents: { type: integer, description: "Sum of `grossByRateCents`, rounded like the signed receipt and `payments[].amountCents`; negative for a cancellation." }
        grossByRateCents:
          type: object
          description: "Gross per RKSV rate group (amountRateStandard to amountRateSpecial)."
          properties:
            standard: { type: integer }
            reduced1: { type: integer }
            reduced2: { type: integer }
            zero: { type: integer }
            special: { type: integer }
        paymentMethod: { type: [string, "null"], description: "`mixed` with several payments." }
        payments: { type: array, items: { type: object }, description: "Only when the receipt has a list of payments; without provider internals." }
        tipCents: { type: integer, description: Only when the receipt carries a tip. }
        operator: { type: [object, "null"], properties: { name: { type: string } } }
        cancellationOf: { type: [object, "null"], properties: { receiptId: { type: [string, "null"] }, timeStamp: { type: [string, "null"] } } }
        cancellationReason: { type: [string, "null"] }
        cancellationStatus: { type: string, enum: [none, partial, full] }
        signatureOk: { type: boolean }
        customProjectId: { type: [string, "null"] }
        fullReceiptId: { type: [string, "null"], description: "Token for `downloadReceipt` and the receipt link." }
        manualReceipt: { $ref: '#/components/schemas/ManualReceipt', description: "Only on a receipt that records a handwritten receipt." }
    ReceiptEnvelope:
      type: object
      properties:
        status: { type: string, enum: [success, error] }
        message: { type: string, description: German text for humans. }
        code:
          anyOf:
            - $ref: '#/components/schemas/ReceiptErrorCode'
            - $ref: '#/components/schemas/CommonErrorCode'
        data:
          $ref: '#/components/schemas/ReceiptResponse'
    ReceiptResponse:
      type: object
      description: |
        The receipt and the header data of the business as printed on it (frozen with the
        receipt). The snake_case fields keep their spelling.
      properties:
        receipt:
          $ref: '#/components/schemas/Receipt'
        company: { type: [string, "null"], description: Company name of the business. }
        street: { type: [string, "null"] }
        zip: { type: [string, "null"] }
        city: { type: [string, "null"] }
        phone: { type: [string, "null"] }
        vatId: { type: [string, "null"], description: VAT ID (UID-Nummer) of the business. }
        taxNumber: { type: [string, "null"], description: Tax number (Steuernummer) of the business. }
        is_small_business: { type: [boolean, "null"], description: Small business (Kleinunternehmer). }
        footer1: { type: [string, "null"] }
        footer2: { type: [string, "null"] }
        footer3: { type: [string, "null"] }
        footer4: { type: [string, "null"] }
        thanks_message: { type: [string, "null"], description: Lines separated by line breaks. }
        kreiseck_logo: { type: [boolean, "null"] }
        logo_url: { type: [string, "null"] }
        logo_scale: { type: string, enum: [S, M, L, XL], description: "Size step of the logo, the same on screen, printer and PDF; `M` when not set." }
        headerVersionId: { type: [string, "null"], description: Version of the receipt header data. }
        layout:
          $ref: '#/components/schemas/ReceiptLayout'
        registrationInfo:
          $ref: '#/components/schemas/RegistrationInfo'
        testSignature: { type: boolean, description: Signed with a test signature outside the test environment. }
        testCashregister: { type: boolean, description: Cash register of the test environment. }
        replayed: { type: boolean, description: "Only `createReceipt`, only on a repeat with the same `idempotencyKey`: `true`, the receipt is the one stored by the first request." }
        issuedVouchers:
          type: array
          description: "Only `createReceipt` with vouchers with a code (an empty list when none was sold), and only on the first answer: the vouchers sold with their plain code."
          items: { $ref: '#/components/schemas/IssuedVoucher' }
        deprecation: { type: string, description: "Only when the request used a deprecated form (a value voucher of the older form with your own `code`, or a cancellation without reference): a German sentence for humans, like `message`; several hints follow each other in the same text. Send external vouchers with `source: external`." }
        outputs:
          type: array
          description: "Only `getReceipt`: the newest 20 outputs of the receipt, newest first."
          items: { $ref: '#/components/schemas/ReceiptOutput' }
    RegistrationInfo:
      type: [object, "null"]
      description: Only on zero receipts; otherwise `null`.
      properties:
        cardRegisteredAt: { type: [string, "null"], description: When the signature card was registered with FinanzOnline. }
        cashregisterRegisteredAt: { type: [string, "null"], description: When the cash register was registered with FinanzOnline. }
    ReceiptLayout:
      type: [object, "null"]
      description: |
        The line model of the receipt, ready to print unchanged, line by line in order. Every
        line has a `kind`; the other fields depend on it (see `ReceiptLayoutLine`). Texts are
        real text (a `€` is a `€`) and stay German, as printed. The logo is not part of the
        model (`logo_url`, `logo_scale`). `null` if the layout could not be built.
      properties:
        ruleset:
          type: integer
          enum: [1, 2]
          description: |
            Version of the layout rules the receipt was set with; old receipts keep theirs.
            `2` sets a zero receipt as a check receipt with the block of registration data.
        paperSize:
          type: string
          enum: [mm58, mm80]
          description: Paper width the column widths were chosen for; the server sets `mm80`.
        lines:
          type: array
          items:
            $ref: '#/components/schemas/ReceiptLayoutLine'
    ReceiptLayoutLine:
      description: One line of the line model, told apart by `kind`.
      oneOf:
        - type: object
          title: text
          required: [kind, text, align, bold]
          properties:
            kind: { type: string, const: text }
            text: { type: string }
            align: { type: string, enum: [left, center, right] }
            bold: { type: boolean }
        - type: object
          title: columns
          required: [kind, columns]
          properties:
            kind: { type: string, const: columns }
            columns:
              type: array
              description: The widths add up to 12.
              items:
                type: object
                required: [text, width, align]
                properties:
                  text: { type: string }
                  width: { type: integer, minimum: 1, maximum: 12, description: Share in twelfths of the line. }
                  align: { type: string, enum: [left, center, right] }
        - type: object
          title: rule
          required: [kind, char]
          properties:
            kind: { type: string, const: rule }
            char: { type: string, description: Character the separator line is drawn with. }
        - type: object
          title: space
          required: [kind, lines]
          properties:
            kind: { type: string, const: space }
            lines: { type: integer, description: Number of empty lines. }
        - type: object
          title: qr
          required: [kind, data]
          properties:
            kind: { type: string, const: qr }
            data: { type: string, description: "The machine-readable RKSV code, unchanged; print it as a QR code (§ 10 RKSV)." }
        - type: object
          title: banner
          required: [kind, text, tone]
          properties:
            kind: { type: string, const: banner }
            text: { type: string, description: "Highlighted line (bold, centred, set apart), text ready to print." }
            tone:
              type: string
              enum: [receipt_type, warning]
              description: "`receipt_type` for the receipt type (e.g. a cancellation or training receipt), `warning` for a test cash register or test signature (not a valid receipt)."
    Receipt:
      type: object
      description: |
        The stored, signed receipt. Payment provider internals
        (`payments[].providerPaymentId`, `payments[].providerData` and the older
        `cardPaymentId` / `cardPaymentData`) come only to the business itself (its API key or a
        register sign-in), never to a partner access; `creditCardProvider` and
        `payments[].provider` always stay.
      properties:
        counter: { type: integer, description: Sequential counter of the cash register. }
        receiptType: { type: string, enum: [start, standard, zero, cancellation, training] }
        zeroKind: { type: [string, "null"], enum: [monthly, annual, annual_replacement, outage_end, final, manual, null], description: "Occasion of a zero receipt; null on other receipts." }
        receiptId: { type: string }
        cashregisterId: { type: string }
        timeStamp: { type: string, description: Receipt timestamp (Europe/Vienna). }
        amountRateStandard: { type: number }
        amountRateReduced1: { type: number }
        amountRateReduced2: { type: number }
        amountRateZero: { type: number }
        amountRateSpecial: { type: number }
        certificateSerialNumber: { type: string }
        turnoverCounterAES256ICM: { type: string, description: Encrypted turnover counter (RKSV). }
        signaturePreviousReceipt: { type: string, description: Chaining to the previous receipt (RKSV). }
        fullReceiptId: { type: string, description: Encrypted token for the PDF download. }
        sig: { type: string, description: "JWS ES256: header.payload.signature." }
        signatureSuccess: { type: boolean }
        qr: { type: string, description: Machine-readable QR text of the receipt. }
        paymentMethod:
          type: string
          description: "The payment method, `mixed` when the payments use several methods."
        creditCardProvider: { type: [string, "null"] }
        cardPaymentId: { type: [string, "null"], description: "Older receipts with one card payment; null on receipts with `payments`. Only for the business itself." }
        cardPaymentData: { type: [object, "null"], description: "Older receipts with one card payment; null on receipts with `payments`. Only for the business itself." }
        payments:
          type: array
          items: { $ref: '#/components/schemas/Payment' }
        tipCents: { type: integer, description: "Only on a receipt with a tip: the tip in cents." }
        customerDetails: { type: [string, "null"] }
        legalMessage: { type: [string, "null"] }
        customProjectId: { type: [string, "null"] }
        items:
          type: array
          description: |
            The line items as stored: the fields you sent plus the internal `amount`,
            `priceOne`, `vat` (and `priceOneCents`). Lines the server adds carry a `kind`:
            `tip` (with `recipient`, `paymentMethod`, `receivedImmediately` and, if set,
            `keptByEmployee`), `voucher` (sale or redemption of a single-purpose or service
            voucher, in its VAT rate) and `voucher_float` (sale or payout of a multi-purpose
            voucher in the 0 % bucket, no revenue).
          items:
            type: object
            properties:
              name: { type: string }
              quantity: { type: number }
              unitPriceCents: { type: integer }
              vatRate: { type: number }
              amount: { type: number, description: "Quantity (stored form)." }
              priceOne: { type: number, description: "Unit price in euros (stored form)." }
              priceOneCents: { type: integer, description: "Unit price in cents (stored form)." }
              vat: { type: number, description: "VAT rate (stored form)." }
              articleId: { type: string, description: "Inventory article of the line, if sent." }
              kind: { type: string, enum: [tip, voucher, voucher_float, deposit, deposit_return], description: "Only on lines the server adds, or deposit lines you sent." }
              depositTypeId: { type: string, description: "Deposit and empties lines: the deposit type." }
              depositFor: { type: integer, minimum: 0, description: "Deposit lines: index of the main line. See `ReceiptItem.depositFor`." }
              depositKind: { type: string, enum: [single_use, reusable], description: "Deposit and empties lines." }
              perUnit: { type: integer, description: "Deposit lines: deposit pieces per unit of the main line." }
              gtin: { type: string, description: "Deposit lines: barcode of the container." }
              ean: { type: string, description: "Barcode of the article or of the single-use deposit register." }
              ownFilling: { type: boolean, description: "Deposit lines: filled by the business itself." }
              paymentMethod: { type: string, description: "Tip lines: the payment method of the tip." }
              recipient:
                type: [object, "null"]
                description: "Tip lines: who gets the tip; null when no one is named."
                properties:
                  registerUserId: { type: [string, "null"] }
                  name: { type: string }
                  owner: { type: boolean, description: "Tip of the owner: revenue of the business, split over the VAT rates." }
              receivedImmediately: { type: boolean, description: "Tip lines: see `Tip.receivedImmediately`." }
              keptByEmployee: { type: boolean, description: "Tip lines: see `Tip.keptByEmployee`; only when set." }
              addOnOf: { type: integer, minimum: 0, description: "Add-on lines: index of the main line; only when set. See `ReceiptItem.addOnOf`." }
        onPremises: { type: boolean, description: "Deposit: the goods were consumed on the premises; only on a receipt that carries a deposit or empties line." }
        sharedReturnPoint:
          type: object
          description: "Deposit: the shared return point named on the receipt, only when the cash register takes empties back at a shared point."
          properties:
            name: { type: string }
            address: { type: string }
        vouchers: { type: array, items: { $ref: '#/components/schemas/Voucher' } }
        headerVersionId: { type: [string, "null"] }
        layoutRuleset: { type: [integer, "null"] }
        registrationInfo:
          $ref: '#/components/schemas/RegistrationInfo'
        cancellationOf: { type: [object, "null"], description: "On a cancellation receipt, the reference to the original." }
        cancellationReason: { $ref: '#/components/schemas/CancellationReason' }
        manualReceipt: { $ref: '#/components/schemas/ManualReceipt', description: "Only on a receipt that records a handwritten receipt." }
        invoicePayments: { $ref: '#/components/schemas/InvoicePayments' }
        cancellations:
          type: array
          description: On a cancelled original, one entry per cancellation.
          items:
            type: object
            properties:
              receiptId: { type: string, description: The cancellation receipt. }
              at: { type: integer, description: "When, in Unix milliseconds." }
              by: { type: [object, "null"], description: "The cash register user who cancelled, or null." }
              note: { type: [string, "null"] }
              items:
                type: array
                description: "The cancelled quantity per line of the original (`index` in `items`)."
                items: { type: object, properties: { index: { type: integer }, quantity: { type: integer } } }
              refundedByPayment: { type: object, additionalProperties: { type: integer }, description: "Refunded cents per payment of the original (`p1`, `p2`, …)." }
    ListedReceipt:
      description: "A receipt of `listReceipts` with `view: full`: the stored receipt as in `getReceipt`, plus what `getReceipt` carries next to it, except `outputs` and `layout`."
      allOf:
        - $ref: '#/components/schemas/Receipt'
        - type: object
          properties:
            headerVersionId: { type: [string, "null"], description: "The header version that applies to this receipt (also for old receipts without a stored one); its header is the entry of `headers` with this id." }
            testSignature: { type: boolean, description: "Signed with a test signature outside the test environment, like `getReceipt`." }
    InvoiceDocType:
      type: string
      enum: [invoice, credit_note]
    TaxScheme:
      type: string
      enum: [normal, smallBusiness, reverseCharge, intraCommunitySupply, exportThirdCountry, domesticReverseCharge, oss, outsideScope]
      description: |
        Derived by the server; see `issueInvoice`. `intraCommunitySupply` is the
        intra-Community supply of goods (innergemeinschaftliche Lieferung, `igLieferung` on
        `/v1`). `oss` is in the catalogue but cannot be issued yet.
    CreditNoteReason:
      type: string
      enum: [cancellation, price_reduction, return, incorrect_invoice, other]
      description: Printed in the language of the invoice.
    EinvoiceMissing:
      type: string
      enum: [name, street, zip, city, country, vat_id, order_reference, order_reference_format]
      description: What an EN 16931 e-invoice is missing (`einvoice.missing[]`, and `data.missing[]` of `einvoice_incomplete` and `invoice_requirements_missing`).
    WriteOffReason:
      type: string
      enum: [uncollectible, time_barred, waived, disputed, settled_externally, other]
    InvoiceItemErrorCode:
      type: string
      description: Machine-readable reason in `code` and `data.code` of the billing-basket endpoints. Messages stay German.
      enum: [validation, module_inactive, invoice_api_not_enabled, customer_not_found, item_not_found, item_reference_conflict, item_already_invoiced, item_withdrawn, source_inactive, attachment_too_large, mandate_invalid, small_business_vat]
    InvoiceItemEnvelope:
      type: object
      properties:
        status: { type: string, enum: [success, error] }
        message: { type: string, description: German text for humans. }
        code: { $ref: '#/components/schemas/InvoiceItemErrorCode' }
        data:
          type: object
          description: |
            The answer of the endpoint, or on errors `{ code, … }` (e.g. `errors`). Which call returns
            which property is named on each property.
          properties:
            item: { $ref: '#/components/schemas/InvoiceItem', description: "createInvoiceItem, updateInvoiceItem, withdrawInvoiceItem, getInvoiceItem." }
            replayed: { type: boolean, description: "createInvoiceItem: true when the same reference with the same data was delivered before." }
            notice:
              type: array
              description: "createInvoiceItem: `billing_run_off` when the account has no billing run (only present then)."
              items:
                type: object
                properties:
                  code: { type: string, enum: [billing_run_off] }
                  message: { type: string }
            items: { type: array, items: { $ref: '#/components/schemas/InvoiceItem' }, description: "listInvoiceItems." }
            nextCursor: { type: [string, "null"], description: "listInvoiceItems: pass it as `cursor` for the next page; null on the last page." }
            mandate:
              description: "setCustomerMandate: the stored mandate; revokeCustomerMandate: null."
              oneOf:
                - { $ref: '#/components/schemas/CustomerMandate' }
                - { type: "null" }
    InvoiceUnit:
      type: string
      default: piece
      enum: [piece, pair, set, dozen, second, minute, hour, day, night, week, month, quarter, half_year, year, milligram, gram, kilogram, tonne, millimetre, centimetre, metre, running_metre, kilometre, square_metre, hectare, millilitre, litre, cubic_metre, kilowatt_hour, megawatt_hour, gigabyte, terabyte, flat_rate, person, licence, user, device, session, trip, page, sheet, package, box, carton, bottle, can, roll, bag, pallet]
    BasketItemInput:
      type: object
      required: [customerId, source, reference, description, quantity, vatRate, serviceStart]
      properties:
        customerId: { type: string }
        source: { type: string, pattern: '^[a-z0-9-]{2,40}$' }
        reference: { type: string, minLength: 1, maxLength: 120 }
        description: { type: string, maxLength: 300 }
        subtitle: { type: string, maxLength: 1000 }
        quantity: { type: number, exclusiveMinimum: 0, maximum: 1000000000, description: Up to 3 decimals. }
        unit: { $ref: '#/components/schemas/InvoiceUnit' }
        kind: { type: string, enum: [goods, service] }
        unitPriceCents: { type: integer, minimum: -100000000, maximum: 100000000, description: Exactly one of unitPriceCents and unitPriceMicros; negative for discounts and corrections. }
        unitPriceMicros: { type: integer, minimum: -1000000000000, maximum: 1000000000000 }
        vatRate: { type: integer, enum: [0, 10, 13, 20] }
        discountPct: { type: number, minimum: 0, maximum: 100, description: Up to 2 decimals. }
        serviceStart: { type: string, format: date }
        serviceEnd: { type: string, format: date }
        metadata: { type: object, maxProperties: 20, propertyNames: { pattern: '^[a-zA-Z0-9_]{1,40}$' }, additionalProperties: { type: string, maxLength: 500 } }
        attachments:
          type: array
          maxItems: 3
          items:
            type: object
            required: [filename, contentType, contentBase64]
            properties:
              filename: { type: string, maxLength: 120 }
              contentType: { type: string, enum: [text/csv, application/pdf] }
              contentBase64: { type: string, description: At most 2 MB per file (attachment_too_large). }
    InvoiceItem:
      type: object
      properties:
        id: { type: string }
        source: { type: string }
        reference: { type: string }
        customerId: { type: string }
        status: { type: string, enum: [pending_review, open, invoiced, withdrawn] }
        description: { type: string }
        subtitle: { type: [string, "null"] }
        quantity: { type: number }
        unit: { type: string }
        kind: { type: string }
        unitPriceCents: { type: integer, description: Either this or unitPriceMicros is present. }
        unitPriceMicros: { type: integer }
        vatRate: { type: number }
        discountPct: { type: number }
        netCents: { type: [integer, "null"] }
        serviceStart: { type: string, format: date }
        serviceEnd: { type: [string, "null"] }
        metadata: { type: object, additionalProperties: { type: string } }
        attachments: { type: array, items: { type: object, properties: { filename: { type: string }, contentType: { type: string }, bytes: { type: integer } } } }
        invoiceId: { type: [string, "null"] }
        invoiceNumber: { type: [string, "null"] }
        createdAt: { type: [string, "null"] }
        updatedAt: { type: [string, "null"] }
        approvedAt: { type: [string, "null"] }
        invoicedAt: { type: [string, "null"] }
        withdrawnAt: { type: [string, "null"] }
    CustomerMandate:
      type: object
      description: The full IBAN never leaves the server.
      properties:
        customerId: { type: string }
        mandateReference: { type: string }
        signedAt: { type: [string, "null"], format: date }
        ibanMasked: { type: [string, "null"] }
        bic: { type: [string, "null"] }
        accountHolder: { type: [string, "null"] }
        scheme: { type: string, enum: [core, b2b] }
    InvoiceErrorCode:
      type: string
      description: |
        Machine-readable reason in `code` and `data.code` of the invoice endpoints. These
        codes were English from the start and are the same on `/v1`. Messages stay German.
      enum: [validation, idempotency_conflict, module_inactive, customer_not_found, customer_exists, short_code_taken, short_code_immutable, recipient_required, invoice_requirements_missing, invoice_not_found, invoice_ambiguous, not_cancellable, partial_credit_exists, credit_exceeds_invoice, einvoice_incomplete, invoice_api_not_enabled, invoice_setup_incomplete, language_not_allowed, brand_not_found, not_payable, payment_exceeds_invoice, tax_scheme_mismatch, vat_rate_not_in_country, reverse_charge_reason_required, reverse_charge_threshold, mixed_supply_not_allowed, oss_not_enabled, einvoice_unavailable, amount_too_large, vat_id_invalid, vat_id_check_pending, reservation_not_found, reservation_mismatch, reservation_not_active, invoice_number_taken, deposit_not_enabled, deposit_type_not_found, deposit_set_by_server, invalid_deposit_quantity, invalid_deposit, cash_receipt_pending]
    InvoiceEnvelope:
      type: object
      properties:
        status: { type: string, enum: [success, error] }
        message: { type: string, description: German text for humans. }
        code: { $ref: '#/components/schemas/InvoiceErrorCode' }
        data:
          type: object
          description: The answer of the endpoint, or on errors `{ code, … }` (e.g. `errors`, `missing`, `issues`, `expected`, `given`, `reason`, `remainingCents`; `retryAfter` in seconds with `vat_id_check_pending` and `cash_receipt_pending`).
    InvoiceCustomerInput:
      type: object
      properties:
        type: { type: string, enum: [private, company], description: Required on create. }
        name: { type: string, maxLength: 200, description: Required on create. }
        country: { type: string, description: "ISO 3166 alpha-2, e.g. `AT`; required on create." }
        legalForm: { type: string, maxLength: 40 }
        email: { type: string }
        phone: { type: string }
        street: { type: string }
        houseNumber: { type: string }
        zip: { type: string }
        city: { type: string }
        vatId: { type: string, description: VAT ID; format and check digit are checked. }
        shortCode: { type: string, maxLength: 8, description: "A–Z/0–9, unique per account, cannot be changed once set." }
        isAuthority: { type: boolean, description: "Public authority: the e-invoice needs an address and `orderReference`." }
        note: { type: string, maxLength: 1000 }
        externalId: { type: string, maxLength: 120, description: "Your own ID, unique per account." }
        language: { type: string, enum: [de, en] }
    InvoiceCustomer:
      allOf:
        - $ref: '#/components/schemas/InvoiceCustomerInput'
        - type: object
          properties:
            id: { type: string }
            createdAt: { type: [string, "null"], description: ISO 8601 (UTC). }
            updatedAt: { type: [string, "null"], description: ISO 8601 (UTC). }
    InvoiceItemInput:
      type: object
      required: [description, quantity, vatRate]
      description: Exactly one of `unitPriceCents` and `unitPriceMicros`.
      properties:
        description: { type: string, maxLength: 300 }
        subtitle: { type: string, maxLength: 1000 }
        quantity: { type: number, exclusiveMinimum: 0, maximum: 1000000000, description: At most 3 decimals. }
        unit:
          type: string
          default: piece
          enum: [piece, pair, set, dozen, second, minute, hour, day, night, week, month, quarter, half_year, year, milligram, gram, kilogram, tonne, millimetre, centimetre, metre, running_metre, kilometre, square_metre, hectare, millilitre, litre, cubic_metre, kilowatt_hour, megawatt_hour, gigabyte, terabyte, flat_rate, person, licence, user, device, session, trip, page, sheet, package, box, carton, bottle, can, roll, bag, pallet]
        kind: { type: string, enum: [goods, service], default: goods, description: Goods or service; separates the intra-Community supply from reverse charge. }
        unitPriceCents: { type: integer, minimum: 0, maximum: 100000000, description: "Unit price in whole cents, in the `priceMode`." }
        unitPriceMicros: { type: integer, minimum: 0, maximum: 1000000000000, description: "Unit price in micro-euros (10⁻⁶ €) for prices below one cent; only once enabled for the account. In responses it is the binding price and `unitPriceCents` only a display aid." }
        vatRate: { type: integer, enum: [0, 10, 13, 20] }
        discountPct: { type: number, minimum: 0, maximum: 100 }
        deposit: { $ref: '#/components/schemas/InvoiceItemDepositInput' }
    InvoiceItemDepositInput:
      type: object
      required: [depositTypeId, depositFor]
      description: |
        Marks the line as a deposit line for the line `depositFor` of the same request (see
        "Deposit on invoices" at the tag *Receipts*). The server sets amount
        and VAT rate from the deposit type; a deposit line is never discounted or changed
        by hand. Needs deposit switched on for the account (`deposit_not_enabled`); a line of
        your own for a main line with `articleId` is `deposit_set_by_server`.
      properties:
        depositTypeId: { type: string, minLength: 1, maxLength: 128, description: "`id` from `listDepositTypes`; `einweg` for single-use deposit." }
        depositFor: { type: integer, minimum: 0, maximum: 499, description: "Index of the main line in `items`." }
        gtin: { type: string, pattern: '^[0-9]{8,14}$', description: "Barcode (GTIN) of the container, 8 to 14 digits; needed for the EWP report." }
        ownFilling: { type: boolean, description: "The business fills the container itself (counts in the EWP report; needs the filler role)." }
    InvoiceItemDeposit:
      allOf:
        - $ref: '#/components/schemas/InvoiceItemDepositInput'
        - type: object
          required: [depositKind]
          properties:
            depositKind: { type: string, enum: [single_use, reusable], description: "Set by the server from the deposit type." }
    InvoiceDetailItem:
      description: A line of a stored invoice; `deposit` is only present on deposit lines.
      allOf:
        - $ref: '#/components/schemas/InvoiceItemInput'
        - type: object
          properties:
            deposit: { $ref: '#/components/schemas/InvoiceItemDeposit' }
    IssueInvoiceItemInput:
      description: A line of `issueInvoice`; the stock fields only matter with the inventory module.
      allOf:
        - $ref: '#/components/schemas/InvoiceItemInput'
        - type: object
          properties:
            articleId: { type: string, description: "The article sold on this line; a stock-tracked article is booked out of stock at `stockLocationId`." }
            reservationId:
              type: string
              description: |
                Redeems this reservation (`createReservation`) for the line. Needs `articleId`
                (`validation`). Checked when issuing: the reservation must belong to the account
                (`reservation_not_found`), be active (`reservation_not_active`) and hold an
                open line of the same article at the invoice's `stockLocationId`
                (`reservation_mismatch`); the quantity is not checked. An expired reservation
                is no error: notice `reservation_expired`, the line is sold without it.
                Redeemed when the invoice is booked in the stock: the reserved quantity becomes
                the sale, the rest goes back to available stock, and `reservation.redeemed` is
                sent. Only on `issueInvoice`; a credit note does not know the field
                (`validation`).
    InvoicePaymentInput:
      type: object
      required: [method]
      properties:
        method: { type: string, enum: [transfer, card, online, cash] }
        amountCents: { type: integer, minimum: 1, description: "Default: the open amount." }
        paidAt: { type: string, format: date, description: "Default: today in Vienna; never in the future." }
        reference: { type: string, maxLength: 100, description: "Your own payment ID; stored, never printed." }
        onSite: { type: boolean, description: "The payment was made on site (terminal at the counter): a cash sale. Not with `transfer`." }
    IssueInvoiceParams:
      type: object
      required: [idempotencyKey, priceMode, serviceStart, items]
      properties:
        idempotencyKey: { type: string, minLength: 1, maxLength: 120 }
        customerId: { type: string }
        taxScheme: { $ref: '#/components/schemas/TaxScheme' }
        reverseChargeReason:
          type: string
          enum: [construction, scrap, mobile_devices, it_devices, metals, emission_certificates, gas_electricity, energy_certificates, investment_gold, security_transfer, foreign_supplier]
          description: Reason for domestic reverse charge; without it there is no `domesticReverseCharge`.
        priceMode: { type: string, enum: [net, gross] }
        serviceStart: { type: string, format: date }
        serviceEnd: { type: string, format: date }
        paymentTermDays: { type: integer, minimum: 0, maximum: 365, default: 14 }
        orderReference: { type: string, maxLength: 200 }
        intro: { type: string, maxLength: 2000 }
        note: { type: string, maxLength: 2000 }
        paymentReference: { type: string, maxLength: 140 }
        girocode: { type: boolean }
        tracking: { type: boolean }
        items: { type: array, minItems: 1, maxItems: 500, items: { $ref: '#/components/schemas/IssueInvoiceItemInput' } }
        metadata: { type: object, description: "Up to 20 keys `[a-zA-Z0-9_]{1,40}` with text ≤ 500; never printed.", additionalProperties: { type: string } }
        language: { type: string, enum: [de, en] }
        brandId: { type: string }
        stockLocationId: { type: string, description: "Stock location the stock-tracked articles of this invoice are booked out of; default the default location of the account. A `reservationId` must be reserved at this location." }
        payment: { $ref: '#/components/schemas/InvoicePaymentInput' }
        dryRun: { type: boolean }
        acceptVatIdRisk: { type: boolean, description: "Issue although the VAT ID check has no result yet (`vat_id_check_pending`); the issuer carries the risk and the invoice carries `vatIdRisk`. Never overrides `vat_id_invalid`. Not part of the request for idempotency (same key with or without it is the same invoice)." }
    InvoiceTotals:
      type: object
      description: Always positive, also on credit notes (the direction is in `docType`).
      properties:
        netCents: { type: integer }
        vatCents: { type: integer }
        grossCents: { type: integer }
        byRate:
          type: array
          items:
            type: object
            properties:
              rate: { type: integer }
              netCents: { type: integer }
              vatCents: { type: integer }
              grossCents: { type: integer }
    EinvoiceStatus:
      type: [object, "null"]
      properties:
        level: { type: string }
        formats: { type: array, items: { type: string } }
        missing: { type: array, items: { $ref: '#/components/schemas/EinvoiceMissing' } }
    Invoice:
      type: object
      properties:
        id: { type: string }
        number: { type: [string, "null"] }
        docType: { $ref: '#/components/schemas/InvoiceDocType' }
        status: { type: string }
        invoiceDate: { type: [string, "null"], format: date }
        dueDate: { type: [string, "null"], format: date }
        customerId: { type: [string, "null"] }
        totals: { $ref: '#/components/schemas/InvoiceTotals' }
        einvoice: { $ref: '#/components/schemas/EinvoiceStatus' }
        statusUrl: { type: [string, "null"] }
        statusPassword: { type: [string, "null"] }
        metadata: { type: object }
        language: { type: string, enum: [de, en] }
        brand: { type: [object, "null"], properties: { id: { type: [string, "null"] }, name: { type: [string, "null"] } } }
        paidCents: { type: integer }
        openCents: { type: integer }
        vatIdProof:
          type: [object, "null"]
          description: |
            The VAT ID check of the customer, frozen when the invoice was issued: a valid result
            from at most 30 days before. `null` when no check was frozen (also on invoices that
            needed none, and on credit notes).
          required: [checkedOn, source, level, code]
          properties:
            checkedOn: { type: string, format: date, description: "Day of the check in Vienna, `YYYY-MM-DD`." }
            source: { type: string, enum: [finanzonline, vies], description: "Who checked: FinanzOnline or VIES." }
            level: { type: integer, enum: [1, 2], description: "`1` = VAT ID only, `2` = VAT ID with name and address." }
            code: { type: [string, "null"], description: "Check code of the public check page (printed on the PDF as a QR code); `null` when none was given." }
          example: { checkedOn: "2026-09-26", source: vies, level: 1, code: "248H248H" }
        vatIdRisk:
          type: [object, "null"]
          description: "Issued with `acceptVatIdRisk: true` while the VAT ID check had no result; the issuer carries the risk. `null` otherwise."
          required: [acceptedOn]
          properties:
            acceptedOn: { type: string, format: date, description: "Day of the confirmation in Vienna, `YYYY-MM-DD`." }
          example: { acceptedOn: "2026-09-26" }
    InvoiceDetail:
      allOf:
        - $ref: '#/components/schemas/Invoice'
        - type: object
          properties:
            items: { type: array, items: { $ref: '#/components/schemas/InvoiceDetailItem' } }
            customer:
              type: [object, "null"]
              description: Recipient as of the issue date.
              properties:
                name: { type: string }
                type: { type: string, enum: [private, company] }
                street: { type: [string, "null"] }
                houseNumber: { type: [string, "null"] }
                zip: { type: [string, "null"] }
                city: { type: [string, "null"] }
                country: { type: string }
                vatId: { type: [string, "null"] }
                shortCode: { type: [string, "null"] }
                email: { type: [string, "null"] }
                isAuthority: { type: boolean }
            taxScheme: { $ref: '#/components/schemas/TaxScheme' }
            reverseChargeReason: { type: [string, "null"] }
            taxCountry: { type: string }
            priceMode: { type: string, enum: [net, gross] }
            serviceStart: { type: [string, "null"] }
            serviceEnd: { type: [string, "null"] }
            paymentTermDays: { type: [integer, "null"] }
            orderReference: { type: [string, "null"] }
            payments:
              type: array
              items:
                type: object
                properties:
                  id: { type: [string, "null"] }
                  amountCents: { type: integer }
                  date: { type: [string, "null"] }
                  method: { type: [string, "null"] }
                  reference: { type: [string, "null"] }
            overdue: { type: boolean }
            writtenOff: { type: boolean }
            writeOffReasonCode:
              oneOf:
                - $ref: '#/components/schemas/WriteOffReason'
                - type: "null"
            related: { type: [object, "null"], description: "On credit notes, the invoice: `{ invoiceId, number }`." }
            creditNotes: { type: array, items: { type: object, properties: { id: { type: string }, number: { type: string }, grossCents: { type: integer } } } }
            source: { type: [string, "null"] }
            createdAt: { type: [string, "null"], description: ISO 8601 (UTC). }
            finalizedAt: { type: [string, "null"], description: ISO 8601 (UTC). }
    InvoicePreview:
      type: object
      description: "`issueInvoice` with `dryRun: true`: what the invoice would show, without number and status."
      properties:
        docType: { $ref: '#/components/schemas/InvoiceDocType' }
        invoiceDate: { type: string, format: date }
        dueDate: { type: string, format: date }
        customerId: { type: [string, "null"] }
        taxScheme: { $ref: '#/components/schemas/TaxScheme' }
        taxSchemeReason: { type: [string, "null"] }
        reverseChargeReason: { type: [string, "null"] }
        taxCountry: { type: string }
        priceMode: { type: string, enum: [net, gross] }
        totals: { $ref: '#/components/schemas/InvoiceTotals' }
        language: { type: string, enum: [de, en] }
        brand: { type: [object, "null"] }
        einvoice: { $ref: '#/components/schemas/EinvoiceStatus' }
    PageLimit:
      type: integer
      minimum: 1
      maximum: 200
      default: 50
      description: Entries per page, 1–200, default 50.
    NextCursor:
      type: [string, "null"]
      description: Pass it as `cursor` for the next page; `null` on the last page. A page can hold fewer than `limit` entries although more follow.
    InventoryErrorCode:
      type: string
      description: |
        Machine-readable reason in `code` and `data.code` of the inventory endpoints (HTTP 200,
        `status: "error"`). Messages stay German. Some codes come from the shared stock
        booking engine of panel and cash register and are rare through the API; they are
        listed so that every code the server can send is documented.

        | `code` | When | Extra fields in `data` |
        |---|---|---|
        | `validation` | a parameter is missing, unknown, of the wrong type or out of range | `errors[{ field, message }]` |
        | `invalid_cursor` | `cursor` is not a `nextCursor` of this list | none |
        | `rate_limited` | more than about 20 calls per second for the account (bursts up to 40), or `sendWebhookTest` after 20 test deliveries on a calendar day in Vienna; also the header `Retry-After` | `retryAfterSec` |
        | `module_inactive` | the inventory module (Lager) is not active for the account | none |
        | `register_user_not_allowed` | the key belongs to a cash register user (device and PIN) | none |
        | `inventory_api_not_enabled` | a writing call while „Lager-API schreiben“ (writing via the inventory API) is not enabled for the account, or `purchasePriceMicros` without „Einkaufswerte per API“ (purchase values via the API); reading and webhooks never return it, a `kr_test_…` key may always write | `errors[{ field: "purchasePriceMicros" }]` in the second case |
        | `article_not_found` | no such article in this account (`lookupArticleByCode`: no such active article) | none |
        | `webhook_not_found` | the `webhookId` does not exist in this account (or this environment) | none |
        | `webhook_limit` | `createWebhook` when the account already has 5 webhooks | none |
        | `invalid_webhook_url` | `url` is not a full `https://` address, carries credentials or points to a private host | `errors[{ field: "url", message }]` |
        | `event_not_subscribed` | `sendWebhookTest` for an event the webhook does not subscribe to | none |
        | `webhook_inactive` | `sendWebhookTest` to an inactive webhook | none |
        | `server_error` | unexpected error; repeat the call later with the same `idempotencyKey` | none |
        | `webhook_event_not_available` | `createWebhook` / `updateWebhook` with an event whose module is not active for the account (`receipt.*`: cash register, the others: inventory) | `errors[{ field: "events", message }]` |
        | `idempotency_key_required` | a writing call without `idempotencyKey` | none |
        | `idempotency_conflict` | the `idempotencyKey` was used before on this endpoint with other parameters | none |
        | `location_not_found` | a location ID does not exist in this account | none |
        | `location_inactive` | the location was closed; nothing can be booked or reserved there | none |
        | `invalid_location` | a location without a valid name (panel) | none |
        | `invalid_locations` | the location list of an article is not a list of IDs | none |
        | `invalid_transfer` | `transferStock` with the same location as source and target | none |
        | `operation_not_found` | `reverseStockMovement`: no such booking | none |
        | `already_reversed` | `reverseStockMovement`: the booking was reversed before | none |
        | `reversal_not_possible` | `reverseStockMovement`: the goods received were partly sold already, or the stock value no longer covers the reversal; book a loss instead | none |
        | `reversal_not_supported` | `reverseStockMovement` of a booking that cannot be reversed (sales, invoices, reservations, …) | none |
        | `exceeds_stock` | a transfer, loss or condition change takes more than the location holds; these bookings never overdraw | none |
        | `no_positions` | `items` is empty | none |
        | `too_many_positions` | more than 80 lines in one booking, more than 50 in one reservation; a variant call that would need more than 490 writes in one transaction (nothing is written; create fewer variants and the rest with `addVariant`); a stocktake with more than 5000 items (split it by groups or articles) | `field` with variant calls: `variants`, `createMatrix` or `externalIds` |
        | `invalid_step` | an internal booking step is malformed | none |
        | `invalid_quantity` | a quantity is 0, negative where it must not be, too large, or not a whole number of items for `stockKind: serial` | none |
        | `invalid_amount` | an amount must be a whole number other than 0 | none |
        | `invalid_price` | a purchase price is not a whole number of micro-euros ≥ 0 | none |
        | `negative_value` | the computed value of a loss would be negative | none |
        | `invalid_reason` | `recordStockLoss` with an unknown `reason` | none |
        | `note_required` | `recordStockLoss` with `reason: other` and no `note` | none |
        | `withdrawal_type_required` | `recordStockLoss` with `reason: withdrawal` and no `withdrawalType` | none |
        | `invalid_method` | unknown valuation method (panel) | none |
        | `invalid_stock_kind` | unknown stock kind | none |
        | `invalid_minimum` | a minimum stock per location is not a whole number of thousandths ≥ 0 | none |
        | `invalid_dimensions` | shipping dimensions of an article are malformed (panel) | none |
        | `weight_missing` | `receiveGoods` with `allocation: weight` for an article without weight | none |
        | `invalid_landed_cost` | `landedCosts` is not a list of type and amount, or has an unknown `type` | none |
        | `invalid_distribution` | unknown `allocation` | none |
        | `landed_costs_mismatch` | with `allocation: manual` the `landedCostCents` of the lines do not add up to the landed costs | none |
        | `return_totals_mismatch` | a return does not fit quantity and value of the sale it refers to | none |
        | `lot_not_found` | the lot is not at this location | none |
        | `invalid_serial` | a serial number contains a slash | none |
        | `serial_required` | items of an article with `stockKind: serial` need exactly one unique serial number each | none |
        | `serial_not_allowed` | serial numbers for an article with `stockKind: quantity` | none |
        | `serial_already_exists` | the serial number is already in stock | none |
        | `serial_not_in_stock` | the serial number is not at this location | none |
        | `code_taken` | `createArticle` / `updateArticle`: the EAN (or the next internal code) belongs to another active article | `articleId` of the holder; `field: "ean"` only when the EAN is taken |
        | `external_id_taken` | an entry of `externalIds` belongs to another active article | `field: "externalIds.<system>"`, `articleId` |
        | `group_not_found` | `groupId` does not exist | `field: "groupId"` |
        | `revenue_group_not_found` | `revenueGroupId` does not exist | `field: "revenueGroupId"` |
        | `stock_kind_locked` | `updateArticle` changes `stockKind` after the first stock movement | none |
        | `article_inactive` | the article is deactivated: no changes, no reservations | none |
        | `invalid_position` | a line of `items` is not an object | none |
        | `invalid_condition` | unknown `condition`, `from` or `to` (`sellable`, `defective`) | none |
        | `reason_required` | `reverseStockMovement` with an empty `reason` | none |
        | `insufficient_available` | `createReservation`: `available` does not cover a line; nothing is reserved | `details[{ articleId, locationId, requested, available }]`, only the lines that fail (`available` can be negative) |
        | `reservation_not_found` | no such reservation in this account | none |
        | `reservation_not_active` | `extendReservation` / `releaseReservation` on a reservation that is redeemed, released or expired; `extendReservation` also on one already past its `expiresAt` (it is expired right away and `reservation.expired` is sent) | none |
        | `variant_group_not_found` | no such variant group in this account | none |
        | `variant_already_exists` | the combination of `variantAttributes` exists in the group already (`addVariant`), or is in `variants` twice (`createVariantGroup`) | `field`; `articleId` of the existing variant with `addVariant` |
        | `invalid_variant_attributes` | `variantAttributes` miss an attribute of the group, name an unknown one, or use a value that is not in its list | `field`, e.g. `variantAttributes.farbe`; `errors[{ field, message }]` with the allowed values |
        | `variant_group_inactive` | the variant group is deactivated: no `addVariant`, no changes (except repeating `active: false`) | none |
        | `variant_limit` | `addVariant` when the group already has 250 active variants | none |
        | `stocktake_not_found` | no such stocktake in this account | none |
        | `stocktake_not_open` | counting or voiding while the stocktake is not `counting`, in `review` on an item that is not open for recount, or voiding a count of an earlier round | none |
        | `stocktake_closed` | the stocktake is `closed` or `cancelled`; nothing can change | none |
        | `stocktake_not_in_review` | `recountStocktake` or `closeStocktake` outside `review` | none |
        | `stocktake_closing` | the stocktake is being closed (`closing`): no counts, no review, no cancelling; `closeStocktake` itself answers with the state instead | none |
        | `stocktake_location_busy` | `createStocktake` while another stocktake is open at the location | `stocktakeId` of the open one |
        | `stocktake_review_running` | `recountStocktake` or `closeStocktake` before the review is complete (`review.complete: false`); wait and repeat | none |
        | `stocktake_recount_open` | `closeStocktake` while a recount is open; count the items and call `reviewStocktake` again | none |
        | `article_not_in_scope` | a count or recount of an article that is not in the scope of the stocktake (`scope.type` `groups` or `articles`) | `articleId` with `recountStocktake` |
        | `article_not_tracked` | the article keeps no stock (`stockTracked: false`): it cannot be in a stocktake | `articleId` with `createStocktake` |
        | `count_not_found` | no such count in this stocktake | none |
        | `count_already_voided` | `voidStocktakeCount` on a count that is voided already | none |
        | `serial_already_counted` | a serial number counted twice in the same round of an item | none |
        | `too_many_counts` | more than 200 counts per item and round, or more than 1000 serial numbers per item | none |
        | `stocktake_not_closed` | `getStocktakePdf` before the stocktake is `closed` (also when it was cancelled) | none |

        Authentication errors carry the codes of the list `auth` in
        [`fehlercodes.json`](fehlercodes.json), for example `unauthorized` (key missing or
        wrong), `api_not_approved` (live key before Kasseneck released the API for the
        account) and `live_not_enabled`. The notices of a booking (`warnings[]`) are not
        errors; their codes are in `InventoryWarningCode` and in the list `lager_warnungen`
        of `fehlercodes.json`.
      enum: [validation, invalid_cursor, rate_limited, module_inactive, register_user_not_allowed, inventory_api_not_enabled, article_not_found, webhook_not_found, webhook_limit, invalid_webhook_url, event_not_subscribed, webhook_inactive, server_error, webhook_event_not_available, idempotency_key_required, idempotency_conflict, location_not_found, location_inactive, invalid_location, invalid_locations, invalid_transfer, operation_not_found, already_reversed, reversal_not_possible, reversal_not_supported, exceeds_stock, no_positions, too_many_positions, invalid_step, invalid_quantity, invalid_amount, invalid_price, negative_value, invalid_reason, note_required, withdrawal_type_required, invalid_method, invalid_stock_kind, invalid_minimum, invalid_dimensions, weight_missing, invalid_landed_cost, invalid_distribution, landed_costs_mismatch, return_totals_mismatch, lot_not_found, invalid_serial, serial_required, serial_not_allowed, serial_already_exists, serial_not_in_stock, code_taken, external_id_taken, group_not_found, revenue_group_not_found, stock_kind_locked, article_inactive, invalid_position, invalid_condition, reason_required, insufficient_available, reservation_not_found, reservation_not_active, variant_group_not_found, variant_already_exists, invalid_variant_attributes, variant_group_inactive, variant_limit, stocktake_not_found, stocktake_not_open, stocktake_closed, stocktake_not_in_review, stocktake_closing, stocktake_location_busy, stocktake_review_running, stocktake_recount_open, article_not_in_scope, article_not_tracked, count_not_found, count_already_voided, serial_already_counted, too_many_counts, stocktake_not_closed]
    SignatureCardOrder:
      type: object
      properties:
        orderId: { type: string }
        status: { type: string, enum: [pending, activating, activated, failed, cancelled] }
        source: { type: string, enum: [card_pool, workstation] }
        createdAt: { type: [string, "null"], format: date-time }
        updatedAt: { type: [string, "null"], format: date-time }
        setup:
          type: object
          properties:
            registerWithFinanzOnline: { type: boolean }
            cashRegisterIds: { type: array, items: { type: string } }
            replaceCardId: { type: [string, "null"] }
        card:
          type: [object, "null"]
          properties:
            serialHex: { type: [string, "null"] }
            activatedAt: { type: [string, "null"], format: date-time }
        run:
          type: [object, "null"]
          properties:
            state: { type: string, enum: [waiting_for_activation, waiting_for_card, running, paused, error, done] }
            step: { type: [string, "null"], enum: [verify, register, assign, zero_receipt, decommission_old_card, null] }
            cashRegisters:
              type: array
              items:
                type: object
                properties:
                  cashRegisterId: { type: string }
                  assigned: { type: boolean }
                  zeroReceiptId: { type: [string, "null"] }
        error:
          type: [object, "null"]
          properties:
            code: { type: string, enum: [card_pool_empty, activation_failed], description: "Only here, never as the answer code of a call." }
    InventoryEnvelope:
      type: object
      properties:
        status: { type: string, enum: [success, error] }
        message: { type: string, description: German text for humans. }
        code: { $ref: '#/components/schemas/InventoryErrorCode' }
        data:
          type: object
          description: The answer of the endpoint (named on each endpoint), or on errors `InventoryError`.
          anyOf:
            - { type: object, description: Success. }
            - $ref: '#/components/schemas/InventoryError'
    InventoryError:
      type: object
      description: "`data` of an error answer of the inventory endpoints."
      required: [code]
      properties:
        code: { $ref: '#/components/schemas/InventoryErrorCode' }
        errors:
          type: array
          description: "With `validation` and `invalid_webhook_url`: one entry per field."
          items: { type: object, properties: { field: { type: string, example: "limit" }, message: { type: string } } }
        retryAfterSec: { type: integer, minimum: 1, description: "Only with `rate_limited`: wait this many seconds (also in the header `Retry-After`)." }
        field: { type: string, description: "With `external_id_taken`, `group_not_found`, `revenue_group_not_found` and with `code_taken` for a taken EAN: the parameter, e.g. `ean` or `externalIds.shop` (in `createVariantGroup` with the variant, e.g. `variants[2].externalIds.shop`; `defaults.groupId` when the group came from the defaults). Absent with `code_taken` for the next internal code. Also with `invalid_variant_attributes`, `variant_already_exists` and `too_many_positions`." }
        articleId: { type: string, description: "With `code_taken` and `external_id_taken`: the article that holds the code. With `variant_already_exists` from `addVariant`: the existing variant. With `article_not_found` and `article_not_tracked` from `createStocktake` and `article_not_in_scope` from `recountStocktake`: the article concerned." }
        stocktakeId: { type: string, description: "Only with `stocktake_location_busy`: the stocktake open at the location." }
        details:
          type: array
          description: "Only with `insufficient_available`: the lines that are not covered."
          items:
            type: object
            properties:
              articleId: { type: string }
              locationId: { type: string }
              requested: { type: integer }
              available: { type: integer, description: Can be negative. }
    DepositSettings:
      type: [object, "null"]
      description: "The deposit set-up of the business, `null` when deposit (Pfand & Leergut) is switched off. Not an error."
      required: [singleUse, reusable, depositTypes]
      properties:
        singleUse: { type: boolean, description: "Account switch for single-use deposit." }
        reusable: { type: boolean, description: "Account switch for reusable deposit. The list is what `createReceipt` accepts: active reusable types are in it also with `reusable: false`." }
        depositTypes:
          type: array
          description: "Active deposit types only. Single-use first (`id` `einweg`), then reusable ones by name."
          items:
            $ref: '#/components/schemas/DepositType'
    DepositType:
      type: object
      required: [id, kind, name, type, amounts, returnRate, used]
      properties:
        id: { type: string, description: "Use it as `depositTypeId` on receipt lines and in the `deposits` of articles. `einweg` for the single-use type." }
        kind: { type: string, enum: [single_use, reusable] }
        name: { type: string }
        type: { type: [string, "null"], enum: [bottle, crate, keg, cup, glass, other, null], description: "Kind of container of a reusable type, `null` for single-use." }
        amounts:
          type: array
          description: "Deposit amount in whole cents per valid-from day (`YYYY-MM-DD`, Vienna); the amount valid on the day of the receipt applies."
          items:
            type: object
            properties:
              from: { type: string, format: date }
              cents: { type: integer }
        returnRate: { type: [number, "null"], description: "VAT rate (percent) the server applies to returned empties. `0` for single-use and for small businesses; for a reusable type `null` while it was never issued (`used: false`), otherwise the lowest rate it was issued with." }
        used: { type: boolean, description: "Set as soon as an active article uses the type (directly or through its group) or a receipt already carried an explicit reusable line of it. A group rule without an active article does not count. Reusable empties of a type with `used: false` are `deposit_type_not_issued`." }
    EwpReason:
      type: string
      enum: [own_consumption, sampling, donation, theft, free_goods, stocktake, return, external_system, other]
    EwpMasterData:
      type: object
      description: "Master data of a GTIN as the deposit system wants it; missing entries are empty text. The values are the codes of the deposit system and stay as they are."
      properties:
        barcodeType: { type: string, example: International, description: "`Austria` or `International`." }
        productOrigin: { type: string, example: "Produced in Austria" }
        depositFee: { type: string, example: D1 }
        producerFee: { type: string, example: PF1 }
        ecoImpact: { type: string, example: EFP1 }
        intBarcodeUsage: { type: string, example: PFI1, description: "Fee code for an international barcode; empty for `Austria`." }
    EwpLine:
      type: object
      required: [gtin, name, domestic, foreign, sources]
      description: One registered GTIN with its quantities in whole pieces.
      properties:
        gtin: { type: string }
        name: { type: string }
        masterData: { $ref: '#/components/schemas/EwpMasterData' }
        domestic: { type: integer, description: "Pieces in Austria; negative only through returns, which also shows as a warning." }
        foreign: { type: integer, description: Pieces in the countries the deposit system lists as relevant. }
        sources:
          type: object
          description: Where the pieces come from.
          properties:
            register: { type: integer, description: Receipts of the registers. }
            invoices: { type: integer }
            deliveryNotes: { type: integer }
            extra: { type: integer, description: Extra quantities of the month. }
    EwpWarning:
      type: object
      required: [code]
      description: |
        A warning blocks nothing. Fields by `code`: `gtin_not_registered` (`gtin`, `quantity`),
        `foreign_not_reportable` (`gtin`, `country` or `null`, `quantity`), `master_data_missing`
        (`gtin`, `fields`), `negative_quantity` (`gtin`, `column`, `amount`), `invalid_posting`
        (`count`).
      properties:
        code: { type: string, enum: [gtin_not_registered, foreign_not_reportable, master_data_missing, negative_quantity, invalid_posting] }
        gtin: { type: string }
        country: { type: [string, "null"], description: "ISO 3166 alpha-2; `null` for an extra quantity without a country." }
        quantity: { type: integer }
        fields: { type: array, items: { type: string }, description: Names of the missing master data fields. }
        count: { type: integer }
        column: { type: string, enum: [domestic, foreign] }
        amount: { type: integer }
    EwpExtraQuantityInput:
      type: object
      required: [gtin, domestic, foreign, reason]
      properties:
        gtin: { type: string, description: "A valid GTIN." }
        domestic: { type: integer, minimum: -1000000, maximum: 1000000, description: "Pieces in Austria; negative for returns." }
        foreign: { type: integer, minimum: -1000000, maximum: 1000000 }
        reason: { $ref: '#/components/schemas/EwpReason' }
        text: { type: [string, "null"], maxLength: 200 }
    EwpExtraQuantity:
      allOf:
        - $ref: '#/components/schemas/EwpExtraQuantityInput'
        - type: object
          required: [at, by]
          properties:
            at: { type: integer, description: "Time of the entry in milliseconds since 1970 (UTC)." }
            by: { type: [string, "null"], description: "`api` for an API key, the id of the login for the customer area, `null` on old entries." }
    EwpReport:
      type: object
      required: [month, dueDate, provisional, test, lines, warnings, extraQuantities, downloadedAt]
      properties:
        month: { type: string, example: "2026-11" }
        dueDate: { type: string, format: date, description: "The 5th of the following month." }
        provisional: { type: boolean, description: The month is still running. }
        test: { type: boolean, description: The report comes from the test environment (`kr_test_` key). }
        lines: { type: array, items: { $ref: '#/components/schemas/EwpLine' } }
        warnings: { type: array, items: { $ref: '#/components/schemas/EwpWarning' } }
        extraQuantities: { type: array, items: { $ref: '#/components/schemas/EwpExtraQuantity' } }
        downloadedAt: { type: [integer, "null"], description: "Milliseconds since 1970 (UTC) of the last CSV call of a closed month, else `null`." }
    ArticleDeposits:
      type: [array, "null"]
      maxItems: 5
      description: |
        Deposit rule of an article (`autoDeposits` on `createReceipt` derives the deposit lines from
        it). `null` (or not given on create): the article inherits the rule of its article group
        (kept in the customer area). `[]`: no deposit. Each deposit type at most once per list.
        Needs deposit switched on for the account and known deposit types (`listDepositTypes`),
        otherwise `validation` with the field `deposits`.
      items:
        type: object
        required: [depositTypeId, quantity]
        properties:
          depositTypeId: { type: string, description: "`id` from `listDepositTypes`." }
          quantity: { type: integer, minimum: 1, maximum: 100, description: "Deposit pieces per unit of the article." }
          gtin: { type: string, description: "Barcode (GTIN) of the single container, e.g. the can inside a tray." }
          ownFilling: { type: boolean, description: "Filled by the business itself (needs `gtin` and the filler role)." }
    Article:
      type: object
      description: |
        An article as the inventory API shows it. Quantities (`minStock`,
        `minStockByLocation`) in thousandths of the base unit. `externalIds`, `metadata`,
        `variantGroupId` and `variantAttributes` are only present when set. `purchasePriceMicros` only with purchase values enabled
        for the account, never in webhook payloads.
      properties:
        id: { type: string }
        name: { type: [string, "null"] }
        description: { type: [string, "null"], description: Free text of the article. }
        deposits: { $ref: '#/components/schemas/ArticleDeposits', description: "Deposit rule; only present when set (`null`/absent: like the article group)." }
        unitPriceCents: { type: [integer, "null"], description: Selling price per base unit in cents. }
        vatRate: { type: [number, "null"], description: "VAT rate in percent, e.g. `20`, `10`, `13`, `0`." }
        unit: { type: [string, "null"], description: "Base unit as entered, e.g. `Stk`, `kg`." }
        number: { type: [string, "null"], description: Article number. }
        ean: { type: [string, "null"], description: EAN/GTIN with a valid check digit. }
        internalCode: { type: [string, "null"] }
        groupId: { type: [string, "null"], description: Article group. }
        revenueGroupId: { type: [string, "null"], description: Revenue group (accounting). }
        stockTracked: { type: boolean, description: Whether stock is kept for the article. }
        stockKind: { type: string, enum: [quantity, serial], description: "`serial`: single items with a serial number each." }
        stockLocationIds: { type: array, items: { type: string }, description: Locations the article is kept at. }
        minStock: { type: [integer, "null"], description: "**Legacy field.** Minimum stock of the article in thousandths, as entered. Warnings, `belowMinimum` and `stock.below_minimum` use `minStockByLocation`, never this value." }
        minStockByLocation: { type: object, additionalProperties: { type: integer }, description: "Minimum stock per location in thousandths, e.g. `{ \"haupt\": 5000 }` (`{}` when none is set): the threshold of the warning `below_minimum`, of `listStock` with `belowMinimum` and of `stock.below_minimum`, measured on `available`." }
        active: { type: boolean, description: "`false` after deactivation; receipts and invoices with the article stay possible." }
        variantGroupId: { type: string, description: "Only on variants: the variant group (`getVariantGroup`). Set by `createVariantGroup` and `addVariant`, never changed." }
        variantAttributes: { type: object, additionalProperties: { type: string }, description: "Only on variants: one value per attribute of the group, e.g. `{ \"farbe\": \"rot\", \"groesse\": \"M\" }`. Keys are always sorted alphabetically; the order of the attributes is `attributes` of the group." }
        externalIds: { type: object, maxProperties: 10, propertyNames: { pattern: '^[a-z0-9_]{1,32}$' }, additionalProperties: { type: string, maxLength: 128 }, description: "IDs of the article in other systems, e.g. `{ \"shop\": \"4711\" }`; found by `lookupArticleByCode`." }
        metadata: { type: object, maxProperties: 20, propertyNames: { pattern: '^[a-zA-Z0-9_]{1,40}$' }, additionalProperties: { type: string, maxLength: 500 }, description: Your own data; never evaluated. }
        createdAt: { type: [string, "null"], format: date-time }
        updatedAt: { type: [string, "null"], format: date-time, description: Last change; the sort key of `listArticles`. }
        purchasePriceMicros: { type: [integer, "null"], description: "Only with purchase values enabled: purchase price per base unit in micro-euros (replacement price, else the last, else the standard purchase price)." }
    StockLevel:
      type: object
      description: The stock of one article at one location. All quantities in thousandths of the base unit.
      properties:
        articleId: { type: string }
        locationId: { type: string }
        onHand: { type: integer, description: Sellable stock on hand. }
        reserved: { type: integer, description: "Held by active reservations (`createReservation`)." }
        available: { type: integer, description: "`onHand − reserved`; can be negative." }
        defective: { type: integer, description: "Defective stock, not sellable." }
        sequence: { type: integer, description: Grows with every write of this stock level; compare it to order events and reads. }
        updatedAt: { type: [string, "null"], format: date-time, description: Last change. }
    StockValue:
      type: object
      description: Only with purchase values enabled. Value of the whole stock of an article over all locations.
      properties:
        articleId: { type: string }
        stockValueCents: { type: integer }
        averageCostMicros: { type: [integer, "null"], description: Average purchase price per base unit in micro-euros. }
    StockMovementType:
      type: string
      enum: [sale, goods_receipt, loss, return, transfer_out, transfer_in, condition_out, condition_in, stocktake, adjustment, takeover, reversal, revaluation, method_change, reservation]
      description: "`goods_receipt` is a goods receipt; `takeover` the opening stock taken over (also by an import); `revaluation` and `method_change` change the value only; `reservation` changes only the reserved quantity (`reservedDelta`). `receipt` is never a movement type: it is the source of a sale at the cash register."
    StockMovementSource:
      type: string
      enum: [receipt, invoice, cancellation, credit_note, panel, register, api, stocktake, system]
      description: "What caused the movement: a receipt (sale at the cash register), an invoice, a cancellation, a credit note, the panel, the cash register, the API, a stocktake or the system."
    StockMovement:
      type: object
      description: |
        One line of the stock ledger. Quantities in thousandths. `valueCents`,
        `valueDeltaCents` and `consumedValueCents` only with purchase values enabled.
      properties:
        id: { type: string }
        type: { $ref: '#/components/schemas/StockMovementType' }
        articleId: { type: string }
        locationId: { type: string }
        condition: { type: [string, "null"], enum: [sellable, defective, null] }
        quantityDelta: { type: [integer, "null"], description: "Change of the quantity, signed; `0` for `reservation`." }
        reservedDelta: { type: integer, description: "Change of the reserved quantity, signed: positive when reserving, negative when released, expired or redeemed; `0` for all other movements." }
        stockAfter:
          type: [object, "null"]
          properties:
            sellable: { type: integer }
            defective: { type: integer }
            reserved: { type: [integer, "null"], description: "Reserved quantity after a `reservation` movement; `null` on all other movements (not recorded there)." }
        operationId: { type: [string, "null"], description: All movements of one booking share it. }
        source:
          type: [object, "null"]
          properties:
            type: { $ref: '#/components/schemas/StockMovementSource' }
            id: { type: [string, "null"], description: "ID of the receipt, invoice and so on." }
            register: { type: [string, "null"], description: "Cash register, for receipts." }
            position: { type: [integer, "null"], description: Line of the receipt or invoice. }
        viennaDay: { type: [string, "null"], format: date, description: "Calendar day in Vienna, `YYYY-MM-DD`." }
        time: { type: [string, "null"], format: date-time }
        lots:
          type: array
          items:
            type: object
            properties:
              lotId: { type: [string, "null"] }
              quantity: { type: [integer, "null"] }
              expiresOn: { type: [string, "null"], format: date }
              batch: { type: [string, "null"] }
              serialNumber: { type: [string, "null"] }
              receivedAt: { type: [string, "null"], format: date-time }
              valueCents: { type: [integer, "null"], description: Only with purchase values enabled. }
        valueDeltaCents: { type: [integer, "null"], description: Only with purchase values enabled. }
        consumedValueCents: { type: [integer, "null"], description: Only with purchase values enabled. }
    Location:
      type: object
      properties:
        id: { type: string, description: "The main location is `haupt`." }
        name: { type: string }
        type: { type: string, enum: [warehouse, store, vehicle, other] }
        address:
          type: [object, "null"]
          description: "`null` for vehicles."
          properties:
            street: { type: string }
            zip: { type: string }
            city: { type: string }
            country: { type: string, description: ISO 3166-1 alpha-2. }
        licensePlate: { type: [string, "null"], description: Only for vehicles. }
        active: { type: boolean }
        virtual: { type: boolean, const: true, description: "Only on the main location as long as it was never edited." }
    InventoryWebhookEventType:
      type: string
      enum: [stock.changed, stock.below_minimum, article.created, article.updated, article.deactivated, reservation.expired, reservation.released, reservation.redeemed, variant_group.created, variant_group.updated, receipt.created, receipt.cancelled]
    WebhookDeliveryStatus:
      type: string
      enum: [pending, delivered, failed, dropped]
      description: "`dropped`: the webhook was deactivated or deleted before the delivery was due."
    InventoryWebhook:
      type: object
      description: A webhook of the account (inventory events). Never contains the secret.
      properties:
        id: { type: string }
        url: { type: string, format: uri }
        events: { type: array, items: { $ref: '#/components/schemas/InventoryWebhookEventType' } }
        active: { type: boolean }
        description: { type: [string, "null"] }
        createdAt: { type: [string, "null"], format: date-time }
        lastDelivery:
          type: [object, "null"]
          properties:
            at: { type: [string, "null"], format: date-time }
            status: { $ref: '#/components/schemas/WebhookDeliveryStatus' }
            statusCode: { type: [integer, "null"] }
        consecutiveFailures: { type: integer, description: Failed deliveries in a row (as on partner webhooks). }
    InventoryWebhookDelivery:
      type: object
      properties:
        deliveryId: { type: string, description: "ID of the delivery (header `X-Kasseneck-Delivery`), as on partner webhooks." }
        webhookId: { type: [string, "null"] }
        event: { $ref: '#/components/schemas/InventoryWebhookEventType' }
        eventId: { type: [string, "null"] }
        status: { $ref: '#/components/schemas/WebhookDeliveryStatus' }
        attempts: { type: integer }
        statusCode: { type: [integer, "null"] }
        response: { type: [string, "null"], description: The first 500 characters of your answer. }
        error: { type: [string, "null"], description: "German text, e.g. for a timeout." }
        createdAt: { type: [string, "null"], format: date-time }
        lastAttemptAt: { type: [string, "null"], format: date-time }
        nextAttemptAt: { type: [string, "null"], format: date-time }
        test: { type: boolean, description: Test delivery from `sendWebhookTest`. }
    InventoryWebhookEvent:
      type: object
      description: |
        Envelope of every inventory webhook delivery (POST, JSON). Headers
        `X-Kasseneck-Event`, `X-Kasseneck-Delivery`, `X-Kasseneck-Signature`,
        `User-Agent: Kasseneck-Webhooks/1`; signature as described in the tag *Inventory*.
      required: [id, type, createdAt, accountId, data]
      properties:
        id: { type: string, example: "evt_…", description: "ID of the event, the same on every retry: the basis for detecting duplicates." }
        type: { $ref: '#/components/schemas/InventoryWebhookEventType' }
        createdAt: { type: integer, description: "Unix ms, when the event occurred (not the delivery attempt)." }
        accountId: { type: string, description: The account the event belongs to; the test environment has an ID of its own. }
        test: { type: boolean, const: true, description: "**Test deliveries only.** Real events do not carry the field." }
        data: { type: object }
    ReceiptCreatedData:
      type: object
      required: [receipt]
      properties:
        receipt: { $ref: '#/components/schemas/ListedReceipt' }
        truncated: { type: boolean, const: true, description: "Only when the body would exceed about 700 KiB: `receipt` then comes without `items`." }
        hint: { type: string, description: "Only with `truncated`: fetch the whole receipt with `getReceipt`." }
    ReceiptCancelledData:
      allOf:
        - $ref: '#/components/schemas/ReceiptCreatedData'
        - type: object
          required: [cancellationOf, cancelledItems, refunds]
          properties:
            cancellationOf: { type: [string, "null"], description: "`receiptId` of the cancelled receipt; `null` for the deprecated cancellation without reference." }
            cancelledItems:
              type: array
              items:
                type: object
                properties:
                  index: { type: [integer, "null"], description: "Line in the original; `null` where the cancellation receipt does not know it (the line itself is in `receipt.items`)." }
                  quantity: { type: number }
            refunds:
              type: array
              items:
                type: object
                properties:
                  refundOf: { type: [string, "null"], description: "`id` of the payment in the original; `null` without reference." }
                  amountCents: { type: integer, minimum: 0, description: Always positive; the direction follows from the cancellation. }
                  method: { type: string }
    StockChangedData:
      type: object
      description: The complete stock level now (not a change), plus what caused it. Quantities in thousandths.
      properties:
        articleId: { type: string }
        locationId: { type: string }
        onHand: { type: integer }
        reserved: { type: integer }
        available: { type: integer, description: "`onHand − reserved`; can be negative." }
        defective: { type: integer }
        sequence: { type: integer, description: "Overwrite your state only when this is greater than the stored one." }
        updatedAt: { type: [string, "null"], format: date-time }
        cause: { type: string, enum: [sale, invoice, credit_note, cancellation, goods_receipt, transfer, loss, condition, reversal, reservation, stocktake, takeover, other], description: "The last movement with a quantity; `takeover` is opening stock taken over (also by an import), `other` when no movement explains it." }
        movementId: { type: [string, "null"], description: "ID of that movement (`listStockMovements`); `null` when no movement explains the change (then `cause` is `other`)." }
    StockBelowMinimumData:
      type: object
      properties:
        articleId: { type: string }
        locationId: { type: string }
        available: { type: integer, description: "Available stock (on hand minus reserved) in thousandths." }
        minStock: { type: integer, description: "The minimum stock set for the location (`minStockByLocation`), in thousandths: the threshold that was crossed (measured on `available`)." }
    InventoryIdempotencyKey:
      type: string
      minLength: 1
      maxLength: 120
      description: |
        Required on every writing inventory call (missing: `idempotency_key_required`; longer
        than 120 characters: `validation`, never cut). The same key with the same parameters
        returns the stored answer of the first call, byte for byte, even if the stock changed
        since; the same key with other parameters is `idempotency_conflict`. Keys are separate
        per endpoint and kept for at least 30 days. After a timeout, always repeat with the
        **same** key.
      example: "shop-order-1001"
    ArticleWriteFields:
      type: object
      description: |
        Fields of `createArticle` and `updateArticle`. Quantities in thousandths, prices in
        cents or micro-euros. An unknown field is `validation`. On `updateArticle` only the
        given fields change and `null` clears an optional field; `name`, `unit`, `ean`,
        `stockTracked` and `stockKind` cannot be cleared (`validation`). On `createArticle`
        `null` means "not given".
      properties:
        name: { type: string, minLength: 1, maxLength: 200, description: "Required on create; stored trimmed." }
        description: { type: [string, "null"], maxLength: 2000, description: "Free text, stored trimmed; only spaces count as `null`." }
        unitPriceCents: { type: [integer, "null"], description: Selling price per base unit in cents. }
        vatRate: { type: [number, "null"], enum: [20, 13, 10, 4.9, 0, 19, null], description: VAT rate in percent. }
        unit: { type: string, minLength: 1, maxLength: 20, description: "Base unit as shown, e.g. `Stk`, `kg`; default `Stk`." }
        number: { type: [string, "null"], minLength: 1, maxLength: 64, description: Article number. }
        ean:
          type: string
          pattern: '^[0-9]{8,14}$'
          description: |
            EAN/GTIN with a valid check digit (digits only). With `ean` the article is a
            foreign article and the EAN is its code; without it Kasseneck gives the article
            the next internal code of the account (`internalCode`). A code belongs to one
            active article only (`code_taken` with `data.articleId`, plus `data.field: "ean"` for an EAN). On
            `updateArticle` only an article created with an EAN can get another one.
        groupId: { type: [string, "null"], description: "Article group; must exist (`group_not_found`)." }
        revenueGroupId: { type: [string, "null"], description: "Revenue group (accounting); must exist (`revenue_group_not_found`)." }
        stockTracked: { type: boolean, description: "Whether stock is kept for the article; default `false`. Only stock-tracked articles can be booked and reserved." }
        stockLocationIds: { type: [array, "null"], maxItems: 50, items: { type: string }, description: "Locations the article is kept at; each must exist (`location_not_found`)." }
        minStock:
          type: [integer, "null"]
          minimum: 0
          multipleOf: 1000
          description: |
            **Legacy field without effect on alerts.** Minimum stock of the article in
            thousandths, whole units only (a multiple of 1000). Warnings, `listStock` with
            `belowMinimum` and `stock.below_minimum` use `minStockByLocation` only.
        minStockByLocation:
          type: [object, "null"]
          maxProperties: 50
          additionalProperties: { type: [integer, "null"], minimum: 0 }
          description: |
            Minimum stock per location in thousandths, e.g. `{ "haupt": 20000 }`: **the only
            minimum that drives alerts** (warning `below_minimum`, `listStock` with
            `belowMinimum`, `stock.below_minimum`), measured on `available` (on hand minus
            reserved). Every location with a value must exist (`location_not_found`). On
            `updateArticle` the locations are merged: the given ones are set, a location with
            `null` loses its minimum, the others stay; `minStockByLocation: null` removes all.
        stockKind: { type: string, enum: [quantity, serial], description: "`quantity` (default) or `serial` (single items, each with a serial number). Fixed after the first stock movement (`stock_kind_locked`)." }
        purchasePriceMicros:
          type: [integer, "null"]
          minimum: 0
          description: |
            Standard purchase price per base unit in micro-euros. **Only with
            „Einkaufswerte per API“ enabled for the account**; otherwise the call (also with
            `null`) is `inventory_api_not_enabled` with `data.errors[0].field`
            `purchasePriceMicros`.
        externalIds:
          type: [object, "null"]
          maxProperties: 10
          propertyNames: { pattern: '^[a-z0-9_]{1,32}$' }
          additionalProperties: { type: string, minLength: 1, maxLength: 128 }
          description: |
            IDs of the article in your systems, e.g. `{ "shop": "1001" }`. Each system and
            value belongs to one active article of the account (`external_id_taken` with
            `data.field` `externalIds.<system>` and `data.articleId`); found by
            `lookupArticleByCode`. On `updateArticle` the object is replaced as a whole.
            Deactivating an article frees its IDs.
        metadata:
          type: [object, "null"]
          maxProperties: 20
          propertyNames: { pattern: '^[a-zA-Z0-9_]{1,40}$' }
          additionalProperties: { type: string, maxLength: 500 }
          description: "Your own data, never evaluated: at most 20 keys, text values up to 500 characters, at most 4 KB together. On `updateArticle` replaced as a whole."
        deposits:
          $ref: '#/components/schemas/ArticleDeposits'
    InventoryWarningCode:
      type: string
      description: |
        Notices of a booking or of a stocktake in `warnings[].code`. **Not errors**: the
        booking went through. Messages in `warnings[].message` are German. The last four
        belong to stocktakes: `recount_uncounted` comes in the answer of `closeStocktake`
        (`items` = how many), the other three in `warnings` of the closed stocktake.

        | `code` | When |
        |---|---|
        | `insufficient_stock` | a sale took more than the stock on hand; the stock is negative now (only sales may overdraw, never bookings through this API) |
        | `below_minimum` | after the booking `available` at the location is below its minimum stock (`minStockByLocation`) |
        | `return_exceeds_sale` | a return gives back more than the sale it refers to |
        | `reservation_exceeded` | an invoice line sold more than its reservation held; the sale is booked in full |
        | `defect_capped` | a stocktake found less defective goods than the book; the closing could take off only the defective stock that was there (`notBooked.code: defect_capped` on the item) |
        | `uncounted_items` | items of the stocktake were never counted and not booked (closed without `uncountedAsZero`) |
        | `not_booked` | the closing could not book an item as planned, e.g. a serial number sold or received in the meantime; see `notBooked` on the item and the record |
        | `recount_uncounted` | items ordered for recount were not counted again; the closing does not book them |
      enum: [insufficient_stock, below_minimum, return_exceeds_sale, reservation_exceeded, defect_capped, uncounted_items, not_booked, recount_uncounted]
    InventoryWarning:
      type: object
      properties:
        code: { $ref: '#/components/schemas/InventoryWarningCode' }
        articleId: { type: string }
        locationId: { type: string }
        message: { type: string, description: German text for humans. }
    StockBooking:
      type: object
      description: |
        Answer of every stock booking. A repeat with the same `idempotencyKey` returns the
        same answer. Never carries values; read them with `listStockMovements` (purchase
        values enabled).
      properties:
        operationId: { type: string, description: "ID of the booking; all its movements carry it as `operationId`. Pass it to `reverseStockMovement`." }
        movementIds: { type: array, items: { type: string }, description: The movements written (`listStockMovements`). }
        lotIds: { type: array, items: { type: string }, description: Lots received or moved. }
        warnings: { type: array, items: { $ref: '#/components/schemas/InventoryWarning' } }
    StockBookingItem:
      type: object
      required: [articleId, quantity]
      properties:
        articleId: { type: string }
        quantity: { type: integer, description: "Thousandths of the base unit, greater than 0 (`invalid_quantity`)." }
        serialNumber: { type: string, minLength: 1, maxLength: 128, description: "For articles with `stockKind: serial`: the item (`serial_required`, `serial_not_in_stock`)." }
    ReceiveGoodsPreviewLine:
      type: object
      description: "One line of the preview (`dryRun: true`). `baseCents`, `landedCostCents`, `valueCents` and `unitCostMicros` only with purchase values enabled."
      properties:
        articleId: { type: string }
        quantity: { type: integer }
        expiresOn: { type: [string, "null"], format: date }
        batch: { type: [string, "null"] }
        serialNumbers: { type: array, items: { type: string } }
        priceFromArticle: { type: boolean, description: "No price was sent; the standard purchase price of the article is used." }
        baseCents: { type: integer, description: Value of the goods without landed costs. }
        landedCostCents: { type: integer, description: Share of the landed costs. }
        valueCents: { type: integer, description: Value the line adds to the stock. }
        unitCostMicros: { type: integer, description: Purchase price per base unit in micro-euros. }
    ReservationStatus:
      type: string
      enum: [active, redeemed, released, expired]
      description: |
        `active` while anything is open. Final states: `redeemed` (the last open quantity was
        sold by an invoice), `released` (by `releaseReservation`) or `expired` (by the
        expiry). The action that closes the last open quantity decides the final state.
    Reservation:
      type: object
      description: |
        A reservation holds stock for an order: `reserved` grows and `available` shrinks at
        each location until it is redeemed, released or expires. Quantities in thousandths;
        open per line = `quantity − redeemed − released`.
      properties:
        id: { type: string }
        status: { $ref: '#/components/schemas/ReservationStatus' }
        reference: { type: [string, "null"], description: "Your order number or the like; filter with `listReservations`." }
        items:
          type: array
          description: One line per article and location (lines of the request with the same article and location are added up).
          items:
            type: object
            properties:
              articleId: { type: string }
              locationId: { type: string }
              quantity: { type: integer, description: Reserved quantity. }
              redeemed: { type: integer, description: Sold by invoices. }
              released: { type: integer, description: "Given back to `available` (release or expiry)." }
        expiresAt: { type: string, format: date-time, description: "When the open quantity is released if nothing happened before (`extendReservation` moves it)." }
        createdAt: { type: string, format: date-time }
    VariantAttribute:
      type: object
      required: [key, label, values]
      additionalProperties: false
      description: One attribute of a variant group, e.g. size or colour.
      properties:
        key: { type: string, pattern: '^[a-z0-9_]{1,32}$', description: "Key in `variantAttributes`; unique in the group; keys of the form `__…__` are reserved.", example: groesse }
        label: { type: string, minLength: 1, maxLength: 40, description: Name shown to people., example: "Größe" }
        values:
          type: array
          minItems: 1
          maxItems: 30
          items: { type: string, minLength: 1, maxLength: 30 }
          description: "Allowed values in the order they are shown; trimmed, unique ignoring case. Values can be added (`addAttributeValues`), never removed."
          example: [S, M, L]
    VariantGroupDefaults:
      type: object
      additionalProperties: false
      description: |
        Fields every new variant gets unless it sends them itself; same rules as in
        `createArticle`. Only applied when a variant is created. Never purchase prices.
      properties:
        unitPriceCents: { type: [integer, "null"] }
        vatRate: { type: [number, "null"], enum: [20, 13, 10, 4.9, 0, 19, null] }
        unit: { type: [string, "null"], maxLength: 20 }
        groupId: { type: [string, "null"], description: "Article group; must exist (`group_not_found` with `data.field` `defaults.groupId`)." }
        stockTracked: { type: [boolean, "null"], description: "`true` makes the variants stock-tracked (bookable and reservable); default `false` as in `createArticle`." }
    VariantGroup:
      type: object
      description: |
        A variant group as the inventory API shows it (also the payload of
        `variant_group.*`). Its variants are ordinary articles with `variantGroupId`.
      properties:
        id: { type: string }
        name: { type: string, minLength: 1, maxLength: 100, description: "Also the start of the default name of every variant." }
        attributes: { type: array, minItems: 1, maxItems: 3, items: { $ref: '#/components/schemas/VariantAttribute' }, description: The attributes in their order. }
        defaults: { $ref: '#/components/schemas/VariantGroupDefaults' }
        active: { type: boolean, description: "`false` after `updateVariantGroup { active: false }`; final." }
        variants:
          type: array
          maxItems: 250
          description: "The active variants of an active group, in the order they were created. When the group is deactivated, the list stays as it was."
          items:
            type: object
            properties:
              articleId: { type: string }
              variantAttributes: { type: object, additionalProperties: { type: string }, description: Keys sorted alphabetically. }
        createdAt: { type: [string, "null"], format: date-time }
        updatedAt: { type: [string, "null"], format: date-time, description: "Last visible change; the sort key of `listVariantGroups` and the order of `variant_group.updated`." }
    CreateVariantGroupRequest:
      type: object
      required: [name, attributes]
      description: "Parameters of `createVariantGroup` besides `idempotencyKey`. `createMatrix: true` or `variants`, not both."
      properties:
        name: { type: string, minLength: 1, maxLength: 100 }
        attributes: { type: array, minItems: 1, maxItems: 3, items: { $ref: '#/components/schemas/VariantAttribute' } }
        defaults: { $ref: '#/components/schemas/VariantGroupDefaults' }
        createMatrix: { type: boolean, description: "Create every combination of the values (at most 100)." }
        variants:
          type: array
          maxItems: 100
          description: "Only these combinations. Each entry: `variantAttributes` plus the fields of `createArticle` (`name` optional)."
          items:
            allOf:
              - type: object
                required: [variantAttributes]
                properties:
                  variantAttributes: { type: object, additionalProperties: { type: string }, description: "Every attribute of the group exactly once, with a value from its list." }
              - $ref: '#/components/schemas/ArticleWriteFields'
    UpdateVariantGroupRequest:
      type: object
      required: [variantGroupId]
      description: "Parameters of `updateVariantGroup` besides `idempotencyKey`: any of `name`, `defaults`, `addAttributeValues`, or `active: false` alone."
      properties:
        variantGroupId: { type: string }
        name: { type: string, minLength: 1, maxLength: 100 }
        defaults:
          oneOf:
            - $ref: '#/components/schemas/VariantGroupDefaults'
            - type: "null"
          description: "Merged per field; `null` for a field clears it, `defaults: null` clears all."
        addAttributeValues:
          type: object
          additionalProperties: { type: array, items: { type: string, minLength: 1, maxLength: 30 } }
          description: "New values per attribute key, e.g. `{ \"groesse\": [\"XL\"] }`; existing ones are skipped silently."
        active: { type: boolean, const: false, description: Deactivates the group and all its variants. }
    AddVariantRequest:
      description: "Parameters of `addVariant` besides `idempotencyKey`: `variantGroupId`, `variantAttributes` and the fields of `createArticle` (`name` optional)."
      allOf:
        - type: object
          required: [variantGroupId, variantAttributes]
          properties:
            variantGroupId: { type: string }
            variantAttributes: { type: object, additionalProperties: { type: string }, description: "Every attribute of the group exactly once, with a value from its list." }
        - $ref: '#/components/schemas/ArticleWriteFields'
    StocktakeStatus:
      type: string
      enum: [creating, counting, review, closing, closed, cancelled]
      description: |
        `creating` only while the items are written (seconds); `counting` until
        `reviewStocktake`; `review` with expected quantities and recounts; `closing` while the
        differences are booked in the background; `closed` and `cancelled` are final.
    StocktakeActor:
      type: object
      description: "Who acted. With `type: api` the account; the key itself is never shown."
      properties:
        type: { type: string, enum: [owner, admin, register_user, api] }
        id: { type: string }
        name: { type: [string, "null"] }
    Stocktake:
      type: object
      description: |
        Head of a stocktake. Never carries an expected quantity or a difference before
        `review`. The result of the closing (`totals`, `warnings`, `seal`, `checksum`,
        `inventoryAsOf`, `pdf`) appears once it is written; value sums
        (`differenceValueCents`, `inventoryValueCents`, `pdf.valuesSha256`) only with
        purchase values enabled.
      properties:
        id: { type: string }
        name: { type: string, description: "1–100 characters; default „Inventur <location> <day>“." }
        locationId: { type: string }
        scope:
          type: object
          properties:
            type: { type: string, enum: [all, groups, articles] }
            groupIds: { type: array, items: { type: string } }
            articleIds: { type: array, items: { type: string } }
        type: { type: string, enum: [key_date, perpetual] }
        keyDate: { type: [string, "null"], format: date, description: "Balance sheet date with `key_date`, else `null`." }
        blind: { type: boolean, description: "Counters see no stock figure while counting (default)." }
        status: { $ref: '#/components/schemas/StocktakeStatus' }
        progress:
          type: object
          properties:
            items: { type: integer, description: Items in the scope (also those added later). }
            counted: { type: integer, description: "Only in `getStocktake`: items with at least one active count." }
            recountOpen: { type: boolean, description: "A recount is ordered and `reviewStocktake` has not run since." }
        createdAt: { type: string, format: date-time }
        createdBy: { $ref: '#/components/schemas/StocktakeActor' }
        source: { type: string, enum: [register, panel, api] }
        updatedAt: { type: string, format: date-time, description: "Every change of the head (not every count)." }
        review:
          type: [object, "null"]
          properties:
            startedAt: { type: string, format: date-time }
            startedBy: { $ref: '#/components/schemas/StocktakeActor' }
            complete: { type: boolean, description: "`false` while the background computation runs." }
            expectedAsOf: { type: string, format: date-time, description: When the expected quantities were computed. }
            recountUncounted: { type: integer, description: "Items ordered for recount that were not counted again; the closing does not book them." }
        closing:
          type: [object, "null"]
          properties:
            startedAt: { type: string, format: date-time }
            startedBy: { $ref: '#/components/schemas/StocktakeActor' }
            uncountedAsZero: { type: boolean }
            parts: { type: [integer, "null"], description: "Parts of the booking; `null` until the plan is fixed." }
            bookedParts: { type: integer, description: Parts booked so far. }
            completedAt: { type: string, format: date-time }
        totals:
          type: object
          description: Counts of items, never sums of quantities (units differ).
          properties:
            items: { type: integer }
            counted: { type: integer }
            uncounted: { type: integer }
            recounted: { type: integer }
            withDifference: { type: integer }
            needsCheck: { type: integer }
            notBooked: { type: integer }
            differenceValueCents: { type: integer, description: Only with purchase values enabled. }
            inventoryValueCents: { type: integer, description: Only with purchase values enabled. }
        warnings:
          type: array
          description: "Notices of the closing: `defect_capped`, `not_booked`, `uncounted_items`; `items` = how many items."
          items: { $ref: '#/components/schemas/StocktakeWarning' }
        seal:
          type: [object, "null"]
          description: "Seal status of the stock ledger, checked from the closing day of the previous stocktake (or the first seal), at most 400 days, up to yesterday."
          properties:
            fromDay: { type: [string, "null"], format: date }
            toDay: { type: string, format: date }
            daysChecked: { type: integer }
            verified: { type: [boolean, "null"], description: "`true` sealed and unchanged, `false` broken or gaps, `null` not checked to the end (never read it as a break)." }
            firstBreak: { type: [string, "null"], format: date }
            gaps: { type: array, items: { type: string, format: date } }
            gapCount: { type: integer }
            notChecked: { type: string, enum: [time_limit, unavailable] }
            checkedUntil: { type: string, format: date }
        checksum: { type: string, description: "SHA-256 (hex) over the canonical JSON of head, items and counts; also printed in the record." }
        inventoryAsOf: { type: string, enum: [key_date, count_date], description: "`key_date`: quantities carried to the end of the key date (closed after it); `count_date`: quantities at the count." }
        pdf:
          type: object
          properties:
            available: { type: boolean }
            valuesSha256: { type: string, description: Only with purchase values enabled. }
            quantitiesSha256: { type: string }
        cancellation:
          type: [object, "null"]
          properties:
            reason: { type: string }
            cancelledAt: { type: string, format: date-time }
            cancelledBy: { $ref: '#/components/schemas/StocktakeActor' }
    StocktakeItem:
      type: object
      description: |
        One item: an article in one condition at the location of the stocktake. Quantities in
        thousandths. The fields from `expectedQuantity` on exist only from `review` on;
        `bookedQuantity`, `notBooked` and `inventory` after the closing; values only with
        purchase values enabled.
      properties:
        articleId: { type: string }
        condition: { type: string, enum: [sellable, defective] }
        name: { type: [string, "null"], description: Name when the stocktake was created. }
        number: { type: [string, "null"] }
        unit: { type: [string, "null"] }
        round: { type: integer, description: "1, plus one per recount." }
        counted: { type: boolean }
        quantity: { type: [integer, "null"], description: "Sum of the active counts of the round; `null` = not counted, `0` = counted empty." }
        counts: { type: integer, description: Active counts of the round. }
        firstCountedAt: { type: [string, "null"], format: date-time }
        referenceTime: { type: [string, "null"], format: date-time, description: "Server time of the last active count of the round (see *Reference time*)." }
        countedBy: { type: array, items: { $ref: '#/components/schemas/StocktakeActor' }, description: "Every counter once, at most 20." }
        serialNumbers: { type: array, items: { type: string }, description: "`stockKind: serial`: the numbers counted in the round (not in the answer of `recordStocktakeCount`)." }
        recountRequested: { type: boolean }
        recount:
          type: object
          description: The last recount order.
          properties:
            reason: { type: string }
            requestedAt: { type: string, format: date-time }
            requestedBy: { $ref: '#/components/schemas/StocktakeActor' }
            round: { type: integer }
        addedLater: { type: boolean, description: "Not on the frozen list; added by a count (`scope.type: all`)." }
        bookStockNow: { type: integer, description: "Only with `blind: false` while `counting`: today's book stock, never the expected quantity." }
        expectedQuantity: { type: [integer, "null"], description: "Book stock at the reference time, late bookings included." }
        differenceQuantity: { type: [integer, "null"], description: "`quantity − expectedQuantity`; `null` when not counted." }
        needsCheck: { type: boolean }
        checkReasons:
          type: array
          items: { type: string, enum: [movements_between_counts, far_from_key_date, serial_mismatch, not_counted] }
          description: "`movements_between_counts`: stock moved between the first and the last count; `far_from_key_date`: a count lies more than 10 days from the key date; `serial_mismatch`: counted and expected serial numbers differ; `not_counted`."
        expectedAsOf: { type: [string, "null"], format: date-time }
        differenceValueCents: { type: [integer, "null"], description: "Expected value of the difference in `review`, the booked value after the closing; only with purchase values enabled." }
        missingSerialNumbers: { type: array, items: { type: string }, description: "Expected serial numbers not counted (still at the location)." }
        extraSerialNumbers: { type: array, items: { type: string }, description: "Counted serial numbers that are nowhere in stock." }
        bookedQuantity: { type: [integer, "null"], description: "What the closing booked, signed." }
        notBooked:
          type: [object, "null"]
          description: "What the closing could not book: `code` (`serial_mismatch`, `recount_open`, `defect_capped`, `serial_not_in_stock`, `serial_already_exists`, `article_not_found`, …), `quantity` (signed, `null` with `recount_open`), with several reasons `reasons[]`."
          properties:
            code: { type: string }
            quantity: { type: [integer, "null"] }
            reasons: { type: array, items: { type: object, properties: { code: { type: string }, quantity: { type: [integer, "null"] } } } }
        inventory:
          type: [object, "null"]
          description: Line of the inventory list.
          properties:
            quantity: { type: [integer, "null"] }
            unitValueMicros: { type: [integer, "null"], description: "Book value per base unit after the closing; only with purchase values enabled." }
            valueCents: { type: [integer, "null"], description: Only with purchase values enabled. }
            countedOn: { type: [string, "null"], format: date, description: "Day of the count in Vienna." }
    StocktakeCount:
      type: object
      description: One count. Voided counts stay, with `voided`.
      properties:
        id: { type: string }
        articleId: { type: string }
        condition: { type: string, enum: [sellable, defective] }
        quantity: { type: integer }
        serialNumbers: { type: array, items: { type: string } }
        round: { type: integer }
        countedBy: { $ref: '#/components/schemas/StocktakeActor' }
        source: { type: [string, "null"], enum: [register, panel, api, null] }
        cashregisterId: { type: [string, "null"] }
        countedAt: { type: string, format: date-time, description: Server time. }
        note: { type: [string, "null"] }
        voided:
          type: [object, "null"]
          properties:
            reason: { type: string }
            voidedAt: { type: string, format: date-time }
            voidedBy: { $ref: '#/components/schemas/StocktakeActor' }
    StocktakeWarning:
      type: object
      properties:
        code: { $ref: '#/components/schemas/InventoryWarningCode' }
        items: { type: integer, description: Number of items concerned. }
        message: { type: string, description: "German text for humans (only in the answer of `closeStocktake`)." }
    StocktakePdfDownload:
      type: object
      description: "Answer of `getStocktakePdf` above 9 MiB."
      properties:
        url: { type: string, format: uri, description: "Signed read link, valid for 15 minutes; plain `GET`, no API key." }
        expiresAt: { type: string, format: date-time }
        sizeBytes: { type: integer }
        sha256: { type: string }
        fileName: { type: string }
        contentType: { type: string, enum: [application/pdf] }
    CreateStocktakeRequest:
      type: object
      description: "Parameters of `createStocktake` besides `idempotencyKey`."
      required: [locationId, scope, type]
      properties:
        name: { type: string, minLength: 1, maxLength: 100 }
        locationId: { type: string }
        scope:
          type: object
          required: [type]
          additionalProperties: false
          properties:
            type: { type: string, enum: [all, groups, articles] }
            groupIds: { type: array, minItems: 1, maxItems: 50, items: { type: string }, description: "Only with `groups`." }
            articleIds: { type: array, minItems: 1, maxItems: 5000, items: { type: string }, description: "Only with `articles`." }
        type: { type: string, enum: [key_date, perpetual] }
        keyDate: { type: [string, "null"], format: date, description: "Required with `key_date`, not allowed with `perpetual`." }
        blind: { type: boolean, default: true }
    RecordStocktakeCountRequest:
      type: object
      description: "Parameters of `recordStocktakeCount` besides `idempotencyKey`."
      required: [stocktakeId, articleId, quantity]
      properties:
        stocktakeId: { type: string }
        articleId: { type: string }
        condition: { type: string, enum: [sellable, defective], default: sellable }
        quantity: { type: integer, minimum: 0, description: "Thousandths; `0` = counted empty." }
        serialNumbers: { type: array, maxItems: 200, items: { type: string }, description: "`stockKind: serial`: one unique number per piece, no slash." }
        note: { type: string, maxLength: 200 }
    RecountStocktakeRequest:
      type: object
      description: "Parameters of `recountStocktake` besides `idempotencyKey`."
      required: [stocktakeId, items, reason]
      properties:
        stocktakeId: { type: string }
        items:
          type: array
          minItems: 1
          maxItems: 200
          items:
            type: object
            required: [articleId]
            additionalProperties: false
            properties:
              articleId: { type: string }
              condition: { type: string, enum: [sellable, defective], default: sellable }
        reason: { type: string, minLength: 1, maxLength: 500 }
    TerminalEnvelope:
      type: object
      description: Envelope of the card terminal endpoints (tag *Card terminals*).
      properties:
        status: { type: string, enum: [success, error] }
        message: { type: string, description: German text for humans. }
        code: { $ref: '#/components/schemas/TerminalErrorCode' }
        data: { type: object }
    TerminalErrorCode:
      type: string
      description: |
        Codes of the card terminal endpoints, in `code` and `data.code` (HTTP 200, `status: "error"`). Same as the list
        `genius` in `/fehlercodes.json`. Codes of the sign-in (`CommonErrorCode`) come on top.

        | `code` | When |
        |---|---|
        | `terminal_not_enabled` | Kasseneck has not set up Genius Pay for the business (no active TID) |
        | `terminal_test_environment` | the call came with a `kr_test_…` key; card terminals exist only live |
        | `terminal_device_unknown` | `deviceId` unknown or `deviceSecret` wrong (the same answer for both); register again |
        | `terminal_device_blocked` | Kasseneck has blocked this device |
        | `invalid_terminal_device` | a parameter is missing, of the wrong type or out of range (`deviceId`, `label`, `platform`, `app`, …) |
        | `too_many_terminal_devices` | the business has reached its number of devices, or 10 registrations today |
        | `terminal_not_in_business` | `claimTerminal`: the TID does not exist, is inactive or belongs to another business |
        | `terminal_code_manual` | `requestTerminalCode`: no automatic code for this account; the driver types the code |
        | `terminal_code_rate_limited` | `requestTerminalCode`: more than 6 requests of this device within an hour |
        | `terminal_not_assigned` | the device holds no TID; call `getTerminalAccess` first |
        | `terminal_fixed` | `claimTerminal`: the TID is fixed to another device |
        | `terminal_device_fixed` | `claimTerminal`: a TID is fixed to this device; move only with `fixed: true` |
        | `server_error` | something failed on our side; try again |
      enum: [terminal_not_enabled, terminal_test_environment, terminal_device_unknown, terminal_device_blocked, invalid_terminal_device, too_many_terminal_devices, terminal_not_in_business, terminal_code_manual, terminal_code_rate_limited, terminal_not_assigned, terminal_fixed, terminal_device_fixed, server_error]
    TerminalSetup:
      type: object
      description: Set-up state of Genius Pay on this device.
      properties:
        state: { type: string, enum: [assigned, waiting_for_code, setting_up, ready, failed], description: "`assigned`: TID handed out; `waiting_for_code`: code requested; `setting_up`: first sign-in done; `ready`: `reportTerminalReady`; `failed`: the last sign-in failed." }
        since: { type: [string, "null"], format: date-time }
    TerminalCodeStatus:
      type: string
      enum: [none, searching, found, delivered, unclear, no_code, expired]
      description: "`none`: no request; `searching`: Kasseneck is looking for the code in the mailbox; `found`: the code is in this answer; `delivered`: already handed out; `unclear`: one mail fitted several open requests, none got the code (the Kasseneck support may still set it, keep polling or let the driver type it); `no_code`: no code within 9 minutes; `expired`: the code (valid 20 minutes from the mail) or the request is no longer valid."
    TerminalAccess:
      type: object
      description: "Genius Pay login of the TID this device holds. `password` is a secret: never show or log it."
      properties:
        available: { type: boolean, enum: [true] }
        username: { type: string }
        password: { type: string }
        terminalId: { type: string, description: TID (terminal ID). }
        terminalName: { type: [string, "null"] }
        accountId: { type: string, description: Genius Pay account of the TID. }
        autoCode: { type: boolean, description: "Kasseneck can fetch the one-time code (`requestTerminalCode`)." }
        codeFormat:
          type: object
          description: Shape of the one-time code, for checking a pasted code.
          properties:
            length: { type: integer, description: "Number of characters (currently 6)." }
            labels: { type: array, items: { type: string }, description: "Words that stand before the code in the mail of Genius Pay, e.g. `Autorisierungscode`; a pasted mail text holds the code after one of them and a colon." }
        setup: { $ref: '#/components/schemas/TerminalSetup' }
        updatedAt: { type: [string, "null"], format: date-time, description: Last change of the login. }
        fixed: { type: boolean, description: "The TID is fixed to this device." }
        terminals: { type: array, items: { $ref: '#/components/schemas/TerminalListEntry' }, description: "TIDs of your own business, as seen from this device." }
    TerminalUnavailable:
      type: object
      description: "No free TID. The TIDs of your own business with the device that used them last; take one over with `claimTerminal`."
      properties:
        available: { type: boolean, enum: [false] }
        reason: { type: string, enum: [no_free_terminal] }
        terminals: { type: array, items: { $ref: '#/components/schemas/TerminalListEntry' } }
    TerminalListEntry:
      type: object
      description: "A TID of your own business, as seen from the calling device. Only active TIDs that can be handed out; never TIDs of other businesses, never logins."
      properties:
        terminalId: { type: string }
        name: { type: [string, "null"] }
        state: { type: string, enum: [this_device, free, in_use], description: "`this_device`: this device holds it; `free`: `getTerminalAccess` could hand it to this device (no device, or its device has been away for 7 days, no card payment on it in the receipts for 7 days, and not fixed to another device); `in_use`: another device holds it, a receipt had a card payment on it in the last 7 days, or it is fixed to another device." }
        lastUsedBy: { type: [string, "null"], description: "`label` of the device that used the TID last, or the name of the cash register whose receipt had the last card payment on it, whichever is newer." }
        lastUsedAt: { type: [string, "null"], format: date-time }
        fixed: { type: boolean, description: "The TID is fixed to a device (this one or another)." }
