Ressourcen / Webhooks

Real-Time Event Notifications

Receive instant notifications when events happen in your Laabam account

Real-Time

Get notified instantly when events occur

Reliable

Automatic retries with exponential backoff

Monitored

Track delivery status and debug issues

Available Events

invoice.created

Triggered when a new invoice is created

Example Payload:

{
  "invoice_id": "inv_123",
  "status": "draft",
  "amount": 50000
}
invoice.paid

Triggered when an invoice payment is received

Example Payload:

{
  "invoice_id": "inv_123",
  "payment_id": "pay_456",
  "amount": 50000
}
customer.created

Triggered when a new customer is added

Example Payload:

{
  "customer_id": "cust_789",
  "name": "John Doe",
  "email": "john@example.com"
}
payment.failed

Triggered when a payment attempt fails

Example Payload:

{
  "payment_id": "pay_456",
  "reason": "insufficient_funds"
}

Implementation Example

Here's how to handle webhooks in your application:

// Webhook endpoint example (Node.js/Express)
const express = require('express');
const app = express();

app.post('/webhooks/laabam', express.json(), (req, res) => {
  const event = req.body;
  
  // Verify webhook signature
  const signature = req.headers['x-laabam-signature'];
  if (!verifySignature(signature, req.body)) {
    return res.status(401).send('Invalid signature');
  }
  
  // Handle different event types
  switch (event.type) {
    case 'invoice.created':
      console.log('New invoice:', event.data.invoice_id);
      // Your business logic here
      break;
      
    case 'invoice.paid':
      console.log('Payment received:', event.data.payment_id);
      // Update your database, send email, etc.
      break;
  }
  
  res.status(200).send('Webhook received');
});

Your Webhooks

https://api.yoursite.com/webhooks/laabam
ACTIVE
invoice.createdinvoice.paid

Last Delivery

2 minutes ago

Success Rate

99.8%

https://staging.yoursite.com/webhooks
ACTIVE
customer.createdpayment.failed

Last Delivery

15 minutes ago

Success Rate

100%

Webhook Best Practices

  • Always verify webhook signatures to ensure authenticity
  • Return 200 status code quickly to acknowledge receipt
  • Process webhook data asynchronously in a queue
  • Use HTTPS endpoints to ensure data security
  • Implement idempotency to handle duplicate events

Start Using Webhooks

Build real-time integrations with Laabam webhooks