Dwolla ACH and Bank Payments

Demo to preview the settings

Introduction

Enable ACH/Bank payments and transfers in your application with the Dwolla API.

Prerequisites

You must have an account with Dwolla to interact with the API. Create you development account at: https://accounts-sandbox.dwolla.com/sign-up
Make sure you have a Plaid account https://dashboard.plaid.com/signup and turned on Dwolla integration in your Plaid account here: https://dashboard.plaid.com/account/integrations
Note: Plaid’s development environment is not compatible with Dwolla. Dwolla uses Sandbox and Production environments which work with Plaid's Sandbox and Production environments respectively. How to work with different environments - https://developers.dwolla.com/guides/sandbox#testing-in-the-sandbox
Image without caption

Dwolla Account Setup

To use this plugin you need to create a Dwolla account. You can create a Dwolla sandbox account at: https://accounts-sandbox.dwolla.com/sign-up.
For a production account visit https://www.dwolla.com/get-started/ or contact sales at https://www.dwolla.com/contact/
After signing up, navigate to the applications tab at https://dashboard-sandbox.dwolla.com/applications-legacy and create an app.
After creating the app copy the necessary credentials below and paste them in the Dwolla Plugin Settings in Bubble
Image without caption
Image without caption
Note: The Environment field should be set to sandbox when using Dwolla Sandbox API keys and changed to production when you go to production.

Creating Customers

Dwolla has multiple customer types with various limitations as can be seen here: https://developers.dwolla.com/resources/account-types.html. This plugin currently supports creating two customer types which are Personal Verified Customer and Unverified customer. You can choose which one to create for your app user based on your needs.
When you create a customer, a customer resource link is returned. You should save this link to your user as it would be need later on. The customer link is something like: https://api-sandbox.dwolla.com/customers/9da3aa7c-2524-430b-a751-6dc722735fce

Creating Funding Sources

When you create a customer in Dwolla, the customer needs to have a funding source in order for you to send money to or receive money from the customer. There are two types of Dwolla funding sources which are balance and bank. Read more here: https://docs.dwolla.com/#funding-sources. In this documentation we would only be handling bank funding sources.
💡
Hint: To simplify the process of adding a bank funding source, this plugin is designed to work with the Plaid plugin by Copilot. You would use Plaid to collect the user's account details and then continue the process with Dwolla.
Also, you would likely want to charge your users variable amounts in the future, to do this, you need to create a funding source with an on-demand transfer authorization. Read more here: https://docs.dwolla.com/#create-an-on-demand-transfer-authorization
We will now go through the steps of creating a funding source for a customer with an on-demand transfer authorization.
In your application where you want a user to add their bank account you need to get an on-demand transfer authorization after they click a similar button to the one below:
Image without caption
Your workflow should be like below:
Image without caption
  • Create on-demand transfer authorization
  • Set the body text returned by the first action on the Authorization Popup
  • Set the actual authorization link returned by the first action on the Authorization Popup
Image without caption
  • Display the authorization popup with the body text being shown and a confirmation button like below (Note: This text is displayed for demonstrative purposes)
Image without caption
When the Agree & Continue button is clicked your workflow should then:
  • Trigger Get Bankaccount with Plaid
Image without caption
  • Take the authorization link from the Popup and set it on another group (preferably the group that contains the bank account management elements)
Image without caption
Important: You need to install the Plaid plugin and set it up properly to use with this Dwolla plugin. Follow the instructions here: https://bubble.io/plugin/plaid-1520814291764x674322781867343900
Note: After you have installed and setup Plaid, make sure you have turned on Dwolla integration in your Plaid account here: https://dashboard.plaid.com/account/integrations
Image without caption
Now back to the funding source creation, after the user has selected their bank account with Plaid, your Plaid token has been created workflow would look like below:
Image without caption
  • Get a Plaid access token
  • Get bank account detail with the access token (This is optional but advised to get proper name of the bank account to save in your database)
  • Get a Dwolla Processor token
Image without caption
  • Use the Dwolla Processor token to create a dwolla funding source with authorization after Plaid has been created. (The authorization is the one saved before from the authorization popup)
Image without caption
  • Next is to create a bank account object with all the information from Plaid and most importantly the funding source link from Dwolla
Image without caption
  • Once the account object is create you should add it to the user.

Plaid-Get balance

The /accounts/balance/get endpoint returns the real-time balance for each of an Item's accounts. It can be used for existing Items that were added via any of Plaid’s other products.Parameters:
  • Client ID - Your client_id from Plaid dashboard
  • Secret Key - Secret from Plaid dashboard
  • Access Token - Access token form action Plaid - Get Access Token

Plaid-Get bank account details

The /auth/get endpoint returns the details from your Plaid bank account.Parameters:
  • Client ID - Your client_id from Plaid dashboard
  • Secret Key - Secret from Plaid dashboard
  • Access Token - Access token form action Plaid - Get Access Token
Used in plugin workflow to retrieve bank account details
Image without caption

Charging Customers

Now that you have created a funding source with an on-demand authorization, you will now be able to charge users varying amounts of money in the future. To do so, you need to use the "Receive money from Customer" plugin action.
Image without caption
Make sure you setup the plugin action correctly.
  • The Source Funding Source is the customer bank account which you want to debit. The value used here should be a funding source link as gotten from the topic above.
