bimetricsEntwickler
Ausgangsrechnungen

Korrekturentwurf ändern

Als Markdown ansehen

Benötigte Berechtigung:invoices:draft(Rechnungsentwürfe verwalten)

Echte Wirkung

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

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

Die ID bezeichnet den offenen Korrekturentwurf; expectedUpdatedAt dessen aktuelle Version. Ersetzt Grund, Datum und Korrekturbeträge. Optional layoutId für modern oder classic; ohne Angabe bleibt die Layoutwahl des Entwurfs erhalten. Generisches updateDraft nimmt Korrekturen nicht an. Nach PDF-Prüfung stellt finalizeDraft den gespeicherten Entwurf aus und erzeugt Korrekturbuchungen, aber keine Auszahlung.

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

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 dieser Firma (UUID); bei Forderungsständen und neuen Korrekturen die Quellentwurfs-ID.

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.

Quellgebundene Korrektur mit positiven Bruttobeträgen; keine frei veränderbaren Preise, Steuern oder Empfänger.

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/correction" \  -H "Authorization: Bearer $BIMETRICS_API_KEY" \  -H "Idempotency-Key: rechnung-2026-001" \  -H "Content-Type: application/json" \  -d '{}'
{  "companyId": "9c388e1f-04a6-4770-80bd-66cd98dd00d5",  "createdAt": "2026-09-01T08:00:00Z",  "creatorUserCompanyId": "53cd10a9-c864-4dc3-a777-9860d59efe6c",  "deletedAt": null,  "documentId": null,  "draftBody": {    "buyer": {      "address": {        "city": "Hamburg",        "countryId": "DE",        "line1": "Am Hafen 12",        "postcode": "20457"      },      "contactId": "b17e8812-eae4-49b6-b5dc-30510635cb07",      "customerNumber": 1004,      "email": "",      "name": "Brauhaus Elbwiese GmbH",      "vatId": ""    },    "dueDate": {      "day": 15,      "month": 9,      "year": 2026    },    "issueDate": {      "day": 1,      "month": 9,      "year": 2026    },    "items": [      {        "description": "",        "discount": "0",        "name": "Fassadenbeschriftung Entwurf und Montage",        "position": "1",        "quantity": "1",        "taxRate": "19",        "unit": "C62",        "unitPrice": "-200"      }    ],    "notes": "",    "performancePeriodFrom": {      "day": 1,      "month": 9,      "year": 2026    },    "priceType": "net",    "remark": "",    "showQRCode": false,    "strict": false,    "taxRateReason": "none",    "validUntil": null  },  "externalRef": "order-2026-1042",  "id": "895394db-2b8b-4b25-a36f-c4b7c14c6653",  "invoiceCorrection": {    "entries": [      {        "grossAmountMinor": 23800,        "sourceLineIndex": 0      }    ],    "reason": "Vereinbarte Minderung wegen Teilleistung"  },  "invoiceNumber": "Entwurf 1042",  "kind": "invoice_correction",  "orderConfirmationId": null,  "originalInvoiceId": null,  "salesProposalId": null,  "source": "api",  "sourceInvoiceDocumentId": "3026096b-614f-40d3-8749-8acf9b529480",  "sourceOrderConfirmationId": null,  "sourceSalesProposalId": null,  "typeCode": "381",  "updatedAt": "2026-09-01T08:01:02.123456Z"}