Skip to main content
DELETE
Cancel a tax document
Cancellation is asynchronous. The document you get back has the status REQUESTINGCANCELLATION; it later moves to CANCELED, or to CANCELLATIONDENIED when the city hall refuses the cancellation (the document then stays valid). Follow it in List tax documents. A document that is still being authorized cannot be cancelled yet. If the tax provider rejects the cancellation, the error is returned with the provider’s error code and a status of 400, 409, 422 or 502.

Path Parameters

realmId
string<uuid>
required

ID of your realm.

Format: UUID

organizationId
string<uuid>
required

ID of the organization that owns the tax document.

Format: UUID

taxDocumentId
string<uuid>
required

ID of the tax document to cancel.

Format: UUID

Response

Successful response

A tax document (NFSe) of your organization.

id
string<uuid>
required

ID of the tax document.

Example:

"3d6f9a2b-1c4e-4f8a-9b7d-5e2c1a0f8b63"

realm
string<uuid>
required

ID of the realm the document belongs to.

Example:

"f495ff0c-ab54-4f99-8e92-ca8682e4de9b"

organization
string<uuid>
required

ID of the organization the document belongs to.

Example:

"c4bd3f21-dfbd-44e8-8055-68ba15bed410"

taxIssuer
string<uuid>
required

ID of the tax issuer that issued the document.

Example:

"9b2f4c1e-7a3d-4e8b-b6f0-2d5c8a1e3f47"

environment
enum<string>
required

LIVE for a real document, TEST for a homologation document with no fiscal value.

Available options:
LIVE,
TEST
Example:

"LIVE"

rpsNumber
required

Number of the RPS (provisional service receipt). A number once it has been assigned, and an empty string ("") before that.

Example:

1042

rpsSeries
string
required

Series of the RPS. An empty string ("") until it has been assigned.

Example:

"1"

nfseNumber
required

Number of the NFSe given by the city hall. A number once the document is AUTHORIZED, and an empty string ("") before that.

Example:

2874

type
enum<string>
required

Type of the document.

Available options:
NFSE
Example:

"NFSE"

competenceDate
string<date-time>
required

Competence date of the document.

Example:

"2026-10-01T00:00:00.000Z"

customer
object
required

The customer (service taker) of the document. An empty object when there is none.

service
object
required

The service the document bills. An empty object when there is none.

deductions
number
required

Deductions, in reais.

Example:

0

discounts
number
required

Discounts, in reais.

Example:

0

totalValue
number
required

Total value of the document, in reais.

Example:

1500.5

status
enum<string>
required

Current status of the document. A document is created as WAITINGFORAUTHORIZATION and moves on its own: the authorization states (REQUESTINGAUTHORIZATION, AUTHORIZATIONREQUESTED, AUTHORIZATIONPROCESS, AWAITINGFILEGENERATION) end in AUTHORIZED or DENIED; after you cancel it, the cancellation states (REQUESTINGCANCELLATION, CANCELLATIONREQUESTED, CANCELLATIONPROCESS, AWAITINGFILECANCELATION) end in CANCELED or CANCELLATIONDENIED.

Available options:
WAITINGFORAUTHORIZATION,
REQUESTINGAUTHORIZATION,
AUTHORIZATIONREQUESTED,
AUTHORIZATIONPROCESS,
AWAITINGFILEGENERATION,
AUTHORIZED,
DENIED,
REQUESTINGCANCELLATION,
CANCELLATIONREQUESTED,
CANCELLATIONPROCESS,
AWAITINGFILECANCELATION,
CANCELED,
CANCELLATIONDENIED
Example:

"REQUESTINGCANCELLATION"

errorMessage
string
required

Reason the tax provider or the city hall gave when the document was denied. An empty string ("") when there is none.

Example:

""

operationNature
string

Nature of the operation, as sent when the document was issued.

Example:

"Prestação de Serviços"

observation
string

Free text printed on the document. Omitted when none was sent.

Example:

"Referente ao contrato 1234"

issuedAt
string<date-time>

When the document was issued, that is, when your request created it.

Example:

"2026-10-01T13:45:12.000Z"

issuedBy
string

ID of the user, or of the API client, that issued the document.

Example:

"e3553bc1-5e20-4e17-b22a-a796fda0aa99"

externalId
string

The externalId you sent when you issued the document. Omitted when you sent none.

Example:

"6f1b7c52-8a4e-4d3f-9c21-b0e5a7d84c19"