Image without caption
The receive money action will return a Dwolla Transfer resource link. You should extract the ID from this link and store it in a transaction object for future reference and webhook confirmations. To extract the ID from the URL, truncate from end to last 36 digits as done below
Image without caption

​Sending Funds to Customers

This is similar to above but you would simple use the "Send money to customer" action and also the source and destination would be flipped as seen below:
Image without caption

Update verified customer (NEW)

Verified Customers
Verified Customers are defined by their ability to both send and receive money, thus, being able to fit all funds flows. They can also interact with any Customer type and hold a balance funding source within the Dwolla network. Think of the Dwolla balance as a “wallet” in which a Customer can send, receive, or hold funds within the Dwolla network. With no weekly transfer limits, this Customer type is flexible for high transaction volumes.
Params:
  1. Customer ID - Customer unique identifier.
  1. Environment - Plaid Environment. Use 'production' when going live
  1. Authorization - Authorization token consisting of the word Bearer + access token (e.g. Bearer r3lybQeOjJ8Vae5VcbJyVyL67pLWmlDVhYO3MDa9MjyLzm5FIn)
  1. Body - Customer's parameters you want to change, like: email, IP address, Address (two options), city, state, postal code, phone number (10 digits).

Update unverified customer (NEW)

Unverified Customers have a default sending transaction limit of $5,000 per week. A week is defined as Monday to Sunday UTC time. As this Customer is not identity verified, they will only be able to transact with verified Customers or your Dwolla Master Account.
Params:
  1. Customer ID - Customer unique identifier.
  1. Environment - Plaid Environment. Use 'production' when going live
  1. Authorization - Authorization token consisting of the word Bearer + access token (e.g. Bearer r3lybQeOjJ8Vae5VcbJyVyL67pLWmlDVhYO3MDa9MjyLzm5FIn)
  1. Body - Customer's parameters you want to change, like: first Name, last Name, email, business Name

Create a document for a customer (NEW)

Verified Customers of type personal or business and of status document require color photos of identifying documents to be uploaded for manual review in order to be verified.
Params:
  • Customer ID - Customer unique identifier.
  • Environment - Plaid Environment. Use 'production' when going live
  • Authorization - Authorization token consisting of the word Bearer + access token (e.g. Bearer r3lybQeOjJ8Vae5VcbJyVyL67pLWmlDVhYO3MDa9MjyLzm5FIn)
  • Document Type - Acceptable values of: passport, license, idCard, or other. Refer to the acceptable documents section for more information on how these document types apply to each Customer type.
  • File - File contents.

List documents for a customer (NEW)

Retrieve a list of documents that belong to a Customer.
Params:
  1. Customer ID - Customer unique identifier.
  1. Environment - Plaid Environment. Use 'production' when going live
  1. Authorization - Authorization token consisting of the word Bearer + access token (e.g. Bearer r3lybQeOjJ8Vae5VcbJyVyL67pLWmlDVhYO3MDa9MjyLzm5FIn)

Webhooks

To receive webhooks in Dwolla, you need to subscribe to them with the plugin action "Create webhook subscription".
Ideally you are going to create 2 subscriptions. The first one is to initialize the API endpoint to fetch the request data. More information -https://developers.dwolla.com/guides/webhooks/create-subscription#step-2-create-a-webhook-subscription
On a test page in your app simple add a workflow to create a webhook subscription. The URL to be subscribed should be that of the API endpoint wherein you wish to receive these webhooks. (Note: Set your endpoint and secret key accordingly)
Image without caption
The API workflow endpoint URL should be copied from the detecting request data mode of the API endpoint like below
Image without caption
After you have subscribed to the URL gotten above, trigger a webhook event by create an unverified customer so that your endpoint can detect the request data and then you can save it.
Once this is done, create another subscription for this URL but without the /initialize portion.
If you want, you can delete the first initialize webhook subscription using the delete webhook subscription plugin action.
Handling Webhook events
The most common use of webhooks is to confirm success or failure of transfers to or from users. In your API endpoint which receives all Dwolla webhook events, you can trigger other API workflows depending on the kind of webhook event received.
Image without caption
As seen in the image above, a workflow called monthly_payment_successful is triggered when a search for monthly payment which has the ID fetched from the transfer resource URL and when the webhook event has a topic of transfer_completed. It then terminates the workflow based on the same condition. If this condition is not met, it moves on to the next one workflow action whose condition is met.

Workflow Example

Get Transfer By ID

The /transfers/[transfer_ID] endpoint for get information about transactions
  • transfer_ID - get from any transaction in your Dwolla dashboard
Image without caption
To send funds you need to get Transfer ID
Image without caption

Send money with fees

With this API Call you can make transfers from user to user with fees included.
Parameters:
  • source_ID - Funding source link obtained from your Dwolla Dashboard
Image without caption
  • destination_ID - Your customer’s Bank Funding Source link
Image without caption
  • Amount - amount of money
  • Destination_fees - Link to the associated source or destination Customer resource.
Example:
You can set a fee recipient - your platform. To do this, specify the platform’s ID.
  1. To get your platform ID, you must take the transaction ID from the transaction between your Dwolla balance and the user (which will be the source)
Image without caption
2. Create the API Call - Get Transfer By ID
Image without caption
3. Get platform ID
Image without caption
4. Send moneys with fees
Image without caption
5. Show alert on success!
Image without caption

Changelogs