1. Inicio
  2. Documentos
  3. NS NF3e (English)
  4. NF3-e Events
  5. Cancellation

Cancellation

Through the NF3-e cancellation method, it’s possible to cancel a previously authorized NF3-e through the API.

Obs.: the NF3-e cancellation has rules and deadlines defined by the Secretaria da Fazenda that must be considered and respected. For more information, click here and verify the most up-to-date version of the Sefaz Contributors’ Guidance Manual.

URL

Production: POST https://nf3e.ns.eti.br/v1/nf3e/cancel

Input Data
FieldDescriptionNotes
X-AUTH-TOKENUser access token
chNF3eNF3-e access key
tpAmbNF3-e authorization environment type: 1 - Production, 2 - Homologation
dhEventoDate and time of the cancellationSefaz Standard: YYYY-MM-DDTHH:MM:SS+UTC. E.g.: 2016-06-13T15:04:10-02:00
nProtNF3-e authorization protocol number
xJustLiteral description of the reason for the NF3-e cancellationMinimum 15 characters (no API restriction on special characters)
Request Example

NF3-e cancellation request

curl -X POST \
-H "Content-Type: application/json" \
-d '{"chNF3e": "11111111111111111111111111111111111111111111", "tpAmb": 2, "dhEvento": "2021-02-22T10:26:00-03:00", "nProt": "111111111111111", "xJust": "teste de integração"}'\
https://nf3e.ns.eti.br/v1/nf3e/cancel
Returned Data
FieldDescriptionData TypeParentNotes
statusProcessing status codeInt
motivoLiteral description of the processing status codeString
retEventoObject containing the cancellation processing data at SefazObjectOnly when status = 200
cStatProcessing status codeIntretEvento
xMotivoLiteral description of the processing status at SefazStringretEvento
idEventoId of the generated eventIntretEvento
chNF3eNF3-e access keyIntretEventoOnly when cStat = 135
dhRegEventoDate and time of the event registration at SefazDateretEventoSefaz Standard: YYYY-MM-DDTHH:MM:SS+UTC. E.g.: 2016-06-13T15:04:10-03:00. Only when cStat = 135
nProtEvent authorization protocol numberIntretEventoOnly when cStat = 135
xmlCancel event distribution XMLStringretEventoOnly when cStat = 135
erroObject containing error information in case the cancellation cannot be carried out successfullyObjectOnly when status is different from 200
cStatError status codeInterro
xMotivoLiteral description of the errorStringerro
Response Examples

Successful response

{
    "status": 200,
    "motivo": "NF3e cancelado com sucesso",
    "retEvento": {
        "cStat": "135",
        "xMotivo": "Evento registrado e vinculado a NF3e ",
        "idEvento": "11011111111111111111111111111111111111111111111111",
        "chNF3e": "11111111111111111111111111111111111111111111",
        "dhRegEvento": "2021-02-25T17:56:36-03:00",
        "nProt": "111111111111111",
        "xml": "<procEventoNF3e>... </procEventoNF3e>"
    }
}
Return Codes
CodeDescription
200NF3-e successfully cancelled
-2Invalid access key
-3It was not possible to cancel the NF3-e. Verify the "erro" object for more information
-4Problem with digital certificate. Check the "erro" object for more information
-5Invalid event according to the validation agaisnt schema
NF3-e Cancellation Download

You can download the complete cancellation distribution information in XML or JSON and also a graphical representation of the same in PDF. For this, check the download event at NS NF3-e API.

Como podemos ajudar?