Automated Payment with SePay

Want to optimize your order processing workflow and automatically confirm payments when customers transfer money? The Automated Payment with SePay feature on AhaChat is the ideal solution for you!

Automated Payment with SePay allows your chatbot to detect successful bank transfers, automatically confirm the order, and continue the customer journey—all without manual intervention.

How does this feature work?

When a customer places an order via chatbot, the system will display the payment information (amount and transfer note or a QR code). Once the customer makes a successful bank transfer, SePay verifies the transaction and sends a notification to AhaChat, which then allows the chatbot to continue processing the order automatically.

Register a SePay Account & Get a Virtual Account (VA)

Before integrating, you need to:

  1. Register a SePay account at:

👉 https://docs.sepay.vn/dang-ky-sepay.html

  1. Create a sub-account (Virtual Account - VA) at:

👉 https://docs.sepay.vn/tai-khoan-phu.html

After creating, you will receive a Virtual Account number (VA) – use this VA to set up in AhaChat so the system can automatically recognize matching transactions.

Step 1: Add Your Bank Account to AhaChat

Go to AhaChat → Sales → Payments → Bank Account Info, and fill in the following:

  • Bank name

  • Account number (VA)

  • Account holder name

Step 2: Connect SePay with AhaChat

1. Generate an API Key on AhaChat

Go to the integration section and copy your API Key to use for authenticating with SePay’s webhook.

2. Set Up Webhook on SePay

On SePay, go to “Webhook Integration” → click “+ Add Webhook” → under “Call URL”, enter:

https://ahachat.com/api/bots/BOT_ID/sepay/webhook

📌 Replace BOT_ID with your bot’s actual ID from AhaChat.

Choose authentication type as API Key, and paste the API Key from AhaChat into the corresponding field.

Step 3: Create a Payment Block Using SePay in AhaChat

Go to Create New Block → Select Payment Block → SePay

Configure:

  • Amount: Use a bot variable, e.g., {{price}}

  • QR Code: Use an API to generate a QR code link

Generate a Payment QR Code:

Use VietQR API to create a dynamic QR Code:

https://api.vietqr.io/image/<BANK_ID>-<ACCOUNT_NO>-aPb5vJk.jpg?accountName=<ACCOUNT_NAME>&amount=<AMOUNT>&addInfo=<DESCRIPTION>

Example:

https://api.vietqr.io/image/970423-02066890000-aPb5vJk.jpg?accountName=TRAN%20VAN%20A&amount=150000&addInfo=ABCD1234

Replace:

Step 4: Set Up Conditional Branching After Payment

After the customer transfers the money and SePay verifies the transaction:

  • Payment Success → the bot will continue processing the order

  • Payment Failed → resend payment instructions to the customer

👉 You can also add a button to open a Webform showing the QR code and payment details for easy access.