WhatsApp Cloud API Connector
by Steven Marp https://apps.odoo.com/apps/browse?repo_maintainer_id=512936$ 39.05
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Contacts (contacts)
• Discuss (mail) • Invoicing (account) • Sales (sale_management) |
| Lines of code | 1082 |
| Technical Name |
sm_whatsapp |
| License | OPL-1 |
| Website | https://apps.odoo.com/apps/browse?repo_maintainer_id=512936 |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Contacts (contacts)
• Discuss (mail) • Invoicing (account) • Sales (sale_management) |
| Lines of code | 1082 |
| Technical Name |
sm_whatsapp |
| License | OPL-1 |
| Website | https://apps.odoo.com/apps/browse?repo_maintainer_id=512936 |
WhatsApp Cloud API Connector
Connect Odoo to Meta WhatsApp Cloud API — send & receive messages from Contacts, Sales Orders & Invoices. No middleware, no monthly fees.
Module Video Overview
Features
1 Send from ContactsOne-click "Send WhatsApp" button on every contact form. WhatsApp number field integrated next to phone. Message history stat button shows all conversations at a glance. |
Contact Form with WhatsApp Button |
|
Sales Order with WhatsApp Button |
2 Send from Sales OrdersSend order confirmations directly from any Sales Order. Pre-filled message includes order number, total amount, and currency. Customer gets instant notification via WhatsApp. |
3 Send from InvoicesSend payment reminders with pre-filled invoice number, amount, due date, and currency. Available on every invoice form via the WhatsApp button in the header. |
Invoice Form with WhatsApp Button |
|
Template Management |
4 Template messagesManage Meta-approved message templates directly in Odoo. Sync from Meta, submit new templates, and check approval status. Supports Marketing, Utility & Authentication categories. |
5 Receive incoming messagesWebhook endpoint receives incoming WhatsApp messages in real-time. Auto-creates contacts for unknown senders. HMAC-SHA256 signature verification ensures security. |
Webhook & Incoming Messages |
|
Status: Draft â Sent â Delivered â Read |
6 Full delivery trackingTrack every message through its lifecycle: Draft â Sent â Delivered â Read. Failed messages show error details and can be retried with one click. Chatter notes posted on related records. |
7 Bulk messagingSend the same message to multiple contacts at once. Select recipients in the composer wizard, choose text or template message, and send in one click. |
Bulk Send to Multiple Contacts |
And much more...
Easy ConfigurationAll settings in one place: API Token, Phone Number ID, Business Account ID, Webhook, and more. Built-in Test Connection button. |
Role-Based AccessWhatsApp User (send & view messages) and WhatsApp Manager (full access to templates, settings, and configuration). |
Sync TemplatesOne-click sync imports all your Meta-approved templates into Odoo. Submit new templates and check approval status. |
Chatter IntegrationWhatsApp messages are posted as notes on the related record (Sales Order, Invoice, etc.) for a complete audit trail. |
wa.me FallbackIf API is not configured, use the "Open in WhatsApp" button to open wa.me link directly in the browser. No API needed. |
Secure WebhookHMAC-SHA256 signature verification for all incoming webhooks. Custom verify token for endpoint validation. |
Support
We provide free bug fixes and updates for all our modules. If you need help, please submit a support request through the Odoo Apps support page. Our team is always ready to assist you.
WhatsApp Cloud API Connector — Documentation
Table of Contents
1. Getting Started
Prerequisites
Before installing, make sure your environment meets these requirements:
Warning
Meta requires a payment method, completed business profile, and optionally business verification before WhatsApp messages will actually be delivered. The API will accept messages without these, but they will NOT arrive.
| Requirement | Description |
|---|---|
| Meta Developer Account | Register at developers.facebook.com |
| WhatsApp Business Account | Linked to your Meta app with the WhatsApp product added |
| System User Token | Permanent token with whatsapp_business_management and whatsapp_business_messaging permissions |
| Payment Method | Credit/debit card in Meta Business Suite → Billing |
| Business Profile | Legal Name, Country, Website filled in Business Settings |
| Public HTTPS Domain | Required only for webhook (incoming messages) |
Tip
If you are developing locally, use ngrok to create a temporary HTTPS tunnel to your local Odoo instance for webhook testing.
Installation
- Upload the sm_whatsapp module folder to your server's custom addons directory.
- Restart the Odoo service to detect the new module.
- Navigate to Apps menu, click Update Apps List.
- Search for "WhatsApp Connector" and click Install.
Note
After installation, a new WhatsApp top-level menu will appear in the main menu bar. All message management, templates, and configuration are accessible from there.
2. Meta Developer Setup
To get started, you need to create a Meta Developer App with the WhatsApp product.
Step 1: Create App
- Go to developers.facebook.com and log in.
- Click My Apps → Create App.
- Select app type: Business.
- Give your app a name (e.g. "Odoo WhatsApp").
- Add the WhatsApp product to your app.
Step 2: Get API Credentials
- In Meta Developer Console, go to WhatsApp → API Setup.
- Copy the following values:
Phone Number ID: The unique ID of your WhatsApp phone number. WhatsApp Business Account ID: Found on the same API Setup page. App Secret: Found in App Settings → Basic.
Step 3: Create System User & Permanent Token
- Go to Meta Business Suite → Settings → System Users.
- Click Add to create a new System User (e.g. "odoo_bot").
- Set role to Admin.
- Click Add Assets → select your WhatsApp app → grant Full Control.
- Click Generate Token → select the app.
- Add permissions:
- whatsapp_business_management
- whatsapp_business_messaging
- Copy the generated token — this is your permanent API token.
Important
Keep your token secure! Anyone with access to this token can send messages from your WhatsApp Business Account. Never share it publicly.
3. Phone Number Registration
Meta provides a test phone number for development. You can also add your own business phone number.
Test Phone Number
- The test phone number is available immediately in WhatsApp → API Setup.
- In Development mode, you must add recipient numbers as test recipients.
- Go to API Setup → scroll to "To" field → Manage phone number list → add numbers.
Own Business Number
- To use your own phone number, register it in WhatsApp → Phone Numbers → Add Phone Number.
- The number must NOT be currently registered with any WhatsApp account (personal or business).
- Follow Meta's verification process (SMS or voice call OTP).
4. Business Requirements
Warning
These requirements are mandatory for actual message delivery.
Payment Method
- Go to Meta Business Suite → Billing → Payment Methods.
- Add a valid credit or debit card.
- Without this, Meta will accept API calls but block delivery (error 141006).
Business Profile
- Go to Meta Business Suite → Settings → Business Info.
- Fill in:
- Legal Business Name
- Country
- Website URL
- Incomplete profile causes error 131000 and delivery blocks.
Business Verification (Recommended)
- Go to Meta Business Suite → Settings → Security Center → Start Verification.
- Submit required documents.
- Verification removes messaging limits and enables full production access.
5. Odoo Configuration
Step 1: Module Settings
- After installing, go to Settings → WhatsApp section.
- Fill in the following fields:
| Setting | Where to find it |
|---|---|
| API Token | The permanent token from your System User |
| Phone Number ID | Meta Developer Console → WhatsApp → API Setup |
| Business Account ID | Meta Developer Console → WhatsApp → API Setup |
| API Version | Default: v25.0 (leave as-is unless you know a newer one) |
| Webhook Verify Token | Any random string; must match what you set in Meta Console |
| App Secret | From App Settings → Basic in Meta Developer Console |
- Click Test Connection to verify.
Step 2: Webhook Setup (Optional)
Only needed if you want to receive incoming WhatsApp messages in Odoo.
- In Meta Developer Console → WhatsApp → Configuration → Webhook.
- Click Edit and set:
Callback URL: https://your-odoo-domain.com/whatsapp/webhook Verify Token: Same value as in Odoo Settings. - Click Verify and Save.
- Subscribe to webhook fields:
- messages — for incoming messages
- message_template_status_update — for template status changes
Step 3: Sync Templates
- Go to WhatsApp → Templates.
- Click Sync Templates from Meta.
- All approved templates from your WhatsApp Business Account are imported.
- Templates are categorized as: Marketing, Utility, or Authentication.
6. Sending Messages
From Contacts
- Open any Contact (res.partner).
- Make sure the WhatsApp number field is filled.
- Click the Send WhatsApp button in the header.
- In the composer wizard, write your message or select a template.
- Click Send.
From Sales Orders
- Open any Sales Order.
- Click the Send WhatsApp button.
- The message is pre-filled with order number, total amount, and currency.
- Edit if needed, then click Send.
From Invoices
- Open any Invoice (Customer Invoice).
- Click the Send WhatsApp button.
- The message is pre-filled with invoice number, amount, due date, and currency.
- Edit if needed, then click Send.
Bulk Messaging
- In the composer wizard, add multiple recipients.
- Each recipient receives an individual WhatsApp message.
- Delivery status is tracked per recipient.
7. Message Tracking
All messages are tracked in WhatsApp → Messages with the following statuses:
| Status | Description |
|---|---|
| Draft | Message created but not yet sent |
| Sent | Successfully sent via API (accepted by Meta) |
| Delivered | WhatsApp confirmed delivery to recipient's device |
| Read | Recipient has read the message (blue ticks) |
| Failed | Error occurred — details shown in error message field |
Failed messages can be retried with the Retry button.
9. Security
- All API calls use Bearer token authentication over HTTPS.
- Incoming webhooks are verified using HMAC-SHA256 signature (using App Secret).
- Webhook endpoint validates the verify token during initial handshake.
- Access control: WhatsApp User (send/view) and WhatsApp Manager (full access).
- API tokens are stored as ir.config_parameter system parameters.
10. Technical Reference
Models
- whatsapp.message — Main message model (text, template, status tracking)
- whatsapp.template — Meta-approved message templates synced from API
- whatsapp.composer — Transient wizard for composing & sending messages
Endpoints
- GET /whatsapp/webhook — Webhook verification (Meta handshake)
- POST /whatsapp/webhook — Receive incoming messages & status updates
API Calls
- GET /v25.0/{phone_number_id} — Test connection / verify credentials
- POST /v25.0/{phone_number_id}/messages — Send text or template message
- GET /v25.0/{waba_id}/message_templates — Sync templates from Meta
Configuration Parameters
- sm_whatsapp.api_token — Permanent API token
- sm_whatsapp.phone_number_id — WhatsApp Phone Number ID
- sm_whatsapp.business_account_id — WhatsApp Business Account ID
- sm_whatsapp.api_version — Graph API version (default: v25.0)
- sm_whatsapp.webhook_verify_token — Webhook verify token
- sm_whatsapp.app_secret — Meta App Secret for HMAC verification
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module