تأكيد طلبات الدفع عند الاستلام من زد على واتساب

كل طلب جديد بالدفع عند الاستلام في زد تصل صاحبه رسالة واتساب يؤكد فيها طلبه قبل أن تشحنه.

متوسط توفّر ~8 ساعة شهريًا تطبيقات المنطقةبواسطة فريق Flowngn

تعمل مع n8n · Make · Zapier

كيف تعمل

المشغّل: Webhook — حدث طلب جديد من زد
  1. استقبل الطلب الجديد من زد.
  2. تابع فقط لطلبات الدفع عند الاستلام التي فيها رقم جوال.
  3. أرسل قالب واتساب فيه رقم الطلب والإجمالي وزرّي تأكيد وإلغاء.

المخطط

trueZid orderWebhook{ }Read Zid orderCode⑂Cash on delivery?IfWAsk to confirmWhatsApp Business Cloud
مشغّل تطبيق منطق كود

الكود

كود JavaScript المستخدم في خطوات Code، وهو مضمَّن بالفعل في القالب بالأسفل.

Read Zid order · عقدة Code
// Mode: Run Once for Each Item
// Zid order webhook → clean fields.
// Run one test order first and adjust the field names below if needed.
const o = $json.body?.data || $json.body || {};
const c = o.customer || {};

return {
  json: {
    order_id: o.code || o.id,
    customer_name: c.name || "",
    phone: String(c.mobile || c.phone || "").replace(/[^0-9]/g, ""),
    email: c.email || "",
    total: o.order_total ?? o.total ?? "",
    currency: o.currency_code || o.currency || "",
    payment_method: o.payment?.method?.code || o.payment_method || "",
    city: o.shipping?.address?.city?.name || o.shipping?.address?.city || "",
    items: (o.products || []).map((p) => `${p.quantity}× ${p.name}`).join("، "),
  },
};

ابنِها بأداتك

اختر أداتك — نفس الأتمتة، خطوة بخطوة.

انسخه والصقه مباشرة في مساحة عمل n8n (Ctrl+V)، أو حمّله واستخدم Import from File. بعد ذلك اربط حساباتك واستبدل كل قيمة تبدأ بـ YOUR_.

ملف Workflow JSON
عرض الكود (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": "53ade245-fd19-478b-a884-e1d057ce7e8e",
      "name": "Setup notes",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -420,
        -60
      ]
    },
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "zid-cod",
        "options": {}
      },
      "id": "53ade245-fd19-478b-a884-e1d057ce7e8e",
      "name": "Zid order",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        0,
        0
      ],
      "webhookId": "53ade245-fd19-478b-a884-e1d057ce7e8e"
    },
    {
      "parameters": {
        "jsCode": "// Mode: Run Once for Each Item\n// Zid order webhook → clean fields.\n// Run one test order first and adjust the field names below if needed.\nconst o = $json.body?.data || $json.body || {};\nconst c = o.customer || {};\n\nreturn {\n  json: {\n    order_id: o.code || o.id,\n    customer_name: c.name || \"\",\n    phone: String(c.mobile || c.phone || \"\").replace(/[^0-9]/g, \"\"),\n    email: c.email || \"\",\n    total: o.order_total ?? o.total ?? \"\",\n    currency: o.currency_code || o.currency || \"\",\n    payment_method: o.payment?.method?.code || o.payment_method || \"\",\n    city: o.shipping?.address?.city?.name || o.shipping?.address?.city || \"\",\n    items: (o.products || []).map((p) => `${p.quantity}× ${p.name}`).join(\"، \"),\n  },\n};",
        "mode": "runOnceForEachItem"
      },
      "id": "53ade245-fd19-478b-a884-e1d057ce7e8e",
      "name": "Read Zid order",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        300,
        0
      ]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "loose"
          },
          "conditions": [
            {
              "id": "c1",
              "leftValue": "={{ String($json.payment_method).toLowerCase().includes('cod') && $json.phone !== '' }}",
              "rightValue": "",
              "operator": {
                "type": "boolean",
                "operation": "true",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "53ade245-fd19-478b-a884-e1d057ce7e8e",
      "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": "53ade245-fd19-478b-a884-e1d057ce7e8e",
      "name": "Ask to confirm",
      "type": "n8n-nodes-base.whatsApp",
      "typeVersion": 1,
      "position": [
        900,
        0
      ]
    }
  ],
  "connections": {
    "Zid order": {
      "main": [
        [
          {
            "node": "Read Zid order",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Read Zid 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": []
}

← افتحها في ساحة التجربة لتعديلها

نصائح

  • أنشئ القالب في Meta بزرّي رد سريع: تأكيد وإلغاء.
  • جرّب طلبًا واحدًا أولًا وتأكد من الرمز الذي يرسله زد لطريقة الدفع عند الاستلام.

أتمتات مشابهة