v1

latestOpenAPI 3.1.0Proprietary2026-07-24710198.3 KB
DC-e

Cancel a DC-e

Cancel an existing DC-e (Declaração de Conteúdo Eletrônica) in the Brazilian fiscal system. The DC-e must have been previously authorized.

When to use: Call this endpoint when you need to cancel a previously issued DC-e — for example, if the shipment was cancelled or the declaration was issued in error.

Prerequisites:

  • Valid JWT authentication token (Bearer)
  • The 44-digit DC-e access key (dceKey) from the original DC-e authorization

Key behaviors:

  • Returns the cancellation status from SEFAZ (Brazilian tax authority)
  • The cStat field indicates the result: 135 means cancellation was approved
  • Once cancelled, the DC-e cannot be reused
  • The nProt field contains the cancellation protocol number for record-keeping
post/dce/cancelar

Request body

dceKeystring required

The 44-digit DC-e access key from the original authorization

Example request

{
  "dceKey": "35260440728044000157990010000003741101480600"
}

Response

Successful DC-e cancellation

successboolean

Whether the cancellation request was successful

tpAmbstring

Environment type: 1 = Production, 2 = Homologation (testing)

verAplicstring

Version of the SEFAZ application that processed the request

cOrgaostring

IBGE code of the issuing state

cStatstring

Status code from SEFAZ. 135 = Cancellation approved

xMotivostring

Human-readable reason for the status

chDCestring

The 44-digit DC-e access key that was cancelled

tpEventostring

Event type code. 110111 = Cancellation

xEventostring

Event name

nSeqEventostring

Sequence number of the event

dhRegEventostring date-time

Date and time when the event was registered at SEFAZ

nProtstring

Protocol number of the cancellation for record-keeping

Example response

{
  "tpAmb": "2",
  "verAplic": "PR-v0.13.0",
  "cOrgao": "35",
  "cStat": "135",
  "xMotivo": "Cancelamento homologado",
  "chDCe": "35260440728044000157990010000003741101480600",
  "tpEvento": "110111",
  "xEvento": "Cancelamento",
  "nSeqEvento": "1",
  "dhRegEvento": "2026-04-06T20:42:03-03:00",
  "nProt": "3352600000044171"
}