Skip to content

Webhooks

Register a HTTPS endpoint in the dashboard. FinStack will POST JSON events to it:

{
"id": "01927b3e-...",
"type": "payment.captured",
"tenant_id": "...",
"created_at": "2026-06-01T00:00:00Z",
"data": {
"payment": { ... }
}
}

Every request carries an X-FinStack-Signature header. Verify it before processing:

import { createHmac, timingSafeEqual } from 'crypto';
function verifyWebhook(payload: string, signature: string, secret: string): boolean {
const expected = createHmac('sha256', secret)
.update(payload)
.digest('hex');
return timingSafeEqual(
Buffer.from(signature, 'hex'),
Buffer.from(expected, 'hex'),
);
}

Always use a constant-time comparison — === is vulnerable to timing attacks.

FinStack retries failed deliveries up to 3 times with exponential backoff: 1 min, 5 min, 30 min. An endpoint is considered failed if it returns a non-2xx status or times out after 30 seconds.

EventTrigger
payment.createdNew payment
payment.capturedPayment captured
payment.cancelledPayment cancelled
payment.refundedFull or partial refund
customer.createdNew customer
customer.updatedCustomer profile updated