1. Getting started
  2. Errors
StatusMeaningWhat to do
400Invalid body: a required field is missing, the format is wrong, or a field is not allowed.Fix the payload.
401The credential is missing, invalid, or expired.Check the x-api-key header. Generate a new key in the issuer app if the current one expired.
402Issuance is blocked by the plan or the account balance.Talk to Treeunfe sales.
403No permission. Includes Organization is inactive.Check that the company is active in Treeunfe.
404Resource not found.Check the ID and that it belongs to the key’s company.
422The invoice or event was rejected in validation, by SEFAZ, or by the ADN.Read the reason in the response, fix it, and send it again.
429The request limit was exceeded.Wait and try again, with a growing interval between attempts.
503SEFAZ is unavailable.Try again later, with a growing interval between attempts.

On 503 for an NF-e, do not create an invoice with a new number. Send the same invoice again, with the same nNF and the same serie, so you do not leave gaps in the numbering.

​
NFS-e validation errors

When issuing an NFS-e, a 400 returns outcome: "VALIDATION_ERROR" and a list of every problem found:

{
  "outcome": "VALIDATION_ERROR",
  "errors": [
    {
      "code": "2002",
      "title": "Tipo inválido",
      "field": "payload.vServ",
      "message": "Campo foi enviado com tipo diferente do esperado. Esperado: number, recebido: string",
      "details": { "expected": "number", "received": "string" }
    },
    {
      "code": "2006",
      "title": "CNPJ/CPF inválido",
      "field": "payload.tomadorCnpj",
      "message": "Documento informado não é um CNPJ ou CPF válido"
    }
  ]
}
code rangeTypeExample
2xxxPayload: a field is missing, or the type or format is wrong.2002 Invalid type
3xxxBusiness rule.
5xxxResource or system. field comes back as system.5001 company not found

Fix every item in the list before sending the invoice again.