Integration - Verify Bank Account

Learn how to verify the customer bank account details.

Bank account verification is a sub-service of Cashfree payouts that allows a merchant to verify their end customer's bank details. This section provides details on how to integrate bank account verification from scratch.

Payouts: Bank Account Verification

Steps

  1. ​Setup​

Check out our libraries and samples section for the integration code hosted on GitHub.

Step 1: Setup

Get your corresponding clientId and clientSecret from your payout dashboard and ensure that your IP is whitelisted as well. Check our development quickstart here.

Host URL: Use the following URL for PROD and TEST, respectively:

For the production environment: https://payout-api.cashfree.com​

For the test environment: https://payout-gamma.cashfree.com​

Step 2: Initialization and Authorisation

Call the authenticate API to Cashfree's system/server to obtain an Authorization Bearer token. All other API calls must have this token as Authorization header in the format 'Bearer <token>' (without quotes) for them to be processed. Learn more about the authorize API here.

Curl
Node
Python
Java
Curl
curl -X POST \
'http://{{Host%20Url}}/payout/v1/authorize' \
​
-H 'X-Client-Id: {{client id}}' \
-H 'X-Client-Secret: {{client secret}}' \
-H 'cache-control: no-cache'
Node
//require CashfreeSDK
const cfSdk = require('cashfree-sdk');
​
//access the PayoutsSdk from CashfreeSDK
const {Payouts} = cfSdk;
const {Validation} = Payouts;
​
//create config object by passing Environment, ClientID and ClientSecret
const config = {
Payouts: {
"ClientID": "client_id",
"ClientSecret": "client_secret",
"ENV": "TEST",
}
};
​
//Initialise PayoutsSdk by passing the config obj
Payouts.Init(config.Payouts);
Python
from cashfree_sdk.payouts import Payouts
from cashfree_sdk.payouts.validations import Validations
​
clientId = "your_client_id"
clientSecret = "your_client_secret"
env = "TEST"
​
Payouts.init(clientId, clientSecret, env)
Java
import com.cashfree.lib.clients.Payouts;
import com.cashfree.lib.constants.Constants.Environment;
​
public static void main() {
Payouts payouts = Payouts.getInstance(
Environment.PRODUCTION, "<client_id>", "<client_secret>");
payouts.init();
}

Sample Response

{"status":"SUCCESS",
"message":"Token generated",
"subCode":"200",
"data": {"token":"eyJ0eXA...fWStg", "expiry":1564130052}
}

Step 3: Verify Bank Account

Verify a bank account by passing a name, phone number, bank account, and ifsc. Verification will be done on the bank account and ifsc combination.

The operation returns a success response in two cases:

  1. The bank account or IFSC code or both are invalid.

  2. The bank account and IFSC combination are verified.

Learn more about the bankValidation API here.

Curl
Node
Python
Java
Curl
curl -X GET \
'http://{{Host%20Url}}/payout/v1/validation/bankDetails?name=John&phone=9908712345&bankAccount=026291800001191&ifsc=YESB0000262' \
-H 'Authorization: Bearer {{Token}}' \
-H 'cache-control: no-cache'
Node
//validate bank details
const response = await Validation.ValidateBankDetails({
name: "sameera",
phone: "9000000000",
bankAccount: "026291800001191",
ifsc: "YESB0000262"
});
Python
bank_validation_result = Validations.bank_details_validation(
name = "sameera",
phone = "9000000000",
bankAccount = "026291800001191",
ifsc = "YESB0000262"
)
Java
import com.cashfree.lib.clients.Payouts;
import com.cashfree.lib.clients.Validation;
import com.cashfree.lib.domains.request.BulkValidationRequest;
​
Payouts payouts = Payouts.getInstance(
Environment.PRODUCTION, "<client_id>", "<client_secret>");
payouts.init();
Validation validation = new Validation(payouts);
validation.validateBankDetails(
"JOHN", "9908712345", "026291800001191", "YESB0000262"));
}

Sample Response

{ "status": "SUCCESS",
"subCode": "200",
"message": "Amount Deposited Successfully",
"data": { "nameAtBank": "John Barnes Smith", "accountExists": "YES", "amountDeposited": "1.28", "refId": "5a7da061af50584d5992b2" } }

Check out our libraries and samples section for the integration code hosted on GitHub.

You now have a complete bank account validation integration for payouts. When testing your integration with your test API key, you can use the details available here to ensure that it works correctly.

Next Steps