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 b64 field (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:ssTZD unless otherwise indicated.
  • The evento field inside infPedReg has a dynamic structure — the fields vary according to the event type (tpEvento). See the event types document for details.

1. Root — NfseEventJsonDTO

FieldDescription
versaoNFS-e event schema version (e.g.: "1.00", "1.01"). Extracted from the versao attribute of the root element <evento>.
infEventoGroup of information about the processed event. See section 2.

2. Event information — infEvento

FieldDescription
infEvento.idUnique identifier of the processed event (Id attribute of the <infEvento> element in the XML).
infEvento.verAplicVersion of the application that generated the event.
infEvento.ambGerGeneration environment: "1" = Municipality's own system; "2" = Sefin Nacional NFS-e; "3" = ADN NFS-e.
infEvento.nSeqEventoSequential event number for the same event type. For events that occur only once (e.g.: cancellation), the value is "001".
infEvento.dhProcDate/time the event was registered (UTC, ISO 8601).
infEvento.nDFeSequential number of the document generated by the municipality's DFS-e generation environment.
infEvento.pedRegEventoEvent registration request. See section 3.

3. Registration request — infEvento.pedRegEvento

FieldDescription
pedRegEvento.versaoSchema version of the registration request (versao attribute of the <pedRegEvento> element).
pedRegEvento.infPedRegRegistration request information. See section 4.

4. Registration request information — infPedReg

FieldDescription
infPedReg.idUnique identifier of the registration request (Id attribute of the <infPedReg> element in the XML).
infPedReg.tpAmbEnvironment type: "1" = Production; "2" = Homologation (testing).
infPedReg.verAplicVersion of the application that generated the event registration request.
infPedReg.dhEventoEvent date/time (UTC, ISO 8601).
infPedReg.CNPJAutorCNPJ of the event author (14 digits, unformatted). Interested party or person appearing on the NFS-e.
infPedReg.chNFSeAccess key of the NFS-e to which the event is linked.
infPedReg.nPedRegEventoEvent registration request number.
infPedReg.eventoMap (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"
        }
      }
    }
  }
}

On this page