Learn how to hook Docdril CRM endpoints and payment event streams to external services. Integrate Stripe transaction webhooks to capture retainer renewals and dispatch Slack channel alerts automatically.
Always validate incoming payload signatures with your webhook secret to prevent header spoofing attacks.
import crypto from 'crypto';
export function verifySignature(payload: string, sigHeader: string, secret: string) {
const hash = crypto
.createHmac('sha256', secret)
.update(payload)
.digest('hex');
return hash === sigHeader;
}Parse incoming fields and map them to your database schema models. Store identifiers for transaction logs.
const { id, amount, customer, status } = payload.data.object;
const logEntry = {
invoiceId: id,
usdAmount: amount / 100,
clientRef: customer,
timestamp: new Date().toISOString()
};Automatically post a notification containing deal size and contract files to your team sales channel whenever a client signs a project scope proposal.