beel_void_invoice
Voids an issued invoice made by mistake, such as a test or accidental duplicate, keeping the document and never reusing its number. Use a corrective invoice if the operation took place.
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 emailed to the customer or paid requires
issued_in_error: true, confirming it was issued by mistake; without it the request fails with422 VOID_REQUIRES_ISSUED_IN_ERROR. What counts is the fact, not the currentstatus: an email in the invoice's sending history (moving it back fromSENTtoISSUEDdoes not erase it), or apaid_at(it stays after the invoice isRECTIFIED). Corrective invoices follow the same rule.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.
BeeL API endpoint: POST /v1/companies/{company_id}/invoices/{invoice_id}/void (reference: https://docs.beel.es)
⚠️ 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)
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"company_id": "<company_id>",
"invoice_id": "<invoice_id>",
"body": "<body>"
},
"name": "beel_void_invoice"
}
}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. |