beel_void_invoice
Cancel an issued invoice when the operation never happened, retaining the document and reporting to AEAT if VeriFactu is enabled. Also voids proformas as a status change.
Instructions
Voids an issued invoice of this company. The document is kept and its number is never reused; when VeriFactu is enabled a cancellation record is submitted to AEAT. Use it when the operation never took place; if it did take place but with errors, issue a corrective invoice instead.
Voiding an ACTIVE proforma is a direct status change with no fiscal effect: it creates no
corrective invoice and nothing is submitted to 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
⚠️ Fiscal guardrails — read before calling:
Choosing wrong here misreports to AEAT. The 30-second decision. (resource: beel://guardrails/cancel-vs-rectify)
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 |
|---|---|---|---|
| body | Yes | ||
| 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 | |
| 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. |