How to Connect WooCommerce to WhatsApp Automations

Last updated: AnswerForMe
Share:

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

  1. Log in to AnswerForMe
  2. Go to E-commerceAPI Keys tab
  3. Click Generate Key
  4. Enter a name (e.g., "My WooCommerce Store") and select WooCommerce as the enterprise chatbot (via integrated CRM)
  5. Copy the API key immediately — it's shown only once

Step 2: Install virtual agent Templates

  1. Go to E-commerceTemplates tab
  2. Browse the pre-built template library
  3. Install templates for the events you want to automate
  4. Wait for WhatsApp approval (usually 24-48 hours)

Step 3: Create Automation Rules

  1. Go to E-commerceAutomations tab
  2. 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

  1. In WordPress admin, go to WooCommerceSettingsAdvancedWebhooks
  2. Click Add webhook
  3. 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)
  4. In the delivery URL, add the API key header. Since WooCommerce doesn't support custom headers natively, you have two options:

Install the WooCommerce Webhooks with Custom Headers plugin or similar:

  1. Add header: X-API-Key with your AnswerForMe API key value
  2. 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);
  1. 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

  1. Place a test order in your WooCommerce store
  2. Complete the payment
  3. Check your Events Log in AnswerForMe
  4. 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?

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.

Ready to Automate?

Start automating your WhatsApp conversations today.

See plans

Reconnecting...

Please wait while we restore the connection.

Connection lost

We couldn't automatically restore the connection.

Reload page

Session updated

Reload the page to continue.

Continue