TF Fiscal
Documentation

Webhooks

Register webhook

Registers or updates the callback URL that receives issuance results and other events.

POST/openapi/v1/webhooks
Requires the token, timestamp and sign signature headers, see Authentication.

One callback configuration per application: webHookId is the application identifier and calling again overwrites the configuration. It is the same configuration edited in the console: registering here or saving there has the same effect, the latest save wins, and the callback format depends only on the event type. Calling the registration again also restores delivery after the consecutive-failure circuit breaker switched the webhook off. The delivery model, signature verification and retry policy are in Webhooks.

Request body

id*
required for update
stringWebhook identifier
uri*
stringCallback URL
contentType*
stringCallback body format
token*
stringVerification token
eventos
arraySubscribed events

* Required field

200
Configuration saved.
webHookId
stringWebhook identifier

The platform POSTs to uri with a JSON body (Content-Type: application/json; charset=utf-8). An HTTP 2xx within 10 seconds counts as delivered; anything else is retried after 1 min, 5 min, 30 min, 2 h and 6 h. Ten consecutive failures switch the webhook off; calling this registration again restores delivery and resets the counter. Signature verification samples in Node.js and Java are in Webhooks.

Headers on every delivery

Deduplicate on the event id and verify the signature over the raw body bytes.

json
{
"Content-Type": "application/json; charset=utf-8",
"X-Tffiscal-Event": "invoice.authorized",
"X-Tffiscal-Event-Id": "1950000000000001",
"X-Tffiscal-Delivery-Id": "1950000000000002",
"X-Tffiscal-Timestamp": "1758200000",
"X-Tffiscal-Signature": "9f2c...e1",
"token": "dGt6eXp5ZGRra2tzc3Nra2hoaGFha2tha2FhamFoaGFoNzc3Nz",
"x-token": "dGt6eXp5ZGRra2tzc3Nra2hoaGFha2tha2FhamFoaGFoNzc3Nz"
}
X-Tffiscal-Event*
stringEvent code
X-Tffiscal-Event-Id*
stringEvent id
X-Tffiscal-Delivery-Id*
stringDelivery id
X-Tffiscal-Timestamp*
stringSignature timestamp
X-Tffiscal-Signature*
stringSignature
token*
when a token is set
stringVerification token
x-token*
when a token is set
stringToken copy

* Required field