The Tax ID Validation API sends a webhook to your endpoint when a validation finishes. The webhook is a notification only: it carries the validation id, and you read the result with Get a Tax ID Validation.
Events:
succeeded: the validation finished and the result is available.failed: the validation could not be completed. Readerrorswith Get a Tax ID Validation.
in_process is never sent as a webhook. A validation starts in that status, and you get it in the response of the POST.
Each webhook includes id, the validation id (tiv2-...). Use it with Get a Tax ID Validation to retrieve the result.
Delivery
- Brinta sends a
POSTwith a JSON body to the URL configured for thetax_id_validationwebhook. - Header
Webhook-Key: the secret key configured for that webhook. Compare it with your own value to confirm the request comes from Brinta. - Respond with a
2xxstatus. Any other response, or a connection error, is retried 3 times, 500 ms apart. After that the webhook is not sent again, and the result is still available with Get a Tax ID Validation. - Redirects are not followed. Use the final URL of your endpoint.
Examples of webhooks
{
"resource": "tax_id_validation",
"event": "succeeded",
"data": {
"id": "tiv2-dd587833-0b57-41fc-966d-d79be3933397"
}
}{
"resource": "tax_id_validation",
"event": "failed",
"data": {
"id": "tiv2-188be839-bd78-4692-9fd4-53e67e2d28bc"
}
}POST /your-webhook-endpoint HTTP/1.1
Content-Type: application/json
Webhook-Key: <your webhook secret key>