تأكيد طلبات الدفع عند الاستلام على واتساب
اطلب من عملاء الدفع عند الاستلام تأكيد الطلب على واتساب قبل الشحن — طلبات وهمية أقل.
كيف تعمل
المشغّل: Webhook — حدث order.created من سلة
- استقبل حدث الطلب الجديد من سلة.
- تابع فقط لطلبات الدفع عند الاستلام.
- أرسل قالب واتساب بزرّي تأكيد وإلغاء.
المخطط
مشغّل تطبيق منطق كود
الكود
كود JavaScript المستخدم في خطوات Code، وهو مضمَّن بالفعل في القالب بالأسفل.
// Mode: Run Once for Each Item
// Salla order webhook → clean fields.
// Run one test order first and check the field names in the webhook data.
const body = $json.body || {};
const o = body.data || {};
const c = o.customer || {};
return {
json: {
event: body.event,
order_id: o.reference_id || o.id,
customer_name: [c.first_name, c.last_name].filter(Boolean).join(" "),
phone: `${c.mobile_code || ""}${c.mobile || ""}`.replace(/[^0-9]/g, ""),
email: c.email || "",
total: o.amounts?.total?.amount ?? o.total?.amount ?? "",
currency: o.amounts?.total?.currency ?? o.currency ?? "",
payment_method: o.payment_method || "",
city: o.shipping?.address?.city || c.city || "",
items: (o.items || []).map((i) => `${i.quantity}× ${i.name}`).join("، "),
date: o.date?.date || body.created_at || "",
},
};ابنِها بأداتك
اختر أداتك — نفس الأتمتة، خطوة بخطوة.
انسخه والصقه مباشرة في مساحة عمل n8n (Ctrl+V)، أو حمّله واستخدم Import from File. بعد ذلك اربط حساباتك واستبدل كل قيمة تبدأ بـ YOUR_.
عرض الكود (165 سطر)
{
"name": "تأكيد طلبات الدفع عند الاستلام على واتساب (Flowngn)",
"nodes": [
{
"parameters": {
"content": "## تأكيد طلبات الدفع عند الاستلام على واتساب\nاطلب من عملاء الدفع عند الاستلام تأكيد الطلب على واتساب قبل الشحن — طلبات وهمية أقل.\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": "4582ffa0-b14a-4d3f-a4ae-9194d1475023",
"name": "Setup notes",
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
-420,
-60
]
},
{
"parameters": {
"httpMethod": "POST",
"path": "salla-cod",
"options": {}
},
"id": "4582ffa0-b14a-4d3f-a4ae-9194d1475023",
"name": "Salla order",
"type": "n8n-nodes-base.webhook",
"typeVersion": 2,
"position": [
0,
0
],
"webhookId": "4582ffa0-b14a-4d3f-a4ae-9194d1475023"
},
{
"parameters": {
"jsCode": "// Mode: Run Once for Each Item\n// Salla order webhook → clean fields.\n// Run one test order first and check the field names in the webhook data.\nconst body = $json.body || {};\nconst o = body.data || {};\nconst c = o.customer || {};\n\nreturn {\n json: {\n event: body.event,\n order_id: o.reference_id || o.id,\n customer_name: [c.first_name, c.last_name].filter(Boolean).join(\" \"),\n phone: `${c.mobile_code || \"\"}${c.mobile || \"\"}`.replace(/[^0-9]/g, \"\"),\n email: c.email || \"\",\n total: o.amounts?.total?.amount ?? o.total?.amount ?? \"\",\n currency: o.amounts?.total?.currency ?? o.currency ?? \"\",\n payment_method: o.payment_method || \"\",\n city: o.shipping?.address?.city || c.city || \"\",\n items: (o.items || []).map((i) => `${i.quantity}× ${i.name}`).join(\"، \"),\n date: o.date?.date || body.created_at || \"\",\n },\n};",
"mode": "runOnceForEachItem"
},
"id": "4582ffa0-b14a-4d3f-a4ae-9194d1475023",
"name": "Read Salla order",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
300,
0
]
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "loose"
},
"conditions": [
{
"id": "c1",
"leftValue": "={{ $json.payment_method === 'cod' && $json.phone !== '' }}",
"rightValue": "",
"operator": {
"type": "boolean",
"operation": "true",
"singleValue": true
}
}
],
"combinator": "and"
},
"options": {}
},
"id": "4582ffa0-b14a-4d3f-a4ae-9194d1475023",
"name": "Cash on delivery?",
"type": "n8n-nodes-base.if",
"typeVersion": 2.2,
"position": [
600,
0
]
},
{
"parameters": {
"operation": "sendTemplate",
"phoneNumberId": "YOUR_PHONE_NUMBER_ID",
"recipientPhoneNumber": "={{ $json.phone }}",
"template": "YOUR_COD_CONFIRM_TEMPLATE|ar",
"components": {
"component": [
{
"type": "body",
"bodyParameters": {
"parameter": [
{
"type": "text",
"text": "={{ $json.customer_name || 'عميلنا العزيز' }}"
},
{
"type": "text",
"text": "={{ $json.order_id }}"
},
{
"type": "text",
"text": "={{ $json.total }} {{ $json.currency }}"
}
]
}
}
]
}
},
"id": "4582ffa0-b14a-4d3f-a4ae-9194d1475023",
"name": "Ask to confirm",
"type": "n8n-nodes-base.whatsApp",
"typeVersion": 1,
"position": [
900,
0
]
}
],
"connections": {
"Salla order": {
"main": [
[
{
"node": "Read Salla order",
"type": "main",
"index": 0
}
]
]
},
"Read Salla order": {
"main": [
[
{
"node": "Cash on delivery?",
"type": "main",
"index": 0
}
]
]
},
"Cash on delivery?": {
"main": [
[
{
"node": "Ask to confirm",
"type": "main",
"index": 0
}
]
]
}
},
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"meta": {
"templateCredsSetupCompleted": false
},
"tags": []
}في Make، أنشئ سيناريو جديدًا وأضف هذه الوحدات بالترتيب:
- Webhooks › Custom webhook
- Tools › Set variable / Iterator + Array aggregator (same logic as the Code step)
- Filter on the next route: “Cash on delivery?”
- إذا نعمWhatsApp Business Cloud › Send a Template Message
- كل تشغيل لوحدة يستهلك عمليات (operations) في Make — والباقة المجانية تتضمن حصة شهرية.
- دوال Make المدمجة (map و sum و formatDate…) تغني عن معظم خطوات Code؛ وللمنطق المعقد استخدم وحدة كود.
- قد تختلف أسماء الوحدات والخطوات قليلًا مع تحديث Make و Zapier لتطبيقاتهما.
في Zapier، أنشئ Zap جديدًا وأضف هذه الخطوات بالترتيب:
- Webhooks by Zapier — Catch Hook
- Code by Zapier — Run JavaScript (paste the code from the Code section)
- Filter by Zapier: “Cash on delivery?”
- إذا نعمWhatsApp — Send Template Message
- الـ Zaps التي فيها أكثر من خطوتين تحتاج باقة Zapier مدفوعة.
- الـ Webhooks والفلاتر/المسارات و Code by Zapier ميزات مدفوعة في بعض باقات Zapier.
- Code by Zapier يشغّل JavaScript: أعد استخدام الكود بالأعلى، مع قراءة المدخلات من inputData بدلًا من $json.
- قد تختلف أسماء الوحدات والخطوات قليلًا مع تحديث Make و Zapier لتطبيقاتهما.
نصائح
- أنشئ القالب في Meta بزرّي رد سريع: تأكيد وإلغاء.
- التقط ضغطة العميل بأتمتة WhatsApp Trigger وحدّث حالة الطلب.
أتمتات مشابهة
تطبيقات المنطقةمتوسط
تأكيد طلبات سلة على واتساب
عملاء متجرك على سلة تصلهم رسالة واتساب لحظة الطلب.
Salla → WhatsApp6 س/شهر
تطبيقات المنطقةمتوسط
تذكير السلات المتروكة في سلة على واتساب
عندما يترك عميل سلته في سلة، تصله رسالة واتساب لطيفة برابط يعيده إلى السلة.
Salla → WhatsApp → Google Sheets6 س/شهر
تطبيقات المنطقةمتوسط
تحديثات حالة طلبات سلة على واتساب
عندما تتغير حالة طلب في سلة، يصل العميل تحديث على واتساب بالعربية مع رابط التتبع.
Salla → WhatsApp8 س/شهر