Send Payouts to Recipients without OAuth


(Aguayma) #1

Framework: RoR
version: 4.2.0
ruby version: 2.3.0

Looking at the API it states that to send money to a recipient that an OAuth token is needed. Our particular situation is that I need to send money to clients from our business account to the recipients account.

Is it possible to do this? Ideally I would want to be able to set up the system in a way that the funds only come out of our business bank account.

Currently using the following gem sets
gem 'dwolla-ruby’
gem ‘omniauth-dwolla’


(Spencer Hunter) #2

@aguayma, For a payouts scenario you don’t necessarily have to implement the 3-legged OAuth flow into your application, however you will need an OAuth user account access token for the Dwolla account that is making the payout. You can obtain a user account access token for your own account in two different ways. 1.) Implement OAuth into your application or 2.) Login to dwolla.com and use the token generator to obtain an access token for the business account. Once you have an access token and refresh token pair for your business then you can store them and call to refresh and update your existing token set when your access token expires.

For sending money to recipients you have a few different options. Option 1: Using your access token you’ll call our API to payout to an email address. When you transfer money to an email the recipient will be sent an email from Dwolla asking them to claim their funds. When the user clicks claim funds in the email, they will be asked to create a lightweight Dwolla account which requires a user name, password, and entering in their bank account details. Once complete, the money will move forward with attempting to process to the bank account attached to the recipient lightweight Dwolla account. (Funds will stay pending until the user claims the funds)

Option 2: Implement the OAuth flow into your application for provisioning the user prior to making the payout. Once the user completes the OAuth flow they’ll be set up to receive payments. Your application will get back an access token, refresh token, and an account_id. The account id will then be used as the destination(instead of email) for the recipient receiving the payout.

The alternative to leveraging Dwolla accounts for receiving payments would be to integrate with our white label product which comes at an increased cost. In this instance the user will not interact with Dwolla; only your application when receiving funds. You’ll call our API to create the Customer, once the Customer is set up you’ll provide a form to collect the bank details for the receiving user. For learning more on white label, I’d recommend reaching out to Dwolla sales.

Regardless of which approach you decide to go with I’d recommend the following links:
Dwolla v2 ruby
API v2 documentation

Don’t hesitate to reach out if you have any follow up questions or run into issues with working with our v2 API!


(Spencer Hunter) #4

Hi @aguayma, Before diving into your issue, It looks like you are using the v1 ruby gem and attempting to call the v1 API. It’s definitely okay to use the v1 API, however I’d recommend using the v2 API has added benefits from a developer experience perspective.

For API v1: Using the user account access token for the Dwolla account that is initiating the payout you’ll want to specify the funding source id of the funding source that is making the payout. You can first retrieve the account’s list of funding sources to locate the fundsSource id you want to use for the payout. The id you specify will be used in the request to create the mass payment.

For API v2: Using the user account access token for the Dwolla account that is initiating the payout you’ll want to take similar steps as described above. You’ll need to specify the link to the funding source that is making the payout. You can first retrieve the account’s list of funding sources to locate the link to the funding source you want to use for the payout. This link will be used as the “source” link in the body of the request to initiate a mass payment. If you’re looking to use v2 here’s the gem you should use: https://github.com/Dwolla/dwolla-v2-ruby

Let us know if you continue to run into issues. :slight_smile: