NF-e
Cancel NF-e
Cancels an authorized invoice within 24 hours of authorization.
/openapi/v2/empresas/{empresaId}/nf-e/{nfeId}Requires the token, timestamp and sign signature headers, see Authentication.
Cancels an authorized invoice; success is HTTP 200 with no body, and the query endpoint then returns Cancelada. Authentication errors (10009xxx) are listed under Authentication.
Parameters
Path parameters
empresaIdstringrequiredCompany identifier returned by Register company.
Example:1934811222334455nfeIdstringrequiredThe
idsent at issuance.Example:NFe-000014553
Responses
Cancellation registered with SEFAZ; no body.
No response body
Errors
| Code | HTTP | |
|---|---|---|
| NFe0001 | 404 | The |
| 10003000 | 404 |
|
| 10004012 | 400 | Invoice not in authorized status. Query to confirm the status. |
| 10004013 | 400 | Outside the 24-hour window. Issue a return invoice instead. |
| 10004014 | 400 | Refused by SEFAZ (status code and reason attached). Act on the SEFAZ reason. |
Rules
- Only
Autorizadainvoices can be cancelled; other statuses return10004012. - Within 24 hours of authorization (some states allow more, per platform configuration); outside the window returns
10004013, and only a return invoice can be issued instead. - A SEFAZ refusal returns
10004014with the SEFAZ status code and reason. - Unknown
nfeIdreturns HTTP 404 +NFe0001. - Correction letters already registered remain queryable after cancellation, see List correction letters.
