Verify Bank Account
Before sending money, verify the recipient’s account number to confirm the account name and ensure you’re sending to the right person. Always do this before executing a transfer.
Always verify an account before transferring. Sending to an incorrect account number may result in an unrecoverable loss of funds.
Usage
import { Pay100 } from "@100pay-hq/100pay.js";
const client = new Pay100({
publicKey: "your_public_key",
secretKey: "your_secret_key",
});
const result = await client.bankTransfer.verifyBank({
bankCode: "044", // From the getBankList() response
accountNumber: "1234567890",
});
if (result.data.verified) {
console.log("Account name:", result.data.accountName);
// => "JOHN DOE"
} else {
console.error("Account not found or verification failed");
}Parameters
| Field | Type | Required | Description |
|---|---|---|---|
bankCode | string | âś… | Bank code from getBankList() |
accountNumber | string | ✅ | Recipient’s bank account number |
Response
{
"statusCode": 200,
"message": "Account verified",
"data": {
"accountName": "JOHN DOE",
"accountNumber": "1234567890",
"bankCode": "044",
"bankName": "Access Bank",
"verified": true
}
}IVerifyBankResponse
| Field | Type | Description |
|---|---|---|
data.verified | boolean | true if the account exists and was verified |
data.accountName | string | Account holder’s registered name |
data.accountNumber | string | The account number that was verified |
data.bankCode | string | Bank code of the account |
data.bankName | string | Full bank name |
Displaying to Users
Use the verified name to let users confirm the recipient before proceeding:
const verification = await client.bankTransfer.verifyBank({
bankCode: selectedBank.bankCode,
accountNumber: userInputAccountNumber,
});
if (verification.data.verified) {
// Display for user confirmation
showConfirmationPrompt({
message: `Sending to: ${verification.data.accountName}`,
onConfirm: () => executeTransfer(verification.data),
});
} else {
showError("We could not verify this account. Please check the details.");
}Next Steps
- Execute Transfer — send funds once the account is verified
- List Banks — get bank codes to use in this call
Last updated on