# sefaz_nfe v0.5.0 - Table of Contents > SEFAZ transport for Elixir: NF-e (55), NFC-e (65), CT-e (57/67) and MDF-e (58), with builder and parser, A1 certificates, mTLS, XMLDSig, webservices, DistDFe, contingency and telemetry. Does not calculate taxes. ## Pages - [sefaz_nfe](readme.md) - [Changelog](changelog.md) - [LICENSE](license.md) ## Modules - [SefazNfe](SefazNfe.md): SEFAZ NF-e and NFC-e **transport** (modelos 55 and 65). - [SefazNfe.AccessKey](SefazNfe.AccessKey.md): The 44 character access key (`chNFe`) of an NF-e or NFC-e. - [SefazNfe.Builder](SefazNfe.Builder.md): Builds the unsigned `NFe` XML from a map that mirrors the layout (AD-021, AD-024, AD-025). It walks `SefazNfe.Layout.nfe/0`, so element order, optional and required parts, choices and the facets of every value come from the official PL, not from code. It never computes or fills a value: the only two it writes itself are `infNFe/@versao` (`4.00`) and `det/@nItem` (the item's position). - [SefazNfe.Builder.Pattern](SefazNfe.Builder.Pattern.md): Translates the XSD regular expressions of the layout into PCRE sources the Erlang `re` module accepts (AD-025). - [SefazNfe.CStat](SefazNfe.CStat.md): Classifies a SEFAZ `cStat` into what the host has to do about it. - [SefazNfe.CTe](SefazNfe.CTe.md): CT-e (modelo 57) and CT-e OS (modelo 67) transport, layout 4.00. - [SefazNfe.CTe.Events](SefazNfe.CTe.Events.md): Builders for the CT-e (model 57 and 67) events, layout 4.00. - [SefazNfe.CTe.Proc](SefazNfe.CTe.Proc.md): The processed CT-e documents that are archived and delivered, assembled the way `SefazNfe.Proc` assembles the NF-e's (NFePHP `Complements`), and under the same rules (AD-011): the signed document and SEFAZ's answer are copied byte for byte out of what the caller passed and wrapped, never parsed and written back. The wrapper declares the CT-e namespace, which the answer's elements inherit from the SOAP body they were cut from. - [SefazNfe.CTe.Supl](SefazNfe.CTe.Supl.md): `infCTeSupl` with the QR code (`qrCodCTe`), mandatory in CT-e 4.00 (MOC rule G212/rejeicao 850). - [SefazNfe.Certificate](SefazNfe.Certificate.md): A1 (PKCS#12) handle. - [SefazNfe.Certificate.PKCS12](SefazNfe.Certificate.PKCS12.md): PKCS#12 (RFC 7292) reader for ICP-Brasil A1 files. Internal to `SefazNfe.Certificate`. - [SefazNfe.CircuitBreaker](SefazNfe.CircuitBreaker.md): One breaker per authorizer host, so a server that is down cannot drag the others with it. - [SefazNfe.DistDFe](SefazNfe.DistDFe.md): Page returned by `NFeDistribuicaoDFe` (Ambiente Nacional). - [SefazNfe.DistDFe.Document](SefazNfe.DistDFe.Document.md): One distributed document, already decompressed. - [SefazNfe.DistDFe.Poller](SefazNfe.DistDFe.Poller.md): One process per tax ID (CNPJ or CPF) for `NFeDistribuicaoDFe`. - [SefazNfe.EPEC](SefazNfe.EPEC.md): Reads, from an NF-e issued in EPEC contingency (`tpEmis` 4), the fields the EPEC event (110140) copies from it. - [SefazNfe.Endpoints](SefazNfe.Endpoints.md): Resolves `{uf, environment, service}` to a SOAP URL, per document model. - [SefazNfe.Events](SefazNfe.Events.md): Builders for the MOC's post-authorization events and for inutilização. - [SefazNfe.Layout](SefazNfe.Layout.md): The NF-e 4.00 layout as data (AD-024), and with it the CT-e, CT-e OS and MDF-e ones (AD-026): an ordered tree of elements, sequences, choices, attributes and leaf types, generated from the official XSD package by `mix sefaz.gen_layout` and committed as `priv/layouts/nfe_4.00.etf` (`cte_4.00`, `cte_os_4.00`, `mdfe_3.00` and the road modals `cte_modal_rodoviario_4.00`, `cte_os_modal_rodoviario_4.00`, `mdfe_modal_rodoviario_3.00` likewise). The builder and its parser walk this tree; it is never edited by hand. The refresh procedure is documented in `Mix.Tasks.Sefaz.GenLayout`, how each XSD idiom is compiled and how keys are derived in `SefazNfe.Layout.Generator`. - [SefazNfe.Layout.Generator](SefazNfe.Layout.Generator.md): Compiles the official XSD package (a PL) into the layout tree that `SefazNfe.Layout` loads (AD-024). Driven by `mix sefaz.gen_layout`. - [SefazNfe.MDFe](SefazNfe.MDFe.md): MDF-e (modelo 58) transport, layout 3.00. - [SefazNfe.MDFe.Events](SefazNfe.MDFe.Events.md): Builders for the MDF-e (modelo 58) events, layout 3.00. - [SefazNfe.MDFe.Pending](SefazNfe.MDFe.Pending.md): `retConsMDFeNaoEnc`: the MDF-e of an emitter that were authorized and not yet closed (encerrados), from `SefazNfe.MDFe.pending/1`. - [SefazNfe.MDFe.Proc](SefazNfe.MDFe.Proc.md): The processed MDF-e documents (NFePHP's `Complements` for sped-mdfe), reached through `SefazNfe.Proc` as `mdfe_proc/2`, `mdfe_event_proc/2`, `mdfe_cancel_register/2` and `mdfe_close_register/2`. - [SefazNfe.MDFe.QRCode](SefazNfe.MDFe.QRCode.md): `infMDFeSupl` with `qrCodMDFe`, which an MDF-e 3.00 must carry. - [SefazNfe.NFCe](SefazNfe.NFCe.md): The NFC-e (model 65) pieces that are not plain transport: `infNFeSupl` and the on-line QR code, version 3.00 (NT 2025.001). - [SefazNfe.Proc](SefazNfe.Proc.md): Assembles the processed documents that are archived and delivered: the signed document plus SEFAZ's answer (NFePHP's `Complements`). - [SefazNfe.Result](SefazNfe.Result.md): Parsed SEFAZ business outcome. A SOAP envelope that we understood is `{:ok, t}` even when `c_stat != 100` — that is a rejection, not a crash. - [SefazNfe.SOAP](SefazNfe.SOAP.md): HTTP+mTLS POST of a SOAP envelope. - [SefazNfe.SOAP.Envelope](SefazNfe.SOAP.Envelope.md): Builds the SOAP 1.2 envelope the 4.00 webservices expect. - [SefazNfe.SOAP.Fault](SefazNfe.SOAP.Fault.md): Detects a SOAP fault in a 200 response. - [SefazNfe.SOAP.HTTPC](SefazNfe.SOAP.HTTPC.md): Default `SefazNfe.SOAP` client: an mTLS POST over `:httpc`. - [SefazNfe.Schema](SefazNfe.Schema.md): Optional XSD validation against the official NF-e, CT-e and MDF-e schemas. - [SefazNfe.Signer](SefazNfe.Signer.md): Enveloped XMLDSig, as the MOC 4.00 defines it for NF-e. - [SefazNfe.Taxpayer](SefazNfe.Taxpayer.md): One `infCad` of a `NFeConsultaCadastro` answer. - [SefazNfe.TaxpayerLookup](SefazNfe.TaxpayerLookup.md): Answer of `NFeConsultaCadastro` (`retConsCad/infCons`). - [SefazNfe.Telemetry](SefazNfe.Telemetry.md): The `:telemetry` events this library emits, per operation and per UF. - [SefazNfe.XML](SefazNfe.XML.md): Reading side of the SEFAZ XML, on `:xmerl`. - [SefazNfe.XML.C14N](SefazNfe.XML.C14N.md): Canonical XML 1.0 without comments, the form XMLDSig digests. ## Mix Tasks - [mix sefaz.endpoints](Mix.Tasks.Sefaz.Endpoints.md): Audits `priv/endpoints/nfe_4.00.json` (model 55), `priv/endpoints/nfce_4.00.json` (model 65), `priv/endpoints/cte_4.00.json` (models 57 and 67) and `priv/endpoints/mdfe_3.00.json` (model 58). - [mix sefaz.gen_layout](Mix.Tasks.Sefaz.GenLayout.md): Compiles the NF-e `TNFe` type of an official Pacote de Liberacao into the ordered layout tree the builder walks (AD-024).