## Overview

If you choose the micro-deposit method of bank verification, Dwolla will transfer two deposits of less than $0.10 to your customer’s linked bank or credit union account. After [initiating micro-deposits](https://developers.dwolla.com/docs/api-reference/funding-sources/initiate-or-verify-micro-deposits), two random amounts will post to your customer’s bank account in 1-2 business days. Once your customer sees these deposits in their account, they need to verify the two amounts in your application. If subscribed to [webhooks](https://developers.dwolla.com/docs/working-with-webhooks), your application will be notified throughout this process via micro-deposit related [events](https://developers.dwolla.com/docs/api-reference/events).

### Retrieve the funding source

After your customer has added a bank account you’ll want to retrieve the funding source to check if a `initiate-micro-deposits` link relation exists. A link to `initiate-micro-deposits` will return when an unverified `bank` funding source is eligible to receive micro-deposits.

HTTP

```ruby
retrieve_funding_source.rb
```

```php
retrieve_funding_source.php
```

```python
retrieve_funding_source.py
```

```
GET https://api.dwolla.com/funding-sources/e52006c3-7560-4ff1-99d5-b0f3a6f4f909
Accept: application/vnd.dwolla.v1.hal+json
Authorization: Bearer pBA9fVDBEyYZCEsLf/wKehyh1RTpzjUj5KzIRfDi0wKTii7DqY

...

{
  '_links': {
    'self': {
      'href': 'https://api.dwolla.com/funding-sources/e52006c3-7560-4ff1-99d5-b0f3a6f4f909'
    },
    'customer': {
      'href': 'https://api.dwolla.com/customers/36e9dcb2-889b-4873-8e52-0c9404ea002a'
    },
    'initiate-micro-deposits': {
      'href': 'https://api.dwolla.com/funding-sources/e52006c3-7560-4ff1-99d5-b0f3a6f4f909/micro-deposits'
    }
  },
  'id': 'e52006c3-7560-4ff1-99d5-b0f3a6f4f909',
  'status': 'unverified',
  'type': 'bank',
  'name': 'Test checking account',
  'created': '2015-10-23T20:37:57.137Z'
}
```

```ruby
funding_source_url = 'https://api.dwolla.com/funding-sources/e52006c3-7560-4ff1-99d5-b0f3a6f4f909'

# Using DwollaV2 - https://github.com/Dwolla/dwolla-v2-ruby (Recommended)
retrieved = app_token.get funding_source_url
retrieved.name # => 'Test checking account'
```

```php
<?php
$fundingSourceUrl = 'https://api.dwolla.com/funding-sources/e52006c3-7560-4ff1-99d5-b0f3a6f4f909';

$fsApi = DwollaSwagger\FundingsourcesApi($apiClient);

$retrieved = $fsApi->id($fundingSourceUrl);
print($retrieved->name); # => 'Test checking account'
?>
```

```python
funding_source_url = 'https://api.dwolla.com/funding-sources/e52006c3-7560-4ff1-99d5-b0f3a6f4f909'

# Using dwollav2 - https://github.com/Dwolla/dwolla-v2-python (Recommended)
retrieved = app_token.get(funding_source_url)
retrieved.body['name'] # => 'Test checking account'
```

```javascript
var fundingSourceUrl =
  "https://api.dwolla.com/funding-sources/e52006c3-7560-4ff1-99d5-b0f3a6f4f909";

dwolla.get(fundingSourceUrl).then(function(res) {
  res.body.name; // => 'Test checking account'
});
```

### Step 1: Initiate micro-deposits

Once you POST to the [initiate-micro-deposits](https://developers.dwolla.com/docs/api-reference/funding-sources/initiate-or-verify-micro-deposits) link, Dwolla will send two small amounts to your customer’s bank or credit union account. If the request is successful, Dwolla returns a `HTTP 201` and a link to the created micro-deposits resource `funding-sources/{id}/micro-deposits` in the location header. The micro-deposits resource can be later used to retrieve the status of micro-deposits or verify micro-deposit amounts. If your application is subscribed to webhooks, a webhook will be sent with the `microdeposits_added` event, notifying your application that micro-deposits are en route to your customer’s bank account.

HTTP

```ruby
initiate_micro_deposits.rb
```

```javascript
initiateMicroDeposits.js
```

```python
initiate_micro_deposits.py
```

```php
initiate_micro_deposits.php
```

```
POST https://api-sandbox.dwolla.com/funding-sources/e52006c3-7560-4ff1-99d5-b0f3a6f4f909/micro-deposits
Authorization: Bearer 8tJjM7iTjujLthkbVPMUcHLqMNw4uv5kG712g9j1RRBHplGpwo
Content-Type: application/vnd.dwolla.v1.hal+json
Accept: application/vnd.dwolla.v1.hal+json
Cache-Control: no-cache

HTTP/1.1 201 Created
Location: https://api.dwolla.com/funding-sources/e52006c3-7560-4ff1-99d5-b0f3a6f4f909/micro-deposits
```

```ruby
funding_source_url = 'https://api-sandbox.dwolla.com/funding-sources/e52006c3-7560-4ff1-99d5-b0f3a6f4f909'

# Using DwollaV2 - https://github.com/Dwolla/dwolla-v2-ruby (Recommended)
app_token.post '#{funding_source_url}/micro-deposits'
```

```javascript
var fundingSourceUrl =
  "https://api-sandbox.dwolla.com/funding-sources/e52006c3-7560-4ff1-99d5-b0f3a6f4f909";

dwolla.post(`#{fundingSourceUrl}/micro-deposits`);
```

```ruby
funding_source_url = 'https://api-sandbox.dwolla.com/funding-sources/e52006c3-7560-4ff1-99d5-b0f3a6f4f909'

# Using dwollav2 - https://github.com/Dwolla/dwolla-v2-python (Recommended)
app_token.post('%s/micro-deposits' % funding_source_url)
```

```php
<?php
$fundingSourceUrl = 'https://api-sandbox.dwolla.com/funding-sources/e52006c3-7560-4ff1-99d5-b0f3a6f4f909';

$fsApi = new DwollaSwagger\FundingsourcesApi($apiClient);

$fsApi->microDeposits([\
  'amount1' => [\
    'value' => '0.03',\
    'currency' => 'USD'\
  ],\
  'amount2' => [\
    'value' => '0.09',\
    'currency' => 'USD'\
  ]],
  $fundingSourceUrl
);
?>
```

### Step 2 - Verify micro-deposits

In the Dwolla production environment, you must wait until the micro-deposits actually post to the customer’s bank account before the account can be verified, which can take 1-2 business days. A `microdeposits_completed` event will be triggered once micro-deposits have successfully posted to the bank. Once micro-deposits have completed, a `verify-micro-deposits` link relation will return on the funding source letting your application know the funding source can be verified. When the amounts are entered for verification, the order in which they are entered doesn’t matter.

In the Sandbox environment, any amount below $0.10 will allow you to verify the account immediately.

HTTP

```ruby
verify_micro_deposits.rb
```

```javascript
verifyMicroDeposits.js
```

```python
verify_micro_deposits.py
```

```php
verify_micro_deposits.php
```

```
POST /funding-sources/e52006c3-7560-4ff1-99d5-b0f3a6f4f909/micro-deposits
Authorization: Bearer 8tJjM7iTjujLthkbVPMUcHLqMNw4uv5kG712g9j1RRBHplGpwo
Content-Type: application/vnd.dwolla.v1.hal+json
Accept: application/vnd.dwolla.v1.hal+json

{
    'amount1': {
        'value': '0.03',
        'currency': 'USD'
    },
    'amount2': {
        'value': '0.09',
        'currency': 'USD'
    }
}

HTTP 200 OK
```

```ruby
funding_source_url = 'https://api-sandbox.dwolla.com/funding-sources/e52006c3-7560-4ff1-99d5-b0f3a6f4f909'
request_body = {
  :amount1 => {
    :value => '0.03',
    :currency => 'USD'
  },
  :amount2 => {
    :value => '0.09',
    :currency => 'USD'
  }
}

# Using DwollaV2 - https://github.com/Dwolla/dwolla-v2-ruby (Recommended)
app_token.post '#{funding_source_url}/micro-deposits', request_body
```

```javascript
var fundingSourceUrl =
  "https://api-sandbox.dwolla.com/funding-sources/e52006c3-7560-4ff1-99d5-b0f3a6f4f909";
var requestBody = {
  amount1: {
    value: "0.03",
    currency: "USD",
  },
  amount2: {
    value: "0.09",
    currency: "USD",
  },
};

dwolla.post(`${fundingSourceUrl}/micro-deposits`, requestBody);
```

```ruby
funding_source_url = 'https://api-sandbox.dwolla.com/funding-sources/e52006c3-7560-4ff1-99d5-b0f3a6f4f909'
request_body = {
    'amount1': {
        'value': '0.03',
        'currency': 'USD'
    },
    'amount2': {
        'value': '0.09',
        'currency': 'USD'
    }
}

# Using dwollav2 - https://github.com/Dwolla/dwolla-v2-python (Recommended)
app_token.post('%s/micro-deposits' % funding_source_url, request_body)
```

```php
<?php
$fundingSourceUrl = 'https://api-sandbox.dwolla.com/funding-sources/e52006c3-7560-4ff1-99d5-b0f3a6f4f909';

$fsApi = new DwollaSwagger\FundingsourcesApi($apiClient);

### Handle failed verification attempts

Your [customer](https://developers.dwolla.com/docs/api-reference/customers) will have only three attempts to correctly input the two posted micro-deposit amounts. If your customer reaches the max attempts allowed, a `microdeposits_maxattempts` [event](https://developers.dwolla.com/docs/api-reference/events) will be triggered and a `failed-verification-micro-deposits` link will be returned in the [response for the funding source](https://developers.dwolla.com/docs/api-reference/funding-sources#funding-source-links). As a result, they will no longer be allowed to verify the funding source using the same two posted micro-deposit amounts. In order to retry bank account verification via micro-deposits, the following steps will need to be taken by your customer and application:

1. [Removal of the funding source](https://developers.dwolla.com/docs/api-reference/funding-sources/update-or-remove-a-funding-source) with failed micro-deposit verification attempts.
2. Wait 48 hours after the initial funding source was added to re-add the funding source.
3. [Initiate micro-deposits](https://developers.dwolla.com/docs/api-reference/funding-sources/initiate-or-verify-micro-deposits) to the funding source created in the previous step.
4. [Verify the funding source](https://developers.dwolla.com/docs/api-reference/funding-sources/initiate-or-verify-micro-deposits) using the new posted micro-deposit amounts.

Links returned on the funding source resource, e.g. `failed-verification-micro-deposits`, `initiate-micro-deposits` or `verify-micro-deposits`, will give your application insight into whether the funding source is eligible to receive or verify micro-deposits, or if it has already failed micro-deposit verification.
