How to Connect WooCommerce to WhatsApp bot Automations
Automate WhatsApp Payments messages for your WooCommerce store: order confirmations, shipping notifications, cart recovery, and customer follow-ups. This guide covers the complete setup process.
What you'll need
- An AnswerForMe account with an active WhatsApp Business API connection
- A WooCommerce store (WordPress + WooCommerce plugin)
- Admin access to your WordPress dashboard
Step 1: Generate your API Key
- Log in to AnswerForMe
- Go to E-commerce → API Keys tab
- Click Generate Key
- Enter a name (e.g., "My WooCommerce Store") and select WooCommerce as the enterprise chatbot (via integrated CRM)
- Copy the API key immediately — it's shown only once
Step 2: Install virtual agent Templates
- Go to E-commerce → Templates tab
- Browse the pre-built template library
- Install templates for the events you want to automate
- Wait for WhatsApp approval (usually 24-48 hours)
Step 3: Create Automation Rules
- Go to E-commerce → Automations tab
- Create rules for each event type:
- Order Confirmed: Sends when a new paid order arrives
- Order Shipped: Sends when fulfillment status changes
- Cart Abandoned: Sends after a configurable delay
Step 4: Configure WooCommerce Webhooks
- In WordPress admin, go to WooCommerce → Settings → Advanced → Webhooks
- Click Add webhook
- Configure:
- Name: "AnswerForMe - Order Created" (descriptive name)
- Status: Active
- Topic: Order created
- Delivery URL:
https://api.answerforme.io/api/ecommerce/webhook/woocommerce - Secret: Leave empty (authentication uses X-API-Key)
- In the delivery URL, add the API key header. Since WooCommerce doesn't support custom headers natively, you have two options:
Option A: Use a Plugin (Recommended)
Install the WooCommerce Webhooks with Custom Headers plugin or similar:
- Add header:
X-API-Keywith your AnswerForMe API key value - Save the webhook
Option B: Custom Code (functions.php)
Add this to your theme's functions.php or a custom plugin:
add_filter('woocommerce_webhook_http_args', function($http_args, $arg, $webhook_id) {
$http_args['headers']['X-API-Key'] = 'your-api-key-here';
return $http_args;
}, 10, 3);
- Repeat for each event type:
| WooCommerce Topic | AnswerForMe Maps To |
|---|---|
| Order created | Order Confirmed (only if paid) |
| Order updated | Depends on status change |
| Order completed | Order Delivered |
Step 5: Test the Integration
- Place a test order in your WooCommerce store
- Complete the payment
- Check your Events Log in AnswerForMe
- Verify the WhatsApp message was sent
Important: WooCommerce Order Status
WooCommerce fires order.created before payment is confirmed. AnswerForMe's native adapter automatically checks the order status field:
- pending / on-hold: Event is skipped (waiting for payment)
- processing / completed: Event is processed normally
- cancelled / refunded / failed: Event is skipped
This prevents sending premature order confirmations.
Supported WooCommerce Events
- Order Created → Order confirmation (only when paid)
- Order Updated → Status change notifications
- Order Completed → Delivery confirmation and review request
Tips for WooCommerce
- Phone field: Ensure your checkout form collects phone numbers. WooCommerce includes billing phone by default.
- International format: Ask customers to include country code (e.g., +54 for Argentina)
- Test with sandbox: Use WooCommerce test mode to verify webhooks before going live
Troubleshooting
| Issue | Solution |
|---|---|
| Webhook not firing | Check webhook status is "Active" in WooCommerce |
| 401 Unauthorized | Verify X-API-Key header is being sent correctly |
| Events skipped as "pending" | Normal — WC fires before payment. Wait for status update. |
| No phone number | Customer didn't fill the billing phone field |
Next Steps
Related guides: WhatsApp Business API platform · WhatsApp automation features · All WhatsApp guides
Frequently Asked Questions
What do I need to get started?
You need a WhatsApp Business account and access to the WhatsApp Business API. Create your free account to get started in minutes.
Is this suitable for small businesses?
Absolutely. AnswerForMe works for businesses of all sizes — from solo entrepreneurs to large enterprises.
How quickly can I see results?
Most businesses report improved response times and customer engagement within the first week of setup.
Frequently Asked Questions
What do I need to get started?
Is this suitable for small businesses?
How quickly can I see results?
Table of Contents
Quick Facts
- Published on 2026-01-27
- 4 min read
- Guides
Expert Insight
AI-powered WhatsApp chatbots don't just answer questions: they learn from context, adapt their tone, and integrate with your CRM or e-commerce. To maximize ROI, start with specific use cases (e.g., L1 support, order confirmations) and expand gradually.