Complete guide to integrate your organizer system with Akal's webhook infrastructure
Comprehensive guides for integrating with Akal's systems
Step-by-step guide to integrate your organizer system with Akal's webhook system
Set your webhook URL in school settings under the webhook configuration section.
Create a secure verification token to authenticate incoming webhook requests.
Configure which services should trigger webhook notifications. You can enable it on service's dashboard.
{
"event": "transaction.updated",
"data": {
"id": "transaction_cuid",
"paymentId": "payment_123",
"status": "PAID",
"amount": 150000,
"schoolId": "muslimbootstrap",
"user": {
"name": "John Doe",
"email": "john@example.com",
"phone": "62812345678"
},
"service": {
"id": "class_cuid",
"name": "Class Name"
},
"priceScheme": {
"id": "price_scheme_cuid",
"name": "Price Scheme Name",
"price": 150000
},
"crossSales": [
{
"id": "cross_sale_cuid",
"name": "Additional Course",
"price": 50000
}
],
"createdAt": "2024-01-24T08:00:00.000Z",
"paidAt": "2024-01-24T08:12:00.000Z",
},
"idempotencyKey": "idempotency-key",
"token": "verification_token"
}"transaction.updated" - sent when transaction status changes (currently when transaction is paid)"PAID" - indicates transaction has been paid successfullyUnderstanding authentication mechanisms and securing your webhook endpoints
All webhook requests include a verification token that you can use to authenticate the request is from Akal.
// Verify webhook token
const receivedToken = req.body.token;
const expectedToken = 'your_stored_token';
if (receivedToken !== expectedToken) {
return res.status(401).json({ error: 'Invalid token' });
}
// Process webhook data
console.log('Webhook verified:', req.body.data);Always use HTTPS endpoints for your webhook URLs to encrypt data in transit.
Handle duplicate webhook deliveries by checking if you've already processed the transaction ID.
Return 2xx status codes for successful processing and 4xx/5xx for failures to trigger retry logic.
Check out our complete API documentation or contact our support team for assistance with your integration.