Check account balance through AI chat
Workflow purpose
This guide demonstrates how to use Proto's AI agent to let customers check their account balance and recent transactions securely on web and messaging channels.
The workflow identifies the customer, verifies them with a one-time PIN sent by your core banking or OTP service, then fetches their balance and latest transactions and shows them in the chat. A full statement can be sent as a document. The chat closes once the customer is done, so account details aren't left open on a shared device.
Balance enquiries are one of the highest-volume reasons customers contact a bank, savings group or microfinance institution, and they're simple to automate once identity is verified.
Who can benefit from this guide:
- Banks and credit unions
- Microfinance institutions and savings cooperatives
- Mobile money and digital wallet providers
- Any financial institution answering balance and transaction queries
Check account balance
This workflow verifies the customer and returns their balance and recent transactions 24/7. See how to build a balance enquiry workflow.
1. Create a trigger
Start the flow when a customer asks about their balance or recent transactions.
- Navigate to the Workflows tab in the AI agent settings.
- Click New workflow and select Message received as the Workflow type.
- Name the trigger (e.g. “Account Balance”) and add a short description (e.g. “Triggers if user wants to check their account balance, available funds or recent transactions.”).
- Add training phrases (e.g. “What’s my balance”, “How much money do I have”, “Check my account”, “Show my last transactions”, “Has my salary come in”).
2. Identify the customer
Ask for the account and a registered contact detail.
Add an Ask survey action. Action title: Customer identification
| Field | Variable | Type | Invalid reply |
|---|---|---|---|
| Account number | account_number |
Text | Please enter your account number |
| Registered mobile number | mobile |
Phone | Please enter the mobile number registered on your account |
Keep Enable skip off for both fields. On WhatsApp, you can use {_channel_profile.phone_number} as the mobile number instead of asking for it, so the PIN can only go to the number the customer is chatting from.
3. Verify with a one-time PIN
Confirm the customer owns the account before showing any details.
Add a Send API action (HTTP method: POST) to your OTP service, sending account_number and mobile. Your service checks they match and sends a one-time PIN by SMS. Resulting variable: otp_request.
Add a Send message:
“I’ve sent a 6-digit PIN by SMS to your registered number. Please enter it below. It expires in 5 minutes.”
Then add an Ask survey action. Action title: PIN check
| Field | Variable | Type | Invalid reply |
|---|---|---|---|
| One-time PIN | otp_code |
Number | Please enter the 6-digit PIN from the SMS |
Add a Send API action (HTTP method: POST) that checks otp_code with your OTP service. Resulting variable: otp_result. Add a Branch:
- If
otp_result["verified"] == true: continue to Step 4. - Else: Send message saying the PIN didn’t match, then a Jump action back to the PIN check. Use a Set variable counter and a further Branch to stop after three attempts and hand over to a live agent.
4. Show the balance
Fetch the balance from your core banking system.
Add a Send API action:
- HTTP method: GET
- URL endpoint: your core banking system’s balance endpoint, passing
account_number - Headers: the authorisation key your system requires
- Resulting variable:
account
Add a Send message:
“Your {account[“product_name”]} ending {account[“last4”]} has an available balance of {account[“available_balance”]}. Current balance: {account[“ledger_balance”]}.“
Show only the last digits of the account number in messages, as chats can be seen on lock screens and shared devices.
5. Show recent transactions
Add a Send message with quick reply options: Recent transactions | Full statement | That’s all.
- Under a Message received sub-trigger for Recent transactions, add a Send API action (HTTP method: GET) that fetches the last five transactions into
transactions, then a Send message listing them, e.g. “{transactions[0][“date”]} – {transactions[0][“description”]} – {transactions[0][“amount”]}“. - Under Full statement, add a Send API action that generates a statement, then a Send attachment action. File format: Document. Source: Chat script, e.g.
statement["url"].
6. Close the chat
End the session once the customer is finished, so the details aren’t left open.
Under the That’s all sub-trigger, add a Send message (“Thanks for banking with us. For your security, I’m closing this chat.”) followed by a Close chat action.
For anything the AI agent can’t answer – a disputed transaction, a missing payment – add a Live agent handoff action assigned to your customer service team, with Live agent availability check turned on.
7. Test the flow
Validate every path before going live using the AI agent tester side panel.
- Test a matching and a mismatched account number and mobile number.
- Enter a wrong PIN three times and confirm the handoff.
- Check the balance, transactions and statement against a test account.
- Confirm the chat closes after That’s all, and that a new chat asks for verification again.
- Build and test in an undeployed version – Duplicate the live version first – then Deploy it once every path passes.
Finalise the AI agent deployment by configuring your preferred channels and languages.
.png)