# `SefazDanfe.Nfe.Data`
[🔗](https://github.com/devaction-labs/sefaz_danfe/blob/v0.1.0/lib/sefaz_danfe/nfe/data.ex#L1)

The data of a DANFE, read from the `nfeProc` SEFAZ authorized: what the PDF is drawn from.

Pure: it takes the XML (`SefazNfe.Builder.parse_nfe/2`) and answers a map with string keys that
the JSON encoder takes as is. Every value is already presented the Brazilian way
(`SefazDanfe.Format`) and is `nil` when the XML does not have it: nothing is computed or
invented. The blocks follow the DANFE of the MOC (Anexo II): `emitter`, `recipient`, `billing`
(fatura and duplicatas), `totals`, `transport`, `items`, `issqn` and `additional_info`, with the
identification of the document and the `protocol` of the authorization at the top.

`opts` takes `:canceled` (default `false`): the DANFE of a cancelled NF-e says so.

# `t`

```elixir
@type t() :: %{required(String.t()) =&gt; term()}
```

# `from_xml`

```elixir
@spec from_xml(String.t(), keyword()) :: {:ok, t()} | {:error, term()}
```

The DANFE data of the `nfeProc` (or the `NFe`) in `xml`; `{:error, reason}` when it cannot be read.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
