# Verify bank account payment source

> For the complete machine-readable documentation index, see [llms.txt](https://apidocs.chargebee.com/llms.txt).


[Idempotency Supported](/docs/api/idempotency)

This API can be used to verify bank accounts which have been added as payment source. This is applicable for **Stripe ACH with micro-deposit mode bank accounts** only. Stripe handles verification in two ways - via Plaid, and micro-deposit.

For verifying bank accounts via **micro-deposit**, Stripe deposits two small amounts to the bank account being added. These deposits will take 1-2 business days to appear on the customer's bank statement. The bank statement description for the two micro-deposits contains the amount and the values deposited. Your customer will need to relay the value of the two deposits to you, after which you can verify the bank account. Once the bank account has been verified, the payment source will be marked as "Valid".

A maximum of 10 failed verification attempts are allowed. Once this limit has been crossed, the bank account can no longer be verified, and will be marked as "Invalid" in Chargebee.

## Sample Request

#### cURL

```bash
curl  https://{site}.chargebee.com/api/v2/payment_sources/pm___test__XpbTXGTSRp4YjRFc/verify_bank_account \
     -u {site_api_key}:\
     -d amount1=32 \
     -d amount2=45
```

#### .NET

```dotnet
using ChargeBee.Api;
using ChargeBee.Models;

ApiConfig.Configure("{site}","{site_api_key}");
EntityResult result = PaymentSource.VerifyBankAccount("pm___test__XpbTXGTSRp4YjRFc")
		.Amount1(32)
		.Amount2(45)
		.Request();

PaymentSource paymentSource = result.PaymentSource;
```

#### Go

```go
package main
import (
    "fmt"
    "github.com/chargebee/chargebee-go/v3"
    paymentsourceAction "github.com/chargebee/chargebee-go/v3/actions/paymentsource"
    "github.com/chargebee/chargebee-go/v3/models/paymentsource"
)
func main() {
    chargebee.Configure("{site_api_key}","{site}");
    res,err := paymentsourceAction.VerifyBankAccount("pm___test__XpbTXGTSRp4YjRFc", &paymentsource.VerifyBankAccountRequestParams{
        Amount1 : chargebee.Int64(32),
        Amount2 : chargebee.Int64(45),
    }).Request()
    if err != nil {
        fmt.Println(err)
    } else {
        PaymentSource := res.PaymentSource
    }
}
```

#### Go

```go
package main

import (
  "fmt"
  "github.com/chargebee/chargebee-go/v4"
)

func main() {
  config := &chargebee.ClientConfig{
    SiteName: "{site}",
    ApiKey: "{site_api_key}",
  }    
  client := chargebee.NewClient(config)
  req := &chargebee.PaymentSourceVerifyBankAccountRequest{
    Amount1 : chargebee.Int64(32),
    Amount2 : chargebee.Int64(45),
}
  res, err := client.PaymentSource.VerifyBankAccount("pm___test__XpbTXGTSRp4YjRFc", req)
      if err != nil {
        fmt.Println(err)
    } else {
        PaymentSource := res.PaymentSource
    }
}
```

#### Java

```java
import com.chargebee.*;
import com.chargebee.ListResult;
import com.chargebee.models.*;
import com.chargebee.models.enums.*;
import java.io.IOException;

public class Sample {

    public static void main(String args[]) throws IOException, Exception {
        Environment.configure("{site}", "{site_api_key}");
        Result result = PaymentSource.verifyBankAccount("pm___test__XpbTXGTSRp4YjRFc")
            .amount1(32L)
            .amount2(45L)
            .request();

        PaymentSource paymentSource = result.paymentSource();
    }
}
```

#### Java

```java
import com.chargebee.v4.client.ChargebeeClient;
import com.chargebee.v4.models.paymentSource.PaymentSource;
import com.chargebee.v4.models.paymentSource.params.PaymentSourceVerifyBankAccountParams;
import com.chargebee.v4.models.paymentSource.responses.PaymentSourceVerifyBankAccountResponse;

public class PaymentSourceVerifyBankAccount {

    public static void main(String[] args) {
        ChargebeeClient client = ChargebeeClient.builder()
            .apiKey("{site_api_key}")
            .siteName("{site}")
            .build();

        PaymentSourceVerifyBankAccountParams params = PaymentSourceVerifyBankAccountParams.builder()
            .amount1(32L)
            .amount2(45L)
            .build();

        PaymentSourceVerifyBankAccountResponse response = client
            .paymentSources()
            .verifyBankAccount("pm___test__XpbTXGTSRp4YjRFc", params);

        PaymentSource paymentSource = response.getPaymentSource();
    }
}
```

#### Node.js

```node
import Chargebee from "chargebee";

const chargebee = new Chargebee({
    site: "{site}",
    apiKey: "{site_api_key}",
});

try {
    const result = await chargebee.paymentSource.verifyBankAccount("pm___test__XpbTXGTSRp4YjRFc", {
        amount1: 32,
        amount2: 45
    });

    console.log(result);
    const paymentSource = result.payment_source;
} catch (err) {
    console.log(err);
}
```

#### PHP

```php
<?php

require __DIR__ . '/vendor/autoload.php';

use Chargebee\ChargebeeClient;

$chargebee = new ChargebeeClient(options: [
    "site" => "{site}",
    "apiKey" => "{site_api_key}",
]);
$result = $chargebee->paymentSource()->verifyBankAccount("pm___test__XpbTXGTSRp4YjRFc", [
    "amount1" => 32,
    "amount2" => 45
]);
$paymentSource = $result->payment_source;
```

#### Python

```python
from chargebee import Chargebee

cb_client = Chargebee(api_key="{site_api_key}", site="{site}")
response = cb_client.PaymentSource.verify_bank_account("pm___test__XpbTXGTSRp4YjRFc",
    cb_client.PaymentSource.VerifyBankAccountParams(
        amount1=32,
        amount2=45
    )
)
payment_source = response.payment_source
```

#### Ruby

```ruby
require 'chargebee'

ChargeBee.configure(:site => "{site}",
  :api_key => "{site_api_key}")

result = ChargeBee::PaymentSource.verify_bank_account("pm___test__XpbTXGTSRp4YjRFc",{
  :amount1 => 32,
  :amount2 => 45
})

payment_source = result.payment_source
```

## Sample Response

```json
{
  "payment_source": {
    "bank_account": {
      "account_holder_type": "individual",
      "account_type": "not_applicable",
      "bank_name": "US Bank",
      "last4": "2227",
      "name_on_account": "Shay Liam",
      "object": "bank_account"
    },
    "created_at": 1517487262,
    "customer_id": "__test__XpbTXGTSRp4YNIFZ",
    "deleted": false,
    "gateway": "stripe",
    "gateway_account_id": "gw___test__5SK2lMpwSRp4Ljs2t",
    "id": "pm___test__XpbTXGTSRp4YjRFc",
    "issuing_country": "US",
    "object": "payment_source",
    "reference_id": "cus_J7rW1Bl7xQoLOW/ba_1IVbmzJv9j0DyntJXpjNOH1r",
    "resource_version": 1517487263313,
    "status": "valid",
    "type": "direct_debit",
    "updated_at": 1517487263
  }
}
```

## URL Format

**POST** https://[site].chargebee.com/api/v2/payment_sources/{cust-payment-source-id}/verify_bank_account

## Input Parameters

- `amount1` (required, in cents, min=0)
  Value of the micro-deposits sent to the bank account.

- `amount2` (required, in cents, min=0)
  Value of the micro-deposits sent to the bank account.

## Returns

- `payment_source` (Payment source object)
  Resource object representing payment\_source
