Webhooks allow you to receive real-time notifications when domain monitoring events occur, eliminating the need for polling. The API will automatically push events to your registered webhook.
Managing Webhook Endpoints
Webhook endpoints are created and deleted by PayShield upon request (contact your PayShield Account Manager)
Only one webhook endpoint is supported per account
{
"message": "Webhook secret regenerated successfully",
"warning": "Store the new secret securely. It will not be shown again.",
"data": {
"secret": "whsec_new123..."
}
}
{
"event": "business-closed",
"description": "Business appears to be closed based on verification data",
"timestamp": "2024-01-15T10:30:00.000Z",
"data": {
"domainId": "550e8400-e29b-41d4-a716-446655440000",
"domain": "example.com",
"status": "active",
"provider": "truebiz"
}
}
curl -X GET "{baseurl}/api/v1/user-webhooks/{id}/deliveries?limit=50" \
-H "Authorization: Bearer <token>"
curl -X GET "{baseurl}/api/v1/user-webhooks/deliveries?status=failed&limit=100" \
-H "Authorization: Bearer <token>"
function verifyWebhookSignature(payload, signature, secret) {
const hmac = crypto.createHmac('sha256', secret);
hmac.update(JSON.stringify(payload));
const expectedSignature = `sha256=${hmac.digest('hex')}`;
// Use timing-safe comparison to prevent timing attacks
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(expectedSignature)
);
}