Finalize invoice (irreversible)
finalize_invoiceFinalize a DRAFT invoice: assigns the sequential invoice number, computes the hash and adds it to the Verifactu chain (and, if the account has AEAT mode enabled, submits the record to the tax authority). THIS IS IRREVERSIBLE, se envía a la cadena Verifactu: a finalized invoice can never be edited or deleted; mistakes require a rectificative invoice. Ask the user for explicit confirmation first, then call with confirm=true. Returns the assigned invoice number and the Veri*factu hash, plus the AEAT submission status if the account has AEAT mode enabled. Still something to fix in the draft first, use update_invoice before finalizing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| confirm | Yes | Must be true. Only set after the user explicitly confirmed the irreversible finalization. | |
| invoice_id | Yes |