1. NF-e events
  2. Cancel NF-e
POST
/nfe/{nfeId}/cancel
curl --request POST \
     --url https://api.treeunfe.com.br/api/v1/nfe/{nfeId}/cancel \
     --header 'x-api-key: <api-key>' \
     --header 'x-api-key: <x_api_key>' \
     --header 'Content-Type: application/json' \
     --data '{
  "xJust": "<string>"
}'

Registers the cancellation event for an authorized NF-e, within the deadline set by the SEFAZ of the issuer’s state.

​
Authentication

x-api-key
required
string

The organization’s API Key (rawKey).

​
Path parameters

nfeId
required
string

The NF-e’s ID (UUID) at Treeunfe.

​
Body

application/json

xJust
required
string

Reason for the cancellation (15 to 255 characters).

​
Responses

StatusDescription
200Event processed.
400Invalid body (missing required field, wrong format, or field not allowed).
401Credential missing, invalid, or expired.
404Resource not found.
422Cancellation rejected by SEFAZ.
curl -X POST "https://api.treeunfe.com.br/api/v1/nfe/006f917a-21a5-491d-90b4-f745d96385e7/cancel" \
  -H "x-api-key: ORGANIZATION_RAW_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "xJust": "Valor incorreto informado na nota"
  }'