Webhooks
BraidPay Webhooks Documentation
Overview
Setting Up Webhooks
Security
const crypto = require('crypto')
function verifyWebhookSignature(secret, toAddress, amount, signature) {
const expectedSignature = crypto
.createHmac('sha256', secret)
.update(`${toAddress}${amount}`)
.digest('hex')
return signature === expectedSignature
}
// Example usage:
app.post('/webhook', (req, res) => {
const signature = req.headers['x-webhook-signature']
const { toAddress, amount } = req.body
const webhookSecret = process.env.WEBHOOK_SECRET
if (!verifyWebhookSignature(webhookSecret, toAddress, amount, signature)) {
return res.status(401).json({ error: 'Invalid signature' })
}
// Process webhook...
res.json({ received: true })
})Webhook Payload
Field Descriptions
Retry Policy
Best Practices
Testing Webhooks
Support
Last updated