Building WhatsApp AI Sales & FAQ Bots: Meta Cloud API, Webhooks & Automated Product Catalogs
Connecting large language models to 2 billion WhatsApp users: webhook verification, session state management, and human handoff.

AI & Systems Architect
Principal Artificial Intelligence Engineer, Natelad Agency
Executive & Architectural Key Takeaways
- ✓The official Meta WhatsApp Cloud API eliminates third-party QR code scrapers that risk sudden telephone number bans.
- ✓Webhooks must respond with HTTP 200 within 3 seconds; always process incoming messages asynchronously via background queues (BullMQ/Redis).
- ✓Meta provides a 24-hour customer service window after the user's last message where interactive replies are completely free of charge.
- ✓Interactive list messages and quick-reply buttons have 3x higher conversion rates than unstructured freeform text responses.
- 01.Why WhatsApp is the Premier Commerce Channel in Emerging Markets
- 02.Webhook Verification and Secure Message Dispatcher in Express
- 03.Session State & Interactive Message Templates
Why WhatsApp is the Premier Commerce Channel in Emerging Markets
In Africa, Latin America, and Southeast Asia, WhatsApp is not just a chat app—it is the internet. Over 90% of smartphone users use WhatsApp daily for family, business inquiries, and retail shopping. Businesses that force users to fill out complex website forms lose over 60% of potential leads.
Deploying an automated AI sales agent directly inside WhatsApp allows customers to check real-time inventory, receive quotes, and pay via mobile money in under 60 seconds.
Webhook Verification and Secure Message Dispatcher in Express
Below is a robust Express.js route handler that validates Meta's SHA256 webhook signatures and pushes incoming customer messages onto a Redis queue.
import express from 'express';
import crypto from 'crypto';
const router = express.Router();
// 1. Meta Webhook Verification Challenge
router.get('/webhook', (req, res) => {
const mode = req.query['hub.mode'];
const token = req.query['hub.verify_token'];
const challenge = req.query['hub.challenge'];
if (mode === 'subscribe' && token === process.env.META_VERIFY_TOKEN) {
return res.status(200).send(challenge);
}
return res.sendStatus(403);
});
// 2. Incoming Messages Webhook
router.post('/webhook', express.raw({ type: 'application/json' }), async (req, res) => {
const signature = req.headers['x-hub-signature-256'] as string;
const hmac = crypto.createHmac('sha256', process.env.META_APP_SECRET!);
const digest = 'sha256=' + hmac.update(req.body).digest('hex');
if (signature !== digest) {
return res.status(401).send('Invalid signature');
}
// Acknowledge Meta immediately within 500ms
res.sendStatus(200);
const payload = JSON.parse(req.body.toString());
// Offload to BullMQ worker for LLM inference & catalog lookup
await messageQueue.add('process_whatsapp_msg', payload);
});Session State & Interactive Message Templates
Maintain conversation history in Redis keyed by the customer's E.164 phone number with a 24-hour TTL.
When users ask about pricing or product categories, generate native WhatsApp Interactive List Messages so users can tap and buy with one click.

AI & Systems Architect
Principal Artificial Intelligence Engineer at Natelad Agency. Architecting mission-critical digital systems, resilient infrastructure, and security frameworks for enterprises worldwide.
Related Production Blueprints
View All Blueprints →Engineering Resilient Multi-WAN Networks: Combining Starlink Satellites with Dedicated Fibre
How we design mission-critical telecommunication grids for remote mining, banking, and industrial facilities by pairing high-throughput terrestrial fibre with low-earth-orbit (LEO) satellite redundancy.
Starlink Bypass Mode & MikroTik Integration: The Definitive Commercial Setup Guide
Step-by-step technical guide to putting Starlink Gen 2 and Gen 3 dishes into bypass mode, eliminating double-NAT issues, and configuring enterprise MikroTik routers for commercial offices.
Implement this architecture with Natelad’s dedicated engineering pods.
Book a technical discovery session with our lead architects to evaluate your infrastructure, review security posture, or scope a new platform sprint.