NFS-e
Machine translation, not yet reviewed.
NFS-e events JSON — field reference
NFS-e events JSON — field reference
Reference document — Field-by-field dictionary of the JSON representation of an NFS-e event obtained after decoding the
b64field (Base64 + Gzip).
Conventions used in this document
- Fields that are null or absent in the source XML are omitted from the JSON.
- Dates follow the UTC format
AAAA-MM-DDThh:mm:ssTZDunless otherwise indicated. - The
eventofield insideinfPedReghas a dynamic structure — the fields vary according to the event type (tpEvento). See the event types document for details.
1. Root — NfseEventJsonDTO
| Field | Description |
|---|---|
versao | NFS-e event schema version (e.g.: "1.00", "1.01"). Extracted from the versao attribute of the root element <evento>. |
infEvento | Group of information about the processed event. See section 2. |
2. Event information — infEvento
| Field | Description |
|---|---|
infEvento.id | Unique identifier of the processed event (Id attribute of the <infEvento> element in the XML). |
infEvento.verAplic | Version of the application that generated the event. |
infEvento.ambGer | Generation environment: "1" = Municipality's own system; "2" = Sefin Nacional NFS-e; "3" = ADN NFS-e. |
infEvento.nSeqEvento | Sequential event number for the same event type. For events that occur only once (e.g.: cancellation), the value is "001". |
infEvento.dhProc | Date/time the event was registered (UTC, ISO 8601). |
infEvento.nDFe | Sequential number of the document generated by the municipality's DFS-e generation environment. |
infEvento.pedRegEvento | Event registration request. See section 3. |
3. Registration request — infEvento.pedRegEvento
| Field | Description |
|---|---|
pedRegEvento.versao | Schema version of the registration request (versao attribute of the <pedRegEvento> element). |
pedRegEvento.infPedReg | Registration request information. See section 4. |
4. Registration request information — infPedReg
| Field | Description |
|---|---|
infPedReg.id | Unique identifier of the registration request (Id attribute of the <infPedReg> element in the XML). |
infPedReg.tpAmb | Environment type: "1" = Production; "2" = Homologation (testing). |
infPedReg.verAplic | Version of the application that generated the event registration request. |
infPedReg.dhEvento | Event date/time (UTC, ISO 8601). |
infPedReg.CNPJAutor | CNPJ of the event author (14 digits, unformatted). Interested party or person appearing on the NFS-e. |
infPedReg.chNFSe | Access key of the NFS-e to which the event is linked. |
infPedReg.nPedRegEvento | Event registration request number. |
infPedReg.evento | Map (Map<String, String>) with the data specific to the event type. The tpEvento field is always present and indicates the type. The other fields vary according to the event type. See the NFS-e event types document for the description of each type's fields. |
5. Example
{
"versao": "1.01",
"infEvento": {
"id": "EVT31062002247979038000111000000000004925102970368024101101001",
"verAplic": "SVRS202501",
"ambGer": "2",
"nSeqEvento": "001",
"dhProc": "2024-11-04T13:16:25-03:00",
"pedRegEvento": {
"versao": "1.01",
"infPedReg": {
"id": "PEDIDO31062002247979038000111000000000004925102970368024101101001",
"tpAmb": "1",
"verAplic": "APP_CONTRIB_1.0",
"dhEvento": "2024-11-04T13:16:25-03:00",
"CNPJAutor": "47979038000111",
"chNFSe": "31062002247979038000111000000000004925102970368024",
"nPedRegEvento": "001",
"evento": {
"tpEvento": "101101",
"xDesc": "Cancelamento de NFS-e",
"cMotivo": "2",
"xMotivo": "Serviço não prestado"
}
}
}
}
}