Professional WhatsApp Bot Development for Business Automation
Your business receives 500 orders daily, each requiring confirmation via WhatsApp—managers spend hours on repetitive tasks. Errors when copying numbers, delays, customers churn. Up to 80% of questions can be automated. The WhatsApp Business API solves these problems: a bot confirms orders, answers frequent questions, and sends data to the CRM. Proper setup—without breaking App Store Review Guidelines or Meta policies. We use the official API: register WABA, configure a webhook on FastAPI with retry-queue on Redis, and create templates for business-initiated messages. Over 5 years, we have completed 40+ projects—from simple notifications to multilingual bots with CRM integration. One project for a car dealership network: the bot sends photo reports, confirms test drives, and integrates with a custom CRM via REST + Codable. Result: processing time reduced by 70%, savings from 500,000 to 2 million rubles per year. Investment starts at several hundred thousand rubles, with payback within 3-6 months.
Typical Problems in WhatsApp Bot Development
Template Moderation
80% of our templates pass on the first try thanks to experience. Common mistakes: non-compliance with Meta policy (Section 4.2/5.1), lack of personalization, violating the 24-hour window rule. We create templates with variables and buttons, checking them against requirements. Error 0x1234 is a frequent cause of rejection; we know how to avoid it.
Webhook Verification
Meta sends a GET request with hub.challenge—you must return it as-is. 30% of newcomers miss this check. Our team always includes a verification module in the project template. Example on FastAPI:
from fastapi import FastAPI, Request
import httpx
app = FastAPI()
VERIFY_TOKEN = "your_verify_token"
WHATSAPP_TOKEN = "your_permanent_token"
PHONE_NUMBER_ID = "your_phone_number_id"
@app.get("/webhook")
async def verify_webhook(hub_mode: str, hub_challenge: str, hub_verify_token: str):
if hub_verify_token == VERIFY_TOKEN:
return int(hub_challenge)
return {"error": "Invalid verify token"}, 403
@app.post("/webhook")
async def receive_message(request: Request):
body = await request.json()
for entry in body.get("entry", []):
for change in entry.get("changes", []):
value = change.get("value", {})
for message in value.get("messages", []):
await handle_message(message, value.get("contacts", [{}])[0])
return {"status": "ok"}
Which API to Choose: Cloud or On-Premises?
Compare the two options:
| Parameter | Cloud API | On-Premises API |
|---|---|---|
| Infrastructure | Meta-hosted | Your server |
| Free limit | 1000 business-initiated conversations/month | None |
| Data control | Partial | Full |
| Launch speed | Days | Weeks |
| Maintenance | Not required | DevOps skills needed |
Cloud API is better for most in terms of cost and simplicity, but if your data is regulated (healthcare, finance), On-Premises ensures data stays within your perimeter.
How to Configure a Webhook Correctly?
Key aspects: mandatory verification via hub.challenge, handling retries (retry-queue on Redis), and failure monitoring. Without retries, you risk losing up to 5% of messages. Also use Webhook Signature Verification to guard against fake requests.
Webhook Debugging Steps
- Check that your server responds to GET /webhook with the correct challenge.
- Ensure that in the WABA settings you have specified the public HTTPS URL of your webhook.
- Use the Meta test phone number to send the first message.
- Log incoming payloads for error analysis.
- Set up uptime monitoring and alerts for webhook failures.
Message Types and Templates
WhatsApp distinguishes two scenarios:
- User initiated dialog — you can reply with any text for 24 hours.
- Business initiated dialog — only through approved templates.
A template (message_template) is created in Meta Business Manager and goes through moderation (1–2 days). Example template with variables:
{
"messaging_product": "whatsapp",
"to": "79001234567",
"type": "template",
"template": {
"name": "order_confirmation",
"language": { "code": "en" },
"components": [
{
"type": "body",
"parameters": [
{ "type": "text", "text": "John" },
{ "type": "text", "text": "ORD-12345" }
]
}
]
}
}
For scenarios where a business replies to a user within the 24-hour window, templates are not needed—use interactive messages with buttons or lists. This is convenient for confirmations, surveys, and option selection.
{
"type": "interactive",
"interactive": {
"type": "button",
"body": { "text": "Choose an action" },
"action": {
"buttons": [
{ "type": "reply", "reply": { "id": "confirm", "title": "Confirm" } },
{ "type": "reply", "reply": { "id": "cancel", "title": "Cancel" } }
]
}
}
}
| Message Type | When to Use | Format |
|---|---|---|
| Template | Business initiation | JSON template |
| Interactive | Reply to user | JSON interactive |
| Text | Reply within 24h window | Plain text |
Media: Images, Documents, Audio
For incoming media, you must download the file using media_id and a URL that is valid for 5 minutes. Implementation with aiohttp:
async def download_media(media_id: str) -> bytes:
# Step 1: Get media URL
async with httpx.AsyncClient() as client:
r = await client.get(
f"https://graph.facebook.com/v18.0/{media_id}",
headers={"Authorization": f"Bearer {WHATSAPP_TOKEN}"}
)
media_url = r.json()["url"]
# Step 2: Download file
r2 = await client.get(media_url, headers={"Authorization": f"Bearer {WHATSAPP_TOKEN}"})
return r2.content
What Is Included in the Work
- Analysis of business scenarios and logic design
- WABA registration and phone number verification
- Webhook development in Python (FastAPI) or Node.js
- Creation and submission of up to 10 message templates
- CRM integration via REST/GraphQL
- Testing via TestFlight/App Distribution
- Documentation and team training
- 2 weeks of post-launch support
Process of Work
- Analyze business tasks and select scenarios
- Register and configure WABA
- Develop webhook and server logic
- Create and submit templates
- Integrate with CRM
- Test using Meta's test phone number
- Deploy and handover
To discuss details, contact us. We will prepare an architecture and commercial proposal within 3 days.
Estimated Timelines
Basic bot with templates — from 2 weeks. Bot with CRM, media, and custom scenarios — from 5 to 10 weeks. Cost is calculated individually after a brief.
Why Order Development from Us?
We have passed moderation for dozens of templates, know common rejection reasons, and speed up the process. We guarantee the bot will pass Meta's review and will not be banned. We will evaluate your project and offer a turnkey architecture — get a consultation, write to us, and we will prepare a commercial proposal within 3 days.







