cancel_invoice
Cancel an authorized invoice.
Legal cancellation, with fiscal and accounting effect, inside a window the NFS-e authorizer enforces for the municipality. Ask the human to confirm before calling; never call it speculatively. The reason reaches the tax authority verbatim and must be at least 15 characters.
Pass idempotency_key to make a retry safe: repeating the same key with the same access key and reason replays the first answer instead of cancelling a second time. Reuse the key only when retrying that exact call; a genuinely new cancellation needs a new key, or none. Nothing generates one for you — two calls without a key are two cancellations.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| reason | Yes | ||
| access_key | Yes | ||
| document_type | Yes | ||
| idempotency_key | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Local id. Use it for reissue and for submissions, and when a document was rejected and has no key. | |
| status | No | issued, rejected or cancelled. | |
| protocol | No | The authorization protocol, when granted. | |
| access_key | No | The authorizer's key. Absent while the document is not authorized. |