bimetricsEntwickler
Ausgangsrechnungen

Ausgangsrechnung vollständig stornieren

Als Markdown ansehen

Benötigte Berechtigung:invoices:finalize(Ausgangsrechnungen erstellen und stornieren)

Echte Wirkung

Ändert Daten der Firma; wird atomar mit Idempotenzbeleg und Herkunft protokolliert.
post/api/draft/{id}/cancel

Kein Testversand aus der Dokumentation: Dieser Aufruf ist nicht als rein lesend gekennzeichnet. Nutze das Codebeispiel.

Erstellt einen Vollstorno vom Typ 384 aus der serverseitigen Originalvorlage. expectedUpdatedAt bezeichnet den Originalentwurf. Keine freie Gutschrift und kein Versand.

Benötigt einen Schlüssel mit der Berechtigung invoices:finalize.

Authentifizierung

AuthentifizierungBearer <token>

Empfohlen: Authorization: Bearer bm_…. Der Schlüssel wird nur einmal angezeigt; nie in URLs, Logs oder Frontend-Code ablegen.

In: header

Pfadparameter

id*string

ID des Objekts in dieser Firma (UUID).

Formatuuid

Header-Parameter

Idempotency-Key*string

Stabiler Schlüssel für genau diese Änderung: 1–128 druckbare ASCII-Zeichen ohne Leerzeichen. Bei Wiederholungen denselben Schlüssel und unveränderten Inhalt senden; das Ergebnis wird nicht nochmals erzeugt.

Muster^[!-~]+$
Länge1 <= length <= 128

Request-Body

application/json

TypeScript-Typen

Typ request body für TypeScript.

Versionsbedingung ohne frei veränderbaren Rechnungsinhalt.

Antworten

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl --fail-with-body "https://app.bimetrics.de/api/draft/497f6eca-6276-4993-bfeb-53cbbbba6f08/cancel" \  -H "Authorization: Bearer $BIMETRICS_API_KEY" \  -H "Idempotency-Key: rechnung-2026-001" \  -H "Content-Type: application/json" \  -d '{}'
{  "document": {    "bookings": [      {        "account": 8400,        "accountContra": 11004,        "accountingModel": "SKR03",        "amount": "-1785",        "bookingDate": {          "day": 1,          "month": 9,          "year": 2026        },        "bookingFlags": "ust19%",        "companyId": "9c388e1f-04a6-4770-80bd-66cd98dd00d5",        "createdAt": "2026-09-12T07:30:19Z",        "deletedAt": null,        "finalized": null,        "id": "743f74e5-29fb-46ba-b919-21e48af483be",        "label": "Brauhaus Elbwiese GmbH, Fassadenbeschriftung Entwurf und Montage",        "performanceFrom": {          "day": 1,          "month": 9,          "year": 2026        },        "performanceTo": {          "day": 1,          "month": 9,          "year": 2026        },        "refBankTransactionId": null,        "refDocumentId": "3026096b-614f-40d3-8749-8acf9b529480",        "refMatch": "e21b3d18-17ea-4318-810c-919ec0a94dcb",        "revertsAccountBookingId": null,        "updatedAt": "2026-09-12T07:30:19Z"      }    ],    "companyId": "9c388e1f-04a6-4770-80bd-66cd98dd00d5",    "contentSource": "auto",    "createdAt": "2026-09-01T09:12:44Z",    "deletedAt": null,    "deliveryDate": null,    "documentContract": null,    "documentContractId": null,    "documentSeries": null,    "documentSeriesId": null,    "dueDate": {      "day": 15,      "month": 9,      "year": 2026    },    "id": "3026096b-614f-40d3-8749-8acf9b529480",    "importOrigin": "upload",    "invoiceDate": {      "day": 1,      "month": 9,      "year": 2026    },    "invoiceNumber": "RE-2026-0142",    "invoicePositions": [      {        "additionalInfo": {          "freeOfVat": false,          "reverseCharge": false        },        "category": "sales_income",        "label": "Fassadenbeschriftung Entwurf und Montage",        "subPositions": null,        "total": 178500,        "vatPercentage": "19"      }    ],    "issuer": {      "address": "Mühlenkamp 31, 22303 Hamburg",      "customerNumber": null,      "iban": "DE89370400440532013000",      "name": "Hansen & Kowalski Werbetechnik GmbH",      "taxId": "DE123456789"    },    "kind": "invoice",    "match": {      "amountOpen": 0,      "autoMatch": true,      "bankTransactions": [        {          "bankTransactionId": "a1ba4b85-5bd8-4cef-bbbd-16eaa2c46033",          "companyId": "9c388e1f-04a6-4770-80bd-66cd98dd00d5",          "createdAt": "2026-09-12T07:30:15Z",          "id": "840529df-2d2a-42ea-afa3-3704d855634f",          "matchId": "e21b3d18-17ea-4318-810c-919ec0a94dcb",          "updatedAt": "2026-09-12T07:30:15Z"        }      ],      "category": "payment",      "companyId": "9c388e1f-04a6-4770-80bd-66cd98dd00d5",      "createdAt": "2026-09-12T07:30:15Z",      "documents": [        {          "companyId": "9c388e1f-04a6-4770-80bd-66cd98dd00d5",          "createdAt": "2026-09-12T07:30:15Z",          "documentId": "3026096b-614f-40d3-8749-8acf9b529480",          "id": "3432135f-5b01-4288-9764-e1ff7d061777",          "matchId": "e21b3d18-17ea-4318-810c-919ec0a94dcb",          "updatedAt": "2026-09-12T07:30:15Z"        }      ],      "id": "e21b3d18-17ea-4318-810c-919ec0a94dcb",      "matchingRule": null,      "matchingRuleId": null,      "updatedAt": "2026-09-12T07:30:15Z"    },    "paymentTerms": "Zahlbar innerhalb von 14 Tagen ohne Abzug.",    "performancePeriodFrom": null,    "performancePeriodTo": null,    "recipient": {      "address": "Am Sandtorkai 12, 20457 Hamburg",      "customerNumber": 1004,      "iban": "DE02120300000000202051",      "name": "Brauhaus Elbwiese GmbH",      "taxId": "DE987654321"    },    "source": "",    "updatedAt": "2026-09-12T07:30:19Z",    "uploadDocument": {      "blob": {        "companyId": "9c388e1f-04a6-4770-80bd-66cd98dd00d5",        "createdAt": "2026-09-01T09:12:44Z",        "id": "cd47afe0-7d1b-4c2a-8f7b-cbd58d92a54a",        "length": 84213,        "mime": "application/pdf",        "originalFilename": "RE-2026-0142.pdf",        "sha256": "1ca20000989555ec85b52711c84520f26bac2604307222e5cd978605783f6bc2",        "updatedAt": "2026-09-01T09:12:44Z"      },      "blobId": "cd47afe0-7d1b-4c2a-8f7b-cbd58d92a54a",      "creatorUserCompanyId": "53cd10a9-c864-4dc3-a777-9860d59efe6c",      "ocrFinishedAt": "2026-09-01T09:13:02Z",      "ocrStartedAt": "2026-09-01T09:12:45Z",      "ocrStatus": "success"    },    "uploadDocumentId": "e0ba087b-4b49-4137-8bb8-555a24619eae",    "version": ""  }}