NF-e: errors and hints
The three kinds of NF-e error, the codes you may see and what to do about each.
An error of a note (lastError) and a failed request both say who has to act with type:
| `type` | Who acts | What to do |
|---|---|---|
validation | You | Fix the fields in details (or, for a rejected note, what the SEFAZ refused) and send again. |
configuration | You | Complete the company (IE, CRT, address) or use a test key while production is off. |
communication | Nobody | The SEFAZ did not answer. Arquivix Notas checks again by itself, without issuing twice. |
A rejection by the SEFAZ comes with its cStat and xMotivo, plus a hint in plain words when Arquivix Notas knows how to fix it.
| Code | Meaning |
|---|---|
NFE_VALIDATION_FAILED | Fields with problems; see details (path, code and message of each). |
COMPANY_NFE_INCOMPLETE | The company lacks address, IE or CRT; details lists them. |
STATE_REGISTRATION_INVALID | The IE is not valid for the state of the company. |
UF_NOT_ENABLED | A NFC-e for a state that has no NFC-e addresses in Arquivix Notas yet (today SP and CE). The NF-e has no such limit. |
NFE_PRODUCTION_DISABLED | A live company asked for NF-e: production is not turned on yet. Use a test key. |
CERTIFICATE_UNUSABLE | The A1 certificate is expired or invalid. |
IDEMPOTENCY_KEY_REQUIRED, IDEMPOTENCY_KEY_INVALID, IDEMPOTENCY_KEY_REUSED | Missing header, wrong size, or one key used with two bodies. |
INVOICE_OPERATION_NOT_SUPPORTED | The operation does not exist for this type of note. |
NFE_INVALID_STATE | The action does not apply to the current state of the note. |
COMPANY_MISMATCH | The company of a rejected note cannot be changed on resubmission. |
TAX_ID_INVALID, RECIPIENT_IE_INVALID, NCM_INVALID, CFOP_DESTINATION_MISMATCH, CSOSN_NOT_SUPPORTED, ICMS_REQUIRED, ICMS_RATE_REQUIRED, ICMS_ST_REQUIRED, ICMS_ST_MVA_REQUIRED, DIFAL_REQUIRED, DIFAL_NOT_APPLICABLE, IPI_RATE_REQUIRED, PIS_COFINS_RATE_REQUIRED, PAYMENTS_TOTAL_MISMATCH, RETURN_REFERENCE_MISSING, RETURN_PAYMENT_NOT_ALLOWED, REFERENCE_KEY_INVALID, TEXT_CHARSET_INVALID, OUT_OF_PHASE1_SCOPE | Issues of details, each on its field. |
SEFAZ_NO_ANSWER · SEFAZ_UNAVAILABLE | Communication: Arquivix Notas checks or sends again by itself. |
EMIT_INTERRUPTED | The send stopped before reaching the SEFAZ: the note goes out again by itself. If it happens twice in a row, it ends rejected and nothing was transmitted; send it again. |
NFE_SCHEMA_INVALID | The signed XML failed the official schema before the send: nothing reached the SEFAZ and cStat is empty. message names the element. |
The dashboard shows each of these in plain Portuguese or English, with what to do next. Do not rely on the text of message: use code and type.