NFC-e
Cancel by substitution
Cancels the normal NFC-e that was duplicated by an offline contingency NFC-e for the same sale.
POST
/openapi/v2/empresas/{empresaId}/nfce/{nfceId}/cancelar-substituicaoRequires the
token, timestamp and sign signature headers, see Authentication.Typical case: the normal invoice was sent, SEFAZ did not answer and the till issued an offline invoice; later both ended up valid. This endpoint cancels the normal invoice identified by nfceId and points to the offline invoice that replaces it. The platform already settles most of these cases on its own when SEFAZ is back; use this endpoint for special cases. Deadline: 168 hours after authorization.
Path parameters
empresaId* | string | Issuing company identifier |
nfceId* | string | NFC-e identifier |
* Required field
Request body
chaveAcessoSubstituta* | string | Key of the replacing invoice |
justificativa* | string | Cancellation reason |
* Required field
200
Accepted; no body. The result arrives by webhook and shows in the query.
No response body
| Code | HTTP | |
|---|---|---|
| 10022006 | 404 | nfceId not found for this company. |
| 10003000 | 404 | empresaId not found. |
| 10022008 | 400 | Status does not allow it: the invoice is not Autorizada, or a cancellation is already in progress. |
| 10022004 | 400 | The nfceId invoice is not a normal one, or the replacing key is not an offline NFC-e from the same company. |
| 10022007 | 400 | 168-hour deadline passed. |
| 10001001 | 400 | Field validation; mensagem points to the field. |
