طلبات زد في Google Sheets
سجّل كل طلب جديد في زد في جدول Google تلقائيًا.
كيف تعمل
المشغّل: Webhook — حدث طلب جديد من زد
- استقبل webhook الطلب الجديد من زد.
- استخرج الطلب والعميل والهاتف والمدينة والمنتجات والإجمالي ووسيلة الدفع.
- أضف صفًا إلى ورقة Orders.
المخطط
مشغّل تطبيق كود
الكود
كود JavaScript المستخدم في خطوات 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_.
عرض الكود (119 سطر)
{
"name": "طلبات زد في Google Sheets (Flowngn)",
"nodes": [
{
"parameters": {
"content": "## طلبات زد في Google Sheets\nسجّل كل طلب جديد في زد في جدول Google تلقائيًا.\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-ab68-81cd19e532ab",
"name": "Setup notes",
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
-420,
-60
]
},
{
"parameters": {
"httpMethod": "POST",
"path": "zid-orders-log",
"options": {}
},
"id": "53ade245-fd19-478b-ab68-81cd19e532ab",
"name": "Zid order",
"type": "n8n-nodes-base.webhook",
"typeVersion": 2,
"position": [
0,
0
],
"webhookId": "53ade245-fd19-478b-ab68-81cd19e532ab"
},
{
"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-ab68-81cd19e532ab",
"name": "Read Zid order",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
300,
0
]
},
{
"parameters": {
"operation": "append",
"documentId": {
"__rl": true,
"value": "YOUR_SPREADSHEET_ID",
"mode": "id"
},
"sheetName": {
"__rl": true,
"value": "Orders",
"mode": "name"
},
"columns": {
"mappingMode": "defineBelow",
"value": {
"date": "={{ $json.date || $now.toISO() }}",
"order_id": "={{ $json.order_id }}",
"customer": "={{ $json.customer_name }}",
"phone": "={{ $json.phone }}",
"city": "={{ $json.city }}",
"items": "={{ $json.items }}",
"total": "={{ $json.total }}",
"payment": "={{ $json.payment_method }}"
}
},
"options": {}
},
"id": "53ade245-fd19-478b-ab68-81cd19e532ab",
"name": "Add to Orders",
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 4.5,
"position": [
600,
0
]
}
],
"connections": {
"Zid order": {
"main": [
[
{
"node": "Read Zid order",
"type": "main",
"index": 0
}
]
]
},
"Read Zid order": {
"main": [
[
{
"node": "Add to Orders",
"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)
- Google Sheets › Add a Row
- كل تشغيل لوحدة يستهلك عمليات (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)
- Google Sheets — Create Spreadsheet Row
- الـ Zaps التي فيها أكثر من خطوتين تحتاج باقة Zapier مدفوعة.
- الـ Webhooks والفلاتر/المسارات و Code by Zapier ميزات مدفوعة في بعض باقات Zapier.
- Code by Zapier يشغّل JavaScript: أعد استخدام الكود بالأعلى، مع قراءة المدخلات من inputData بدلًا من $json.
- قد تختلف أسماء الوحدات والخطوات قليلًا مع تحديث Make و Zapier لتطبيقاتهما.
نصائح
- نفّذ طلب اختبار وافحص أسماء الحقول — ثم عدّل خطوة Code إذا لزم.
أتمتات مشابهة
تطبيقات المنطقةسهل
سجّل كل مدفوعات Paymob في Google Sheets
كل معاملة Paymob، ناجحة أو فاشلة، تصبح صفًا في جدولك.
Paymob → Google Sheets4 س/شهر
تطبيقات المنطقةسهل
طلبات سلة في Google Sheets
كل طلب جديد في سلة يُسجَّل في جدول للتجهيز والتقارير.
Salla → Google Sheets4 س/شهر
تطبيقات المنطقةسهل
تنبيهات طلبات زد الجديدة على تيليجرام
كل طلب جديد في متجرك على زد يصلك كرسالة تيليجرام.
Zid → Telegram2 س/شهر