WordPress & WooCommerce WhatsApp Integration

Easily connect your WooCommerce store to send automated WhatsApp order confirmations, live delivery tracking updates, and lead notifications without buying any expensive third-party plugin.

⚡ No Paid Plugins Required 🛒 WooCommerce 7.x, 8.x, 9.x Ready 🐘 PHP 7.4 - 8.3+ ⏱️ 2-Minute Setup
STEP 1 Get Your API Key & Pair WhatsApp
  1. Log in to your Client Portal.
  2. Open WhatsApp on your phone → Linked Devices → Link a Device → Scan the QR Code.
  3. Copy your unique X-API-Key from Step 2 of the portal.
STEP 2 Add Integration Snippet to WordPress

You don't need to edit theme core files. Use the free Code Snippets plugin:

  1. In your WordPress Admin, go to: Plugins → Add New.
  2. Search for "Code Snippets" and click Install & Activate.
  3. Go to Snippets → Add New, choose PHP Code, paste the code below, replace YOUR_API_KEY_HERE, and click Save Changes & Activate.
<?php /** * Automated WhatsApp Notification on New WooCommerce Order */ add_action('woocommerce_thankyou', 'send_whatsapp_on_new_order', 10, 1); function send_whatsapp_on_new_order($order_id) { if (!$order_id) return; $order = wc_get_order($order_id); if (!$order || $order->get_meta('_wa_order_sent')) return; $customer_name = $order->get_billing_first_name() . ' ' . $order->get_billing_last_name(); $customer_phone = $order->get_billing_phone(); $order_total = html_entity_decode(strip_tags(wc_price($order->get_total()))); $items = ''; foreach ($order->get_items() as $item) { $items .= "- " . $item->get_name() . " (x" . $item->get_quantity() . ")\n"; } $message = "🎉 *Order Placed Successfully!*\n\n" . "Assalam-o-Alaikum *" . $customer_name . "*,\n" . "Aapka order *" . $order->get_order_number() . "* receive ho gaya hai.\n\n" . "📦 *Items:*\n" . $items . "\n" . "💰 *Total Amount:* " . $order_total . "\n" . "📍 *Address:* " . $order->get_billing_address_1() . ", " . $order->get_billing_city() . "\n\n" . "Shukriya for shopping with us!"; // Send WhatsApp to Customer send_whatsapp_gateway_api($customer_phone, $message); // (Optional) Send Instant Alert to Store Admin / Owner $admin_phone = '03217089084'; // Enter Admin WhatsApp Number send_whatsapp_gateway_api($admin_phone, "🚨 *New Order #" . $order->get_order_number() . "* from " . $customer_name . " (" . $customer_phone . ") Total: " . $order_total); $order->update_meta_data('_wa_order_sent', '1'); $order->save(); } // Reusable WhatsApp Gateway Helper Function function send_whatsapp_gateway_api($phone, $message) { $apiKey = 'YOUR_API_KEY_HERE'; // ← Paste Client API Key $apiUrl = 'https://sachalabdullah.shop/api/v1/send'; wp_remote_post($apiUrl, [ 'timeout' => 15, 'headers' => [ 'Content-Type' => 'application/json', 'X-API-Key' => $apiKey ], 'body' => json_encode([ 'phone' => $phone, 'message' => $message ]) ]); }
STEP 3 Place a Test Order

Place a test order on your WooCommerce store with your personal mobile number in billing details. You will instantly receive the formatted WhatsApp confirmation message with order details!

Need Help Setting Up Your WordPress Store?

Our engineering team can assist you with custom WooCommerce hooks, OTP login, and multi-vendor alerts.

💬 Chat on WhatsApp (+923217089084)