beel_delete_invoice
Delete a draft invoice to mark it as removed; if it originated from a proforma, restore that proforma to ACTIVE. Issued invoices are voided instead, preserving fiscal records.
Instructions
Deletes a draft invoice of this company. The record is marked as deleted rather than
removed. An issued invoice is never deleted: it is voided with
POST …/{invoice_id}/void, which leaves the fiscal trail.
If the draft came from converting a proforma (source_proforma_id present), deleting it
returns that proforma from CONVERTED to ACTIVE, editable and convertible again. Voiding
or rectifying an issued invoice does not return its proforma; only deleting the draft does.
Endpoint: DELETE /v1/companies/{company_id}/invoices/{invoice_id}
⚠️ Fiscal guardrails — read before calling:
When an invoice can still be changed, and what to do once it cannot. (resource: beel://guardrails/invoice-state-machine)
For the exhaustive rules and worked examples, call beel_docs_search.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| company_id | Yes | NIF (company) the operation acts on. It is the only source of context: the account that owns it is derived from it, and the `BeeL-Active-Company` header plays no part. A NIF you do not reach answers `403`, and so does a NIF that does not exist, so the existence of a NIF in another account is never disclosed. | |
| invoice_id | Yes | Invoice ID |