WhatsApp receipt for Paymob payments
When a Paymob payment succeeds, the customer gets a WhatsApp receipt instantly.
How it works
Trigger: Webhook — Paymob transaction processed callback
- Receive the transaction callback from Paymob.
- Pull out the amount, order number, customer name and phone.
- Continue only if the payment succeeded.
- Send an approved WhatsApp template receipt in Arabic.
Diagram
Trigger App Logic Code
Code
JavaScript used in the Code step — already included in the template below.
// Mode: Run Once for Each Item
// Paymob "transaction processed" callback → clean, easy-to-use fields.
const obj = $json.body?.obj || {};
const billing = obj.order?.shipping_data || obj.payment_key_claims?.billing_data || {};
return {
json: {
success: obj.success === true,
transaction_id: obj.id,
order_id: obj.order?.merchant_order_id || obj.order?.id,
amount: (obj.amount_cents || 0) / 100,
currency: obj.currency,
method: obj.source_data?.sub_type || obj.source_data?.type || "",
customer_name: [billing.first_name, billing.last_name].filter(Boolean).join(" "),
phone: String(billing.phone_number || "").replace(/[^0-9]/g, ""),
email: billing.email || "",
error: obj.data?.message || "",
date: obj.created_at,
},
};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 (165 lines)
{
"name": "WhatsApp receipt for Paymob payments (Flowngn)",
"nodes": [
{
"parameters": {
"content": "## WhatsApp receipt for Paymob payments\nWhen a Paymob payment succeeds, the customer gets a WhatsApp receipt instantly.\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": "43ef56f7-3e64-497c-a29d-9f8e76873bd0",
"name": "Setup notes",
"type": "n8n-nodes-base.stickyNote",
"typeVersion": 1,
"position": [
-420,
-60
]
},
{
"parameters": {
"httpMethod": "POST",
"path": "paymob-callback",
"options": {}
},
"id": "43ef56f7-3e64-497c-a29d-9f8e76873bd0",
"name": "Paymob callback",
"type": "n8n-nodes-base.webhook",
"typeVersion": 2,
"position": [
0,
0
],
"webhookId": "43ef56f7-3e64-497c-a29d-9f8e76873bd0"
},
{
"parameters": {
"jsCode": "// Mode: Run Once for Each Item\n// Paymob \"transaction processed\" callback → clean, easy-to-use fields.\nconst obj = $json.body?.obj || {};\nconst billing = obj.order?.shipping_data || obj.payment_key_claims?.billing_data || {};\n\nreturn {\n json: {\n success: obj.success === true,\n transaction_id: obj.id,\n order_id: obj.order?.merchant_order_id || obj.order?.id,\n amount: (obj.amount_cents || 0) / 100,\n currency: obj.currency,\n method: obj.source_data?.sub_type || obj.source_data?.type || \"\",\n customer_name: [billing.first_name, billing.last_name].filter(Boolean).join(\" \"),\n phone: String(billing.phone_number || \"\").replace(/[^0-9]/g, \"\"),\n email: billing.email || \"\",\n error: obj.data?.message || \"\",\n date: obj.created_at,\n },\n};",
"mode": "runOnceForEachItem"
},
"id": "43ef56f7-3e64-497c-a29d-9f8e76873bd0",
"name": "Read payment",
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
300,
0
]
},
{
"parameters": {
"conditions": {
"options": {
"caseSensitive": true,
"leftValue": "",
"typeValidation": "loose"
},
"conditions": [
{
"id": "c1",
"leftValue": "={{ $json.success && $json.phone !== '' }}",
"rightValue": "",
"operator": {
"type": "boolean",
"operation": "true",
"singleValue": true
}
}
],
"combinator": "and"
},
"options": {}
},
"id": "43ef56f7-3e64-497c-a29d-9f8e76873bd0",
"name": "Paid?",
"type": "n8n-nodes-base.if",
"typeVersion": 2.2,
"position": [
600,
0
]
},
{
"parameters": {
"operation": "sendTemplate",
"phoneNumberId": "YOUR_PHONE_NUMBER_ID",
"recipientPhoneNumber": "={{ $json.phone }}",
"template": "YOUR_RECEIPT_TEMPLATE|ar",
"components": {
"component": [
{
"type": "body",
"bodyParameters": {
"parameter": [
{
"type": "text",
"text": "={{ $json.customer_name || 'عميلنا العزيز' }}"
},
{
"type": "text",
"text": "={{ $json.amount }} {{ $json.currency }}"
},
{
"type": "text",
"text": "={{ $json.order_id }}"
}
]
}
}
]
}
},
"id": "43ef56f7-3e64-497c-a29d-9f8e76873bd0",
"name": "Send WhatsApp receipt",
"type": "n8n-nodes-base.whatsApp",
"typeVersion": 1,
"position": [
900,
0
]
}
],
"connections": {
"Paymob callback": {
"main": [
[
{
"node": "Read payment",
"type": "main",
"index": 0
}
]
]
},
"Read payment": {
"main": [
[
{
"node": "Paid?",
"type": "main",
"index": 0
}
]
]
},
"Paid?": {
"main": [
[
{
"node": "Send WhatsApp receipt",
"type": "main",
"index": 0
}
]
]
}
},
"pinData": {},
"settings": {
"executionOrder": "v1"
},
"meta": {
"templateCredsSetupCompleted": false
},
"tags": []
}In Make, create a new scenario and add these modules in order:
- Webhooks › Custom webhook
- Tools › Set variable / Iterator + Array aggregator (same logic as the Code step)
- Filter on the next route: “Paid?”
- If yesWhatsApp 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:
- Webhooks by Zapier — Catch Hook
- Code by Zapier — Run JavaScript (paste the code from the Code section)
- Filter by Zapier: “Paid?”
- If yesWhatsApp — 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
- Paste your production webhook URL as the Transaction processed callback in your Paymob integration.
- Verify the HMAC signature before trusting a callback — see the Paymob HMAC flow.
Related flows
MENA & local appsEasy
Log every Paymob payment in Google Sheets
Every Paymob transaction, successful or failed, becomes a row in your sheet.
Paymob → Google Sheets4h/mo
MENA & local appsEasy
Telegram alert for failed Paymob payments
Know instantly when a customer's payment fails, so you can call them and save the sale.
Paymob → Telegram2h/mo
MENA & local appsAdvanced
Verify Paymob callbacks with HMAC
Check Paymob's signature on every callback so fake payment messages are rejected.
Paymob → Telegram1h/mo