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. Corvo 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 Corvo 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 Corvo yet (today only SP). 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, PAYMENTS_TOTAL_MISMATCH, TEXT_CHARSET_INVALID, OUT_OF_PHASE1_SCOPE | Issues of details, each on its field. |
SEFAZ_NO_ANSWER · SEFAZ_UNAVAILABLE | Communication: Corvo checks or sends again by itself. |
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.