- NF-e
- Issue NF-e
NF-e
Issue NF-e
Issues an NF-e model 55 for the organization given in `x-organization-id`
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 (
calculateTaxesomitted orfalse, 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.
Enterprise key with this route’s permission. See Authentication.
ID of the organization (issuing company) the operation applies to.
Body
application/json
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.
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 withcalculateTaxes: true. Without it, Treeunfe chooses the rule automatically. See how the rule is chosen.
Responses
| Status | Description |
|---|---|
200 | Processed by SEFAZ. Check outcome. |
400 | Invalid body (missing required field, wrong format, or field not allowed). |
401 | Credential missing, invalid, or expired. |
402 | Issuing blocked by the account’s plan or balance. |
403 | Credential not allowed to access the resource, or organization inactive (Organization is inactive). |
422 | Invoice rejected (validation or SEFAZ rejection). |
503 | SEFAZ 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"
}
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"
}