1. Guides
  2. Issuing NF-e

POST /nfe issues an NF-e model 55 for the organization that owns the x-api-key.

​
With or without tax calculation

  • With calculation (default)

  • Without calculation (calculateTaxes: false)

Treeunfe calculates the taxes for each item and the totals (ICMS, ST, DIFAL, FCP, IPI, PIS, COFINS, IBS, and CBS) using the organization’s issuing rules.

Use this when your system doesn’t have its own tax engine.

​
Body structure

{
  "calculateTaxes": true,
  "NFe": {
    "infNFe": {
      "ide": { },
      "emit": { },
      "dest": { },
      "autXML": [ ],
      "det": [ ],
      "total": { },
      "transp": { },
      "pag": { },
      "infRespTec": { }
    }
  }
}
FieldDescription
calculateTaxestrue (default) to have Treeunfe calculate the taxes; false to send the taxes already calculated.
NFe.infNFeThe invoice groups, with the same tags as the official NF-e layout (MOC).

Tag names follow the SEFAZ layout. The only difference is CNPJCPF: send either the CNPJ or the CPF in this one field, digits only.

​
Main groups

GroupContents
ideIdentification: state, series, number, dates, operation type, purpose.
emitIssuer: CNPJ, legal name, address (enderEmit), state registration (IE), and CRT.
destRecipient: CNPJ/CPF, name, address (enderDest), indIEDest, email.
autXMLCNPJs/CPFs authorized to download the XML.
detItems: prod (product) and imposto (taxes).
totalTotals: ICMSTot and IBSCBSTot.
transpShipping. modFrete: 9 = no freight.
pagPayment (detPag).
infRespTecTechnical contact responsible for the system.

The invoice’s environment comes from the API Key: a HOMOLOGACAO key issues in the sandbox and a PRODUCAO key in production. Do not send the environment in the payload.

​
Tax regime

The example below uses the normal regime (emit.CRT: 3, ICMS CST 00). For Simples Nacional, use emit.CRT: 1 and the ICMSSN groups with CSOSN (for example, ICMSSN102).

​
Full example

​
Response

When SEFAZ authorizes the invoice:

{
  "outcome": "SUCCESS",
  "chaveAcesso": "41261012345678000195554650000000101585524161",
  "protocolo": "141260000000000"
}

​
Response statuses

StatusMeaning
200Invoice processed. Check outcome.
400Invalid body.
401x-api-key missing or invalid.
402Issuing blocked by the account’s plan or balance.
403Organization inactive, or the key lacks the nfe:emit scope.
422Invoice rejected during validation or by SEFAZ.
503SEFAZ unavailable. Try again later.

See also Errors.