Cancel/annul invoice (irreversible)
cancel_invoiceAnnul (anular) a finalized invoice, sends a RegistroAnulacion to the AEAT (if the invoice was never sent to the AEAT, the anulación is recorded only in the local hash chain). IRREVERSIBLE Veri*factu chain event: the invoice then counts as never issued. Ask the user for explicit confirmation, then call with confirm=true. For a later discount or correction use rectify_invoice instead (anulación is 'this was a mistake'). Returns a confirmation that the annulment was recorded.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| reason | Yes | internal reason (duplicate, wrong recipient, input error…) | |
| confirm | Yes | Must be true. Only after the user explicitly confirmed the irreversible annulment. | |
| invoice_id | Yes |