beel_void_invoice
Voids an issued invoice created by mistake, such as a test or duplicate, keeping the document and never reusing its number. For real operations with errors, issue a corrective instead.
Instructions
Voids an issued invoice of this company. The document is kept and its number is never reused.
When to use it: the invoice was issued by mistake — the operation never took place, it was a test, or it is an accidental duplicate. If the operation did take place but the invoice is wrong, issue a corrective invoice instead (
POST …/{invoice_id}/corrective). The exception is a withholding that should not have been applied: it is not a cause for a corrective, so void the invoice and issue a new one without it.Sent or paid: voiding an invoice that was already sent or paid requires
issued_in_error: true, confirming it was issued by mistake; without it the request fails with422 VOID_REQUIRES_ISSUED_IN_ERROR.Corrected invoices: an invoice with live corrective invoices cannot be voided — it was corrected, so the operation took place; issue another corrective (
422 INVOICE_HAS_LIVE_CORRECTIVES). ATOTALcorrective cannot be voided either: the invoice it rectifies would stay voided with nothing to offset it (422 TOTAL_CORRECTIVE_NOT_VOIDABLE).reason: required, at least 10 characters — it is fiscal data.void_date: deprecated. A date earlier than the invoice's issue date is rejected with422 VOID_DATE_BEFORE_ISSUE_DATE.VeriFactu: when it is enabled for the invoice, a cancellation record is submitted to the AEAT.
PDF: unchanged. The PDF of the invoice stays the one that was delivered; the void is reported by the invoice's
statusand theinvoice.voidedwebhook.Proformas: voiding an
ACTIVEproforma is a plain status change with no fiscal effect — no corrective invoice, nothing submitted to the AEAT. The voided proforma is kept as the record of a rejected or withdrawn offer and stays listed.
Endpoint: POST /v1/companies/{company_id}/invoices/{invoice_id}/void
⚠️ Read before calling:
Fiscal rules, domains void, lifecycle: beel_rules_list with domain, or resource beel://guardrails/.
The status names, the proforma lifecycle, and which tool performs each operation. (resource: beel://guardrails/invoice-state-machine)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | Yes | ||
| company_id | Yes | Unique identifier (UUID) of the company the operation acts on — its identifier, not its NIF. 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 company you do not reach answers `403`, and so does a company that does not exist, so the existence of a company in another account is never disclosed. | |
| invoice_id | Yes | Invoice ID | |
| idempotency_key | No | Optional idempotency key for this operation. Omit it and one is derived from the request itself, which makes a blind retry safe but also collapses a SECOND, deliberately identical operation into the first for 24 hours. Set it — to an order id, or anything unique per intended operation — whenever you mean to create something that may look identical to what you just created. |