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

# Verify Bank with Micro-deposits

> Learn how to verify a user's bank account ownership by initiating micro-deposits - small deposits that are sent to the account and must be verified by the user to confirm account ownership.

## 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](/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](/docs/working-with-webhooks), your application will be notified throughout this process via micro-deposit related [events](/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.

<CodeGroup>
  ```bash HTTP theme={"dark"}
  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 retrieve_funding_source.rb theme={"dark"}
  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 retrieve_funding_source.php theme={"dark"}
  <?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 retrieve_funding_source.py theme={"dark"}
  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 theme={"dark"}
  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'
  });
  ```
</CodeGroup>

# Step 1: Initiate micro-deposits

Once you POST to the [initiate-micro-deposits](/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 <Tooltip tip="Webhooks are automated notifications sent to your application when specific events occur in the Dwolla system">webhooks</Tooltip>, 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.

<CodeGroup>
  ```bash HTTP theme={"dark"}
  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 initiate_micro_deposits.rb theme={"dark"}
  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 initiateMicroDeposits.js theme={"dark"}
  var fundingSourceUrl =
    "https://api-sandbox.dwolla.com/funding-sources/e52006c3-7560-4ff1-99d5-b0f3a6f4f909";

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

  ```python initiate_micro_deposits.py theme={"dark"}
  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 initiate_micro_deposits.php theme={"dark"}
  <?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
  );
  ?>
  ```
</CodeGroup>

# 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.

<Info>
  In the
  <Tooltip tip="A testing environment that mimics the production environment but uses test data instead of real money">Sandbox</Tooltip>
  environment, any amount below \$0.10 will allow you to verify the account
  immediately.
</Info>

<CodeGroup>
  ```bash HTTP theme={"dark"}
  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 verify_micro_deposits.rb theme={"dark"}
  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 verifyMicroDeposits.js theme={"dark"}
  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);
  ```

  ```python verify_micro_deposits.py theme={"dark"}
  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 verify_micro_deposits.php theme={"dark"}
  <?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
  );
  ?>
  ```
</CodeGroup>

### Handle failed verification attempts

Your [customer](/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](/docs/api-reference/events) will be triggered and a `failed-verification-micro-deposits` link will be returned in the [response for the funding source](/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](/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](/docs/api-reference/funding-sources/initiate-or-verify-micro-deposits) to the funding source created in the previous step.
4. [Verify the funding source](/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.
