ByteFlow AI Labs
All Posts
AI Automation13 October 2026

How to Verify bKash Payments Automatically with n8n (Step by Step)

If you sell through Facebook, Instagram or WhatsApp in Bangladesh, you know the routine. A customer pays with bKash or Nagad, sends a screenshot on WhatsApp, and someone on your team opens the image, finds the transaction ID, searches the order sheet and replies "Payment received". On a busy day that is hundreds of screenshots — slow, easy to get wrong, and a reused screenshot can slip through.

This guide shows how to automate that check with n8n, an open-source workflow tool you can run on your own server. It is the same approach we use for WhatsApp payment-verification workflows at ByteFlow AI Labs.

What the workflow does A customer sends a payment screenshot to your WhatsApp Business number. n8n receives the message and downloads the image. The image is read (OCR) to extract the transaction ID, amount and, where visible, the sender number. The workflow finds the matching order in your order sheet or database. It checks the transaction ID has not been used before. If everything matches, it marks the order as paid and replies to the customer. If not, it sends the case to a staff member with the screenshot attached. What you need n8n, self-hosted on a small VPS (Docker is the easiest install). A WhatsApp Business API connection that can send messages to n8n through a webhook. An OCR step — either a dedicated OCR API or a vision-capable AI model. An order ledger — a Google Sheet is fine to start, with columns such as order_id, customer_phone, amount_due, status, trx_id. Step 1 — Receive the WhatsApp message

Create a Webhook node in n8n and point your WhatsApp provider's incoming-message webhook at its URL. Add an IF node that only continues when the message contains an image, so ordinary text messages go to your normal chat flow instead.

Step 2 — Download the image

WhatsApp sends a media ID or URL rather than the image itself. Use an HTTP Request node to download the media as binary data, following your provider's media endpoint.

Step 3 — Read the screenshot

Send the image to your OCR step and ask for plain text back. With a vision AI model, a strict prompt works best:

Extract from this payment screenshot: transaction ID, amount in BDT, sender number, date and time. Reply only as JSON with keys trx_id, amount, sender, datetime. Use null for anything you cannot read.

Asking for JSON and allowing null keeps the next steps predictable and stops the model from guessing.

Step 4 — Clean and validate the fields

Add a Code node to normalise what came back:

javascript const raw = $json; const trx = (raw.trx_id || '').toUpperCase().replace(/[^A-Z0-9]/g, ''); const amount = Number(String(raw.amount || '').replace(/[^0-9.]/g, ''));

return [{ json: { trx_id: trx, amount, sender: raw.sender || null, customer_phone: $('Webhook').first().json.from, // adjust to your provider's field readable: trx.length >= 8 && amount > 0, }, }];

If readable is false — a blurry image or a cropped screenshot — skip straight to the staff-review branch.

Step 5 — Find the order

Use a Google Sheets (or database) node to look up the open order for this customer's phone number with status = pending. If there is no pending order, send it to staff.

Step 6 — Catch duplicates

Search the same sheet for the extracted trx_id. If it already exists on another order, stop and escalate. This one check blocks the most common trick: the same screenshot sent for two orders.

Step 7 — Compare the amount

An IF node compares amount with amount_due. Decide your rule up front: exact match only, or a small tolerance. Anything outside the rule goes to staff.

Step 8 — Confirm or escalate Match: update the order row (status = paid, trx_id = …) and send the customer a confirmation on WhatsApp. No match: send a polite message ("We're checking your payment and will confirm shortly") and alert staff on WhatsApp, Telegram or Slack with the screenshot, the extracted fields and the order. Step 9 — Add failure alerts

Set an Error Workflow in n8n so that if any step fails — the OCR service is down, or the sheet is unreachable — your team is alerted immediately instead of customers waiting in silence.

What screenshot verification can and can't prove

This is the part most guides skip. A screenshot check confirms that the screenshot is consistent with an order: the transaction ID is new, the amount matches, the customer matches. It does not prove the money reached your account — screenshots can be edited.

For higher-value orders, add one of these:

Reconcile against your bKash or Nagad merchant statement daily, matching transaction IDs. Forward the merchant payment SMS into the workflow and match the transaction ID from the SMS, which is much harder to fake. Keep a manual-approval rule above a set amount. Frequently asked questions

Does this connect directly to my bKash account? No. It checks the screenshot against your own order records. Matching against your merchant statement or payment SMS is a separate, optional step.

Does it work for Nagad, Rocket and bank transfers? Yes. The steps are the same as long as the amount and transaction reference are visible in the screenshot.

What happens with a blurry screenshot? The workflow marks it unreadable and sends it to a person. It never approves something it could not read.

Can a customer send the same screenshot twice? The duplicate check in Step 6 catches a transaction ID that has already been used, so one payment cannot confirm two orders.

Do I need to pay per transaction? Self-hosted n8n has no per-task fee. You pay for the server, and for the OCR or AI provider and WhatsApp messaging, which bill you directly.

Want this built for your business?

ByteFlow AI Labs builds payment-verification workflows on your own server, with rules agreed with you, duplicate detection, customer messages, staff escalation and full documentation. See bKash payment verification automation or book a free 30-minute call.