TF Fiscal
Documentation

NFS-e

Cancel NFS-e

Asynchronous cancellation: within the window it registers the cancellation event, past the window it files a tax review request.

POST/openapi/v2/empresas/{empresaId}/nfse/{nfseId}/cancelar
Requires the token, timestamp and sign signature headers, see Authentication.

Cancels an Autorizada document. The call is asynchronous: HTTP 200 returns only the acceptance receipt, and the outcome arrives through the nfse.canceled / nfse.cancel_requested / nfse.cancel_denied webhooks or through the query. The platform decides on its own between registering a cancellation event and filing a tax review request, depending on the municipal window. The body is optional.

Path parameters

empresaId*
stringCompany identifier
nfseId*
stringDocument id

* Required field

Request body

codigoMotivo
stringReason code
motivo
stringJustification

* Required field

200
Acceptance receipt. Follow the outcome through the webhook or the query.
nfseTaskId
intPlatform task id
status
intTask status
reused
boolTask reused
createTime
stringAcceptance time

The body is the same in both cases; the platform picks the path from the municipal cancellation window counted from authorization. Only an Autorizada document can be cancelled.

Within the window: cancellation event

The platform registers official event 101101. Success: the document becomes Cancelada and nfse.canceled arrives; the query shows a Cancelamento event. Synchronous refusal by the authority: the document stays Autorizada and nfse.cancel_denied arrives.

json
{
"codigoMotivo": "1",
"motivo": "Erro no valor informado pelo cliente"
}
codigoMotivo
stringReason code
motivo
stringJustification

* Required field

Past the window: tax review request

The platform files review request 101103 on its own. The document becomes EmProcessoDeCancelamento and nfse.cancel_requested arrives; the query shows a PedidoAnalise event. The municipality decides: granted, the document turns Cancelada with an AnaliseDeferida event and nfse.canceled arrives; refused, it goes back to Autorizada with an AnaliseIndeferida event and nfse.cancel_denied arrives. Do not book the document as cancelled when you send the request.

json
{
"codigoMotivo": "2",
"motivo": "Servico nao prestado ao tomador"
}
codigoMotivo
stringReason code
motivo
stringJustification

* Required field

São Paulo channel

The São Paulo municipal system has neither a window nor a review request: the cancellation is registered directly with the municipal system and the outcome is Cancelada with nfse.canceled, or a refusal with nfse.cancel_denied.