In this blog, we explain WhatsApp Cloud API setup step by step, including:
- Meta setup
- Phone number configuration
- Webhook setup
- PHP code example
- Common mistakes to avoid


💡 What is WhatsApp Cloud API?
WhatsApp Cloud API is an official API provided by Meta Platforms that allows businesses to:
- Send WhatsApp messages programmatically
- Receive messages via webhook
- Build chatbots
- Automate notifications
- Integrate with PHP, CRM, ERP, Billing, HRM
No third-party gateway required.
✅ Requirements Before Setup
Before starting, make sure you have:
- Facebook / Meta account
- Business Manager access
- PHP hosting (with HTTPS)
- Domain or server (cPanel / VPS)
- Basic PHP knowledge
🧩 STEP 1: Create Meta App & Enable WhatsApp
- Go to developers.facebook.com
- Click Create App
- Choose Business app type
- Add WhatsApp product
- Select Cloud API
Meta will auto-create:
- WhatsApp Business Account (WABA)
- Test phone number (⚠️ only for testing)
👉 Do NOT use test number for production
📱 STEP 2: Add Real Phone Number (Very Important)
Many people make mistake here.
❌ Wrong
- Using test phone number only
✅ Correct
- Go to business.facebook.com
- Business Settings → WhatsApp Accounts
- Open your WhatsApp account
- Add real phone number
- Verify OTP
- Assign number to Cloud API
This step is mandatory for live messaging.


💳 STEP 3: Add Billing Method (Avoid Error 131042)
WhatsApp Cloud API requires billing eligibility.
- Business Settings → Payments
- Add debit/credit card or UPI
- Save & activate
Without this, messages will fail with:
❌ Billing Eligibility Error – 131042
🔐 STEP 4: Get Access Token & Phone Number ID
From Meta Developer Dashboard:
- Copy Permanent Access Token
- Copy Phone Number ID
- Copy WhatsApp Business Account ID
These are required in PHP code.
🌐 STEP 5: Setup Webhook URL (PHP)
Webhook is used to receive incoming WhatsApp messages.
Example Webhook URL:
https://yourdomain.com/whatsapp_webhook.php
Webhook Verification (PHP)
<?php $verify_token = "anjok_verify_token"; if ($_GET['hub_verify_token'] === $verify_token) { echo $_GET['hub_challenge']; } ?>
Add this URL in:
Meta Dashboard → WhatsApp → Configuration → Webhooks
📩 STEP 6: Receive WhatsApp Messages (PHP Webhook)
<?php $input = file_get_contents("php://input"); file_put_contents("log.txt", $input, FILE_APPEND); $data = json_decode($input, true); $message = $data['entry'][0]['changes'][0]['value']['messages'][0]['text']['body'] ?? ''; $from = $data['entry'][0]['changes'][0]['value']['messages'][0]['from'] ?? ''; if ($message) { // process message here } ?>
Now your PHP app can receive WhatsApp messages.
📤 STEP 7: Send WhatsApp Message Using PHP
$token = "YOUR_ACCESS_TOKEN"; $phone_id = "YOUR_PHONE_NUMBER_ID"; $data = [ "messaging_product" => "whatsapp", "to" => "91XXXXXXXXXX", "text" => ["body" => "Hello from Anjok Technologies"] ]; $ch = curl_init("https://graph.facebook.com/v18.0/$phone_id/messages"); curl_setopt($ch, CURLOPT_HTTPHEADER, [ "Authorization: Bearer $token", "Content-Type: application/json" ]); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch);
Message sent successfully 🎉
🧠 STEP 8: Templates for Business Messages
For:
- Offers
- Notifications
- Reminders
You must:
- Create message templates
- Get Meta approval
- Then use them in API
We help with template approval also.
⚠️ Common Mistakes to Avoid
❌ Using test number in production
❌ Not adding payment method
❌ Webhook not HTTPS
❌ Token expired
❌ Wrong phone number ID
90% WhatsApp API issues come from setup mistakes.
🏢 How Anjok Technologies Helps
At Anjok Technologies, we provide:
✔ WhatsApp Cloud API full setup
✔ PHP webhook development
✔ Chatbot creation
✔ Bulk messaging system
✔ CRM / ERP / Billing integration
✔ Billing & error fixing (131042, webhook issues)
✔ Tamil + English chatbot support
We don’t just explain — we implement.
📞 Contact Anjok Technologies
📱 +91 80729 70517
🌐 anjoktechnologies.in
👉 Ask for WhatsApp Cloud API Demo (PHP)