nfse_cancel
Cancel an invoice. A queued (scheduled or not yet issued) invoice is cancelled immediately; an authorized NFS-e returns status "cancelling" while the cancellation event is sent to the Sefin. An invoice still being issued (status "processing") registers the request and stays "processing" with the request recorded; if it is authorized it is cancelled automatically at the Sefin and the credit is not refunded, and if the emission is rejected or fails the request is discarded. Issued NFS-e and invoices being issued require a 15-255 character description. With type "nfe" it cancels an authorized NF-e at the SEFAZ: send only invoice_id and description (the justification, 15 to 255 characters); reason is not used. The same for type "nfce" (a NFC-e is cancelled within 30 minutes of the authorization). Cancelling cannot be undone. Without confirm: true it changes nothing and returns a preview; with confirm: true it runs.
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": {
"invoice_id": "<invoice_id>"
},
"name": "nfse_cancel"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | No | Kind of invoice: "nfse" (default, services), "nfe" (goods, model 55) or "nfce" (sale to the consumer, model 65). NF-e and NFC-e are homologação only and need their own release for the account. With "nfe" or "nfce" use invoice_id, not access_key. | nfse |
| reason | No | Motivo do cancelamento da NFS-e: issue_error (erro na emissão), service_not_provided (serviço não prestado) ou other. | |
| confirm | No | true runs the action. Without it nothing changes and only a preview is returned. | |
| invoice_id | Yes | UUID of the invoice | |
| description | No | Free-text justification; required (15-255 chars) for an authorized NFS-e or an invoice being issued (processing) |