Webhooks
Receive real-time notifications about events in your Cobalz account. Webhooks allow you to build reactive systems that respond instantly to payment events.
How webhooks work
Event occurs
A payment is processed, a merchant is onboarded, or a dispute is filed.
Payload sent
Cobalz sends a JSON payload to your configured webhook endpoint.
You process
Your application receives the event and takes appropriate action.
Available events
account.createdaccount.updatedpayment_intent.succeededpayment_intent.payment_failedpayout.createdpayout.paiddispute.createdrefund.createdHandling webhooks
// Express webhook handler
app.post('/webhooks', (req, res) => {
const event = req.body;
switch (event.type) {
case 'payment_intent.succeeded':
// Handle successful payment
console.log('Payment succeeded:', event.data.id);
break;
case 'account.updated':
// Handle account update
console.log('Account updated:', event.data.id);
break;
default:
console.log('Unhandled event:', event.type);
}
res.json({ received: true });
});