- Getting started
- Errors
Getting started
Errors
HTTP statuses returned by the API and what to do in each case.
| Status | Meaning | What to do |
|---|---|---|
400 | Invalid body: missing required field, wrong format, or field not allowed. | Fix the payload. In PATCH /enterprise/organizations/{id}, don’t send CNPJCPF or extra fields. |
401 | Credential missing, invalid, or expired. | Check the header (x-api-key or x-enterprise-key). Generate a new key if the current one has expired. |
402 | Issuing blocked by the account’s plan or balance. | Contact Treeunfe’s sales team. |
403 | No permission. Includes Organization is inactive. | Check the key’s scopes and whether the organization is active. |
404 | Resource not found. | Check the ID and whether it belongs to the key’s organization. |
422 | Invoice or event rejected during validation or by SEFAZ. | Read the reason in the response, fix it, and send it again. |
503 | SEFAZ unavailable. | Try again later, with increasing intervals between attempts. |
On 503, don’t generate an invoice with a new number. Resend the same invoice, with the same nNF and the same serie, so you don’t leave gaps in the numbering.