1. Inicio
  2. Documentos
  3. NS NFe (English)
  4. Events
  5. NFe Check Situation

NFe Check Situation

Through the NF-e Situation Consult service, it’s possible to obtain information about the current status of the NF-e in the Sefaz database.

This functionality is widely used in cases where it’s necessary to verify the existe and validity of an NF-e, as well as to obtain information about the events that occured with it (e.g.: alteration of values by a Correction Letter).

URL

Production: POST https://nfe.ns.eti.br/nfe/stats

Input data
FieldDescriptionData TypeOccurrenceNotes
X-AUTH-TOKENUser access tokenString0-1
licencaCnpjCNPJ of the license interested in consulting the NF-e statusInt0-1Used to identify the digital certificate to be used. If not sent, the CNPJ will be extracted from the key sent in the chNFe field
chNFeNF-e access keyInt1-1
tpAmbNF-e authorization environment type:
1 - Production
2 - Homologation
Int1-1
veraoNF-e versionString0-1Standard value: 4.00
Request example

Consult situation

curl -X POST \
    -H "Content-Type: application/json" \
    -d '{
         "X-AUTH-TOKEN": "YOUR_TOKEN", 
         "licencaCnpj": "07364617000135", 
         "chNFe": "43161107364617000135550000000099461000094833", 
         "tpAmb": "2", 
         "versao": "4.00"
         }'\
    https://nfe.ns.eti.br/nfe/stats
Returned data
FieldDescriptionNotes
statusProcessing status code
motivoProcessing status literal description
retConsSitNFeObject containing the NF-e authorization protocol data and all linked eventsOnly when status = 200
erroObject containing the error data that occured during processingOnly when status is different from 200
erro.cStatError status code
erro.xMotivoError literal description
Return example

Successful return (cStat 100 = authorized)

{
    "status": 200,
    "motivo": "Consulta realizada com sucesso",
    "retConsSitNFe": {
        "tpAmb": "2",
        "verAplic": "RS201809061124",
        "cStat": "100",
        "xMotivo": "Autorizado o uso da NF-e",
        "cUF": "43",
        "dhRecbto": "2020-09-03T10:54:16-03:00",
        "protNFe": [
            {
                "infProt": {
                    "Id": "ID143200000787484",
                    "tpAmb": "2",
                    "verAplic": "RS202008281347",
                    "chNFe": "43200907364617000135550000000518401004621869",
                    "dhRecbto": "2020-09-03T10:53:36-03:00",
                    "nProt": "143200000787484",
                    "digVal": "VBJVDHDVbPA1qoH/1RBC+wIBIU4=",
                    "cStat": "100",
                    "xMotivo": "Autorizado o uso da NF-e"
                },
                "versao": "4.00"
            }
        ],
        "versao": "4.00"
    }
}
Returned cStats

According to the main cStat code, which is returned in the retConsSitNFe object, it’s possible to define the status of the document. Below is a table with some values that can be returned. There may be other returns as needed by Sefaz.

CodeReturn
100Authorized document
101Cancelled document
110Denied document
Return codes
CodeDescription
200Consult carried out successfully
-400NF-e access key or environment type not informed
-3Invalid access key
-6Error carrying out the consult. Check the "erro" object to identify the reason

Como podemos ajudar?