Webhooks
Webhooks let you receive validation results asynchronously. Instead of blocking your application on a VIES, HMRC, or BFS lookup, submit the request and get the result delivered to your endpoint when it is ready. Available on Pro and Business plans. Vatly signs every webhook delivery with HMAC-SHA256 so you can verify it came from Vatly.Setup
- Configure your webhook URL in the dashboard or via the API (
PUT /v1/webhooks/config) - Your endpoint must accept HTTPS POST requests
- Your endpoint should return 2xx within 10 seconds
- Vatly logs every delivery attempt. You can view delivery history and replay failed deliveries from the dashboard.
Event types
| Event | Description |
|---|---|
validation.completed | A single async validation finished successfully |
validation.failed | A single async validation failed after all retry attempts |
batch.completed | All items in an async batch have been processed |
test | Sent when you click “Send test event” in the dashboard |
Event payloads
validation.completed
validation.failed
batch.completed
test
Verifying signatures
Every delivery includes these headers:X-Vatly-Signature:sha256=<hex digest>X-Vatly-Timestamp: Unix timestamp (seconds)X-Vatly-Event: event typeX-Vatly-Delivery-Id: unique delivery identifier
{timestamp}.{body} using your signing secret.
Always verify signatures before processing webhooks. Check the timestamp is within 5 minutes to prevent replay attacks.
Retry behavior
If your endpoint returns non-2xx or times out, the delivery is logged as failed. You can replay failed deliveries from the dashboard. The underlying async validation itself is retried separately. If VIES or another upstream service is down, Vatly retries the validation up to 5 times over several hours before marking it as failed and sending avalidation.failed webhook.
Webhook delivery and validation retries are independent. A failed delivery does not trigger a re-validation.
Best practices
- Return 2xx quickly. Do heavy processing in the background after acknowledging the webhook.
- Verify signatures on every request. Never trust unverified payloads.
- Handle duplicate deliveries gracefully. Replays send the same payload with a new delivery ID.
- Store the
X-Vatly-Delivery-Idheader for debugging and deduplication.
SDK support for async validation and webhook verification is coming soon. For now, use the REST API directly.