beel_void_invoice
Void an issued invoice only if the operation never took place; the document and invoice number are kept. Requires a reason (min 10 chars) and sends a VeriFactu cancellation to AEAT when enabled.
Instructions
Voids an issued invoice of this company. The document is kept and its number is never reused.
When to use it: the operation never took place. If it did take place but with errors, issue a corrective invoice instead (
POST …/{invoice_id}/corrective).reason: required, at least 10 characters — it is fiscal data.VeriFactu: when it is enabled for the invoice, a cancellation record is submitted to the AEAT.
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
⚠️ 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 | 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. |