We use cookies and similar technologies, including Google Analytics and the Meta Pixel, to improve your experience, measure site traffic and understand signup campaigns. By clicking "Accept", you agree to this use.

Learn more about our privacy practices
Corvo
Português

NF-e: cancel, correct and inutilize

Cancel an authorized NF-e, send correction letters (CC-e), inutilize numbers and find skipped numbers.

Cancel

POST /v1/invoices/:id/cancel

curl -X POST https://api.corvo.tech/v1/invoices/$ID/cancel \
  -H "X-API-Key: $CORVO_API_KEY" -H "Content-Type: application/json" \
  -d '{ "justification": "Pedido cancelado pelo cliente antes da entrega" }'

The justification has 15 to 255 characters (JUSTIFICATION_LENGTH). The answer is 202 with cancelling; when the SEFAZ registers the event the note becomes cancelled and the webhook nfe.document.cancelled is sent. The SEFAZ has a deadline for cancelling: past it, you see its refusal as it comes. Credit is not given back for a note that was already authorized.

Correction letter (CC-e)

POST /v1/invoices/:id/corrections

curl -X POST https://api.corvo.tech/v1/invoices/$ID/corrections \
  -H "X-API-Key: $CORVO_API_KEY" -H "Content-Type: application/json" \
  -d '{ "correction": "Corrigir o endereço de entrega para Rua das Flores, 20" }'
  • 15 to 1000 characters (CORRECTION_LENGTH). Up to 20 letters per note (CORRECTION_LIMIT_REACHED); each one has a sequence.
  • It fixes text. It **cannot** change amounts, taxes, the parties (issuer and recipient) or the dates.
  • The note stays authorized; the letter appears in GET /v1/invoices/:id/events and the webhook nfe.document.corrected is sent.

Inutilize numbers and skipped numbers

NF-e numbers must follow in sequence. When a number will never be used (for example the one of a discarded note), tell the SEFAZ with an inutilization. GET /v1/invoices/number-gaps?type=nfe lists the gaps per company and series; Corvo also checks it every day.

POST /v1/invoices/inutilizations

curl -X POST https://api.corvo.tech/v1/invoices/inutilizations \
  -H "X-API-Key: $CORVO_API_KEY" -H "Idempotency-Key: inut-2026-11-001" -H "Content-Type: application/json" \
  -d '{ "type": "nfe", "companyId": "'$COMPANY_ID'", "series": 1, "start": 10, "end": 12,
        "justification": "Numeração pulada por falha do sistema emissor" }'
  • type is required. The justification has 15 to 255 characters. The range is from 1 to 999999999, with the start before the end.
  • A range with a note that was not discarded answers INUTILIZATION_RANGE_IN_USE: discard the note first. Two requests on the same numbers answer INUTILIZATION_RANGE_OVERLAP.
  • One request voids at most 1000 numbers (INUTILIZATION_RANGE_TOO_LARGE), and the range may not start more than 1000 numbers after the last number used (INUTILIZATION_RANGE_TOO_FAR): split a large gap into several requests.
  • Inutilizing above the last number also moves the counter, so the next NF-e takes the number after the range. The result (pending, then homologada or rejected) is in GET /v1/invoices/inutilizations and in the webhooks nfe.inutilization.completed and nfe.inutilization.rejected.