Real-time Webhook
API Integration
Automated Event Notifications
Webhooks are automated messages sent from Chatsvia to your server when specific events occur. Instead of constantly polling our API for updates, webhooks push data to you in real-time.
When a customer places an order through chat, sends a message, or any other event happens, Chatsvia immediately sends an HTTP POST request to your configured endpoint with all the relevant data.
Event Occurs
Customer places an order via chat
Webhook Triggered
Chatsvia sends POST request to your URL
Process Data
Your server handles the order data
Available Webhook Events
Subscribe to the events that matter to your business
How to Integrate Webhooks
Follow these simple steps to start receiving webhook notifications
Create Webhook Endpoint
Set up an HTTP endpoint on your server that can receive POST requests from Chatsvia.
Configure in Dashboard
Go to Settings > Webhooks in your Chatsvia dashboard and add your endpoint URL.
Select Events
Choose which events you want to receive notifications for (orders, messages, etc.).
Verify & Test
Use the test feature to verify your endpoint is receiving webhooks correctly.
Webhook HTTP Headers
Every webhook POST request includes these headers for verification and identification
Content-Typeapplication/jsonRequest body formatX-Webhook-Signaturet=1706698200123,v1=a3f8b2c1d4e5...HMAC-SHA256 signature for verificationX-Webhook-Eventorder.createdThe event type that triggered this webhookX-Webhook-Attempt1Delivery attempt number (1-3)Webhook Payload Structure
Example payloads for each webhook event type
Order Created
Sent when a customer completes an order through the AI chatbot
{
"event": "order.created",
"data": {
"id": "679d3f8a2e1b4c5d6e7f8a9b",
"orderNumber": "ORD-20260131-A1B2",
"customerName": "Rahim Uddin",
"customerPhone": "+8801712345678",
"shippingAddress": "House 12, Road 5, Dhanmondi, Dhaka",
"items": [
{
"productId": "678a1b2c3d4e5f6a7b8c9d0e",
"productName": "Wireless Bluetooth Headphones",
"quantity": 1,
"unitPrice": 1250
},
{
"productId": "678a1b2c3d4e5f6a7b8c9d1f",
"productName": "Phone Case - Black",
"quantity": 2,
"unitPrice": 350
}
],
"subtotal": 1950,
"status": "pending",
"sourceType": "social",
"sourceName": "My Shop - Facebook Page",
"createdAt": "2026-01-31T10:30:00.000Z"
},
"timestamp": "2026-01-31T10:30:01.234Z"
}Order Updated
Sent when an order status is changed (e.g. confirmed, shipped, delivered)
{
"event": "order.updated",
"data": {
"id": "679d3f8a2e1b4c5d6e7f8a9b",
"orderNumber": "ORD-20260131-A1B2",
"customerName": "Rahim Uddin",
"customerPhone": "+8801712345678",
"shippingAddress": "House 12, Road 5, Dhanmondi, Dhaka",
"items": [
{
"productId": "678a1b2c3d4e5f6a7b8c9d0e",
"productName": "Wireless Bluetooth Headphones",
"quantity": 1,
"unitPrice": 1250
},
{
"productId": "678a1b2c3d4e5f6a7b8c9d1f",
"productName": "Phone Case - Black",
"quantity": 2,
"unitPrice": 350
}
],
"subtotal": 1950,
"status": "shipped",
"previousStatus": "confirmed",
"sourceType": "widget",
"sourceName": "chatsvia.iiniit.com",
"createdAt": "2026-01-31T10:30:00.000Z",
"updatedAt": "2026-02-02T14:15:30.000Z"
},
"timestamp": "2026-02-02T14:15:30.456Z"
}Order Cancelled
Sent when an order is cancelled by the customer or an agent
{
"event": "order.cancelled",
"data": {
"id": "679d3f8a2e1b4c5d6e7f8a9b",
"orderNumber": "ORD-20260131-A1B2",
"customerName": "Rahim Uddin",
"customerPhone": "+8801712345678",
"shippingAddress": "House 12, Road 5, Dhanmondi, Dhaka",
"items": [
{
"productId": "678a1b2c3d4e5f6a7b8c9d0e",
"productName": "Wireless Bluetooth Headphones",
"quantity": 1,
"unitPrice": 1250
}
],
"subtotal": 1250,
"status": "cancelled",
"previousStatus": "pending",
"sourceType": "social",
"sourceName": "My Shop - Facebook Page",
"createdAt": "2026-01-31T10:30:00.000Z",
"updatedAt": "2026-02-01T09:45:12.000Z"
},
"timestamp": "2026-02-01T09:45:12.789Z"
}Secure Webhook Delivery
We take security seriously. Every webhook is signed and delivered securely.
const crypto = require('crypto');
function verifyWebhookSignature(payload, signatureHeader, secret) {
// Parse the signature header: "t=timestamp,v1=signature"
const parts = {};
signatureHeader.split(',').forEach(part => {
const [key, value] = part.split('=');
parts[key] = value;
});
const timestamp = parts['t'];
const receivedSignature = parts['v1'];
// Recreate the signed payload: "timestamp.jsonBody"
const signedPayload = `${timestamp}.${JSON.stringify(payload)}`;
const expectedSignature = crypto
.createHmac('sha256', secret)
.update(signedPayload)
.digest('hex');
return crypto.timingSafeEqual(
Buffer.from(receivedSignature),
Buffer.from(expectedSignature)
);
}
// Express.js example
app.post('/webhook', (req, res) => {
const signature = req.headers['x-webhook-signature'];
const event = req.headers['x-webhook-event'];
const attempt = req.headers['x-webhook-attempt'];
const isValid = verifyWebhookSignature(
req.body,
signature,
process.env.WEBHOOK_SECRET
);
if (!isValid) {
return res.status(401).json({ error: 'Invalid signature' });
}
// Process the webhook event
const { data } = req.body;
switch (event) {
case 'order.created':
handleNewOrder(data);
break;
case 'order.updated':
handleOrderUpdate(data);
break;
case 'order.cancelled':
handleOrderCancelled(data);
break;
}
res.status(200).json({ received: true });
});What Can You Build?
Webhooks enable powerful integrations with your existing systems
Ready to Integrate?
Start receiving real-time webhook notifications for your Chatsvia account. Set up takes just a few minutes.