POST

Issues an NF-e model 55 for the organization given in x-organization-id.

  • With tax calculation — Payload Inteligente (calculateTaxes: true): Treeunfe calculates the item taxes and the totals using the organization’s issuing rules.
  • Without calculation (calculateTaxes omitted or false, the default): the invoice is transmitted with the values exactly as sent.

In the Payload Inteligente, you only need the recipient’s CNPJ or CPF in dest and, for each item, cProd, qCom, and vUnCom. Treeunfe fills in the rest of the invoice from the company’s records and settings. See the issuing guide.

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

​
Authentication

Send the x-enterprise-key and x-organization-id headers.

x-enterprise-key
required
string

Enterprise key with this route’s permission. See Authentication.

x-organization-id
required
string

ID of the organization (issuing company) the operation applies to.

​
Body

application/json

calculateTaxes
boolean

true makes Treeunfe calculate the item taxes and the totals (ICMS, ST, DIFAL, FCP, IPI, PIS, COFINS, IBS, and CBS) using the organization’s issuing rules. false uses exactly the values sent. Default: false.

NFe
required
object
  • infNFe (object) (required): The NF-e groups, with the same tags as the official layout (MOC).
  • infNFe.det[].taxRuleId (string): The item’s issuing rule, by identifier (for example, REM01) or internal ID. Only applies with calculateTaxes: true. Without it, Treeunfe chooses the rule automatically. See how the rule is chosen.

​
Responses

StatusDescription
200Processed by SEFAZ. Check outcome.
400Invalid body (missing required field, wrong format, or field not allowed).
401Credential missing, invalid, or expired.
402Issuing blocked by the account’s plan or balance.
403Credential not allowed to access the resource, or organization inactive (Organization is inactive).
422Invoice rejected (validation or SEFAZ rejection).
503SEFAZ unavailable. Try again later.
curl -X POST "https://api.treeunfe.com.br/api/v1/nfe" \
  -H "x-enterprise-key: YOUR_ENTERPRISE_KEY" \
  -H "x-organization-id: ORGANIZATION_ID" \
  -H "Content-Type: application/json" \
  -d '{
    "calculateTaxes": true,
    "NFe": {
      "infNFe": {
        "dest": "11222333000181",
        "det": [
          { "prod": { "cProd": "6658", "qCom": 1, "vUnCom": 100 } }
        ]
      }
    }
  }'
{
  "outcome": "SUCCESS",
  "chaveAcesso": "string",
  "protocolo": "string"
}