NF-e
Cancel NF-e
Cancels an authorized invoice within 24 hours of authorization.
POST
/openapi/v2/empresas/{empresaId}/nf-e/{nfeId}/cancelarRequires 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.
Path parameters
empresaId* | string | Company identifier |
nfeId* | string | Invoice identifier |
* Required field
200
Cancellation registered with SEFAZ; no body.
No response body
Autorizadainvoices only; any other status returns10004012.- Up to 24 hours after authorization; some states allow more, per platform configuration. Outside the window returns
10004013, and only a return invoice can be issued instead. - The call is synchronous: HTTP 200 only after SEFAZ registers the cancellation. A SEFAZ refusal returns
10004014with the reason. - Correction letters already registered remain queryable after cancellation, see List correction letters.
| Code | HTTP | |
|---|---|---|
| 10004000 | 404 | The nfeId does not exist. Check the id sent at issuance and the empresaId. |
| 10004001 | 404 | The nfeId does not exist. Check the id sent at issuance and the empresaId. |
| 10003000 | 404 | empresaId does not exist or does not belong to this application. |
| 10004012 | 400 | Invoice not in Autorizada status. Query to confirm the status. |
| 10004013 | 400 | Outside the 24-hour window. Issue a return invoice instead. |
| 10004014 | 400 | Refused by SEFAZ; the message carries the status code and reason. Act on the reason. |
