Developer Integration

Real-time Webhook API Integration

Integrate Chatsvia with your existing systems. Receive real-time notifications for orders, messages, and conversations directly to your server.

What are Webhooks?

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.

Real-timeSecureReliable
How It Works
1

Event Occurs

Customer places an order via chat

2

Webhook Triggered

Chatsvia sends POST request to your URL

3

Process Data

Your server handles the order data

Events

Available Webhook Events

Subscribe to the events that matter to your business

order.created
Triggered when a new order is placed through the AI chatbot
order.updated
Triggered when an order status changes (confirmed, shipped, delivered, etc.)
order.cancelled
Triggered when an order is cancelled by the customer or agent
Integration Guide

How to Integrate Webhooks

Follow these simple steps to start receiving webhook notifications

1

Create Webhook Endpoint

Set up an HTTP endpoint on your server that can receive POST requests from Chatsvia.

2

Configure in Dashboard

Go to Settings > Webhooks in your Chatsvia dashboard and add your endpoint URL.

3

Select Events

Choose which events you want to receive notifications for (orders, messages, etc.).

4

Verify & Test

Use the test feature to verify your endpoint is receiving webhooks correctly.

Request Format

Webhook HTTP Headers

Every webhook POST request includes these headers for verification and identification

HTTP Headers
Content-Typeapplication/jsonRequest body format
X-Webhook-Signaturet=1706698200123,v1=a3f8b2c1d4e5...HMAC-SHA256 signature for verification
X-Webhook-Eventorder.createdThe event type that triggered this webhook
X-Webhook-Attempt1Delivery attempt number (1-3)
Payload Examples

Webhook Payload Structure

Example payloads for each webhook event type

Order Created

Sent when a customer completes an order through the AI chatbot

order.created
{
  "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)

order.updated
{
  "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

order.cancelled
{
  "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"
}
Security

Secure Webhook Delivery

We take security seriously. Every webhook is signed and delivered securely.

Signature Verification
Each webhook includes a signature header that you can verify to ensure authenticity.
HTTPS Required
All webhook endpoints must use HTTPS to ensure secure data transmission.
Retry Logic
Failed webhooks are automatically retried up to 3 times with exponential backoff.
Timeout Handling
Your endpoint should respond within 30 seconds to avoid timeout errors.
Signature Verification Example (Node.js)
JavaScript
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 });
});
Use Cases

What Can You Build?

Webhooks enable powerful integrations with your existing systems

Sync Orders to ERP
Automatically sync new orders to your ERP or inventory management system.
CRM Integration
Update customer records in your CRM when new conversations or orders occur.
Shipping Automation
Trigger shipping label creation and tracking when orders are confirmed.
Analytics & Reporting
Send events to your analytics platform for real-time dashboards.
Team Notifications
Send Slack or email alerts when important events occur.
Custom Workflows
Build custom automation workflows with tools like Zapier or n8n.

Ready to Integrate?

Start receiving real-time webhook notifications for your Chatsvia account. Set up takes just a few minutes.