WooCommerce order confirmation on WhatsApp
Send every new WooCommerce customer a WhatsApp message with their order number and total.
How it works
Trigger: WooCommerce — order created
- Receive the new order from WooCommerce.
- Clean the billing phone into international format.
- Send an approved WhatsApp template with the name, order number and total.
Diagram
Trigger App Code
Code
JavaScript used in the Code step — already included in the template below.
// Mode: Run Once for Each Item
// Turns the billing phone into international format for WhatsApp (digits only).
// Set your own country code: 20 Egypt, 966 Saudi Arabia, 971 UAE, 965 Kuwait…
const COUNTRY_CODE = "20";
const b = $json.billing || {};
let phone = String(b.phone || "").replace(/[^0-9]/g, "").replace(/^00/, "");
if (phone.startsWith("0")) phone = COUNTRY_CODE + phone.slice(1);
return {
json: {
phone,
name: b.first_name || "",
order: $json.number,
total: `${$json.total} ${$json.currency}`,
},
};Build it
Pick your tool — same automation, step by step.
Copy and paste straight into an n8n canvas (Ctrl+V), or download and use Import from File. Then connect your own credentials and replace every YOUR_… placeholder.
Show code (119 lines)
{
"name": "WooCommerce order confirmation on WhatsApp (Flowngn)",
"nodes": [
{
"parameters": {
"content": "## WooCommerce order confirmation on WhatsApp\nSend every new WooCommerce customer a WhatsApp message with their order number and total.\n\n**Setup**\n1. Open each node and connect your own credentials.\n2. Replace every YOUR_… placeholder.\n3. Test once, then activate.\n\nFree template from Flowngn",
"height": 260,
"width": 340
},
"id": "3f369b32-6a79-4ecd-a51a-12b895911d47",
"name": "Setup notes",
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
-420,
-60
]
},
{
"parameters": {
"event": "order.created"
},
"id": "3f369b32-6a79-4ecd-a51a-12b895911d47",
"name": "New order",
"type": "n8n-nodes-base.wooCommerceTrigger",
"typeVersion": 1,
"position": [
0,
0
],
"webhookId": "3f369b32-6a79-4ecd-a51a-12b895911d47"
},
{
"parameters": {
"jsCode": "// Mode: Run Once for Each Item\n// Turns the billing phone into international format for WhatsApp (digits only).\n// Set your own country code: 20 Egypt, 966 Saudi Arabia, 971 UAE, 965 Kuwait…\nconst COUNTRY_CODE = \"20\";\nconst b = $json.billing || {};\nlet phone = String(b.phone || \"\").replace(/[^0-9]/g, \"\").replace(/^00/, \"\");\nif (phone.startsWith(\"0\")) phone = COUNTRY_CODE + phone.slice(1);\n\nreturn {\n json: {\n phone,\n name: b.first_name || \"\",\n order: $json.number,\n total: `${$json.total} ${$json.currency}`,\n },\n};",
"mode": "runOnceForEachItem"
},
"id": "3f369b32-6a79-4ecd-a51a-12b895911d47",
"name": "Clean phone",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
300,
0
]
},
{
"parameters": {
"operation": "sendTemplate",
"phoneNumberId": "YOUR_PHONE_NUMBER_ID",
"recipientPhoneNumber": "={{ $json.phone }}",
"template": "YOUR_ORDER_CONFIRMATION_TEMPLATE|ar",
"components": {
"component": [
{
"type": "body",
"bodyParameters": {
"parameter": [
{
"type": "text",
"text": "={{ $json.name || 'عميلنا العزيز' }}"
},
{
"type": "text",
"text": "={{ $json.order }}"
},
{
"type": "text",
"text": "={{ $json.total }}"
}
]
}
}
]
}
},
"id": "3f369b32-6a79-4ecd-a51a-12b895911d47",
"name": "Send confirmation",
"type": "n8n-nodes-base.whatsApp",
"typeVersion": 1,
"position": [
600,
0
]
}
],
"connections": {
"New order": {
"main": [
[
{
"node": "Clean phone",
"type": "main",
"index": 0
}
]
]
},
"Clean phone": {
"main": [
[
{
"node": "Send confirmation",
"type": "main",
"index": 0
}
]
]
}
},
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"meta": {
"templateCredsSetupCompleted": false
},
"tags": []
}In Make, create a new scenario and add these modules in order:
- WooCommerce › Watch Orders
- Tools › Set variable / Iterator + Array aggregator (same logic as the Code step)
- WhatsApp Business Cloud › Send a Template Message
- Every module run uses Make operations — the free plan includes a monthly quota.
- Make's built-in functions (map, sum, formatDate…) can replace most Code steps; for complex logic use a code module.
- Module and step names can differ slightly as Make and Zapier update their apps.
In Zapier, create a new Zap and add these steps in order:
- WooCommerce — New Order
- Code by Zapier — Run JavaScript (paste the code from the Code section)
- WhatsApp — Send Template Message
- Zaps with more than two steps need a paid Zapier plan.
- Webhooks, Filters/Paths and Code by Zapier are premium features on some Zapier plans.
- Code by Zapier runs JavaScript: reuse the code shown above, reading inputs from inputData instead of $json.
- Module and step names can differ slightly as Make and Zapier update their apps.
Tips
- Make the phone field required at checkout, and set your country code in the Code step.
- Add a second template for "order shipped" using the order.updated event.
Related flows
E-commerceMedium
Daily Shopify sales summary on WhatsApp
Every morning, get yesterday's order count and revenue sent to your WhatsApp.
Shopify → WhatsApp3h/mo
E-commerceMedium
WhatsApp order confirmation for Shopify
Customers get a WhatsApp message the moment they place an order.
Shopify → WhatsApp6h/mo
E-commerceEasy
New WooCommerce orders on Telegram
Get a Telegram message with the items, total and city for every WooCommerce order.
WooCommerce → Telegram2h/mo