> ## Documentation Index
> Fetch the complete documentation index at: https://www.cashfree.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Integration - Verify Bank Account

> Integrate Cashfree Bank Account Verification from scratch to validate end-customer account numbers and IFSC details before initiating payouts.

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

**Steps**

1. Setup
2. Initialisation and authorisation
3. Verify bank account

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](https://payout-api.cashfree.com)
For the **test** environment: [https://payout-gamma.cashfree.com](https://payout-gamma.cashfree.com)

# Step 2: Initialisation 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.

<CodeGroup>
  ```curl theme={"dark"}
  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'
  ```

  ```javascript Node theme={"dark"}
  //require CashfreeSDK
  const cfSdk = require("cashfree-sdk");

  //access the PayoutsSdk from CashfreeSDK
  const { Payouts } = cfSdk;

  // Instantiate Cashfree Payouts
  const payoutsInstance = new Payouts({
    env: "TEST",
    clientId: "<CLIENT_ID>",
    clientSecret: "<CLIENT_SECRET>",
  });
  ```

  ```python theme={"dark"}
  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 theme={"dark"}
  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();
  }
  ```
</CodeGroup>

**Sample Response**

```json theme={"dark"}
{
  "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:

* The bank account or IFSC code or both are invalid.
* The bank account and IFSC combination are verified.

<CodeGroup>
  ```curl theme={"dark"}
  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'
  ```

  ```java Node theme={"dark"}
  //validate bank details
  const response = await payoutsInstance.validation.validateBankDetails({
              name: "sameera",
              phone: "9000000000",
              bankAccount: "026291800001191",
              ifsc: "YESB0000262"
          });
  ```

  ```python theme={"dark"}
  bank_validation_result = Validations.bank_details_validation(
          name = "sameera",
          phone = "9000000000",
          bankAccount = "026291800001191",
          ifsc = "YESB0000262"
      )
  ```

  ```java theme={"dark"}
  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"));
  }
  ```
</CodeGroup>

**Sample Response**

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

You now have a complete bank account validation integration for payouts. When testing your integration with your test API key, you can use the [test data for Secure ID integration](/api-reference/vrs/data-to-test-integration) to ensure that it works correctly.

<div class="hidden" data-table-of-contents="bottom">
  <p class="mt-4 font-medium flex items-center gap-2 related-docs-heading">
    <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" class="w-4 h-4">
      <path d="M3 4h7a2 2 0 0 1 2 2v13a2 2 0 0 0-2-2H3z" />

      <path d="M21 4h-7a2 2 0 0 0-2 2v13a2 2 0 0 1 2-2h7z" />
    </svg>

    <span>Related topics</span>
  </p>

  <ul>
    <li><a href="/docs/api-reference/vrs/v2/bav-v2/bank-account-verification-sync-v2">Bank Account Verification API</a></li>
    <li><a href="/docs/secure-id/kyc-stack/verify-bank-account">Bank Account Verification</a></li>
    <li><a href="/docs/api-reference/vrs/data-to-test-integration">Test Data</a></li>
    <li><a href="/docs/secure-id/get-started/integration/go-live-checklist">Go Live Checklist</a></li>
  </ul>
</div>
