'Invalid amount' error


(Max Shamaev) #1

Could you please advise what is wrong with this request?

Request URL: api-uat.dwolla.com/transfers

Request headers:
Accept: application/vnd.dwolla.v1.hal+json
Content-Type: application/vnd.dwolla.v1.hal+json
Authorization: Bearer …

Request body:
{"_links":{“source”:{“href”:“https://api-uat.dwolla.com/funding-sources/907a5914-6f43-4b43-afc2-fe139a6dd5ac"},“destination”:{“href”:“https://api-uat.dwolla.com/accounts/d00ef2aa-e66c-41d5-ac18-587811e13ae9”}},“amount”:{“value”:“10.00”,“currency”:“USD”},“metadata”:{“txnid”:"123”}}

Response:
{“code”:“ValidationError”,“description”:“Validation error(s) present. See embedded errors list for more details.”,“message”:“Validation error(s) present. See embedded errors list for more details.”,"_embedded":{“errors”:[{“code”:“Invalid”,“message”:“Invalid amount.”,“path”:"/amount/value"}]}}

Was made based on this documentation:
https://developers.dwolla.com/guides/receive-money/01-direct-onboarding.html (Step D)
https://docsv2.dwolla.com/#transfers


(Spencer Hunter) #2

@max, It appears that the source funding source that you are specifying is a Dwolla balance which has $0 in it. As soon as you send money to that account’s Dwolla balance and you should be good to re-initiate the transfer!


(Mac) #3

I’m having trouble getting started in the sandbox. How do I fund a fictitious customer’s bank account, so I can start transferring money between my application’s fictitious customers?


(Shea Daniels) #4

Hi @mmack3540,

When you signed up for a sandbox account, you should have ended up with a funding source on your account and some starter money in your balance. You can send that to your customers to get going. If you want to simulate more money moving into the network, you can initiate a transfer from that funding source to a customer and use the Sandbox Console to finish processing it.

If you want to source a transfer from a customer, or add money to a verified customers balance directly, you’ll need to add and verify a funding source for that customer first. Those endpoints are listed here


(Darius S) #5

Thanks for the help, I have related questions to the ‘invalid amount’ error message.

If a customer’s Wells Fargo bank account shows $5k, does their Dwolla account show $5k? If not, is there an additional step I need to create for bringing the money into their Dwolla account from their bank, and then transferring it to another customer’s bank?

How can I make sure that when I leave the Sandbox, the customer accounts are accessible, and not throwing an ‘Invalid amount’ error?


(Spencer Hunter) #6

@DesignerDarius, Dwolla doesn’t know this level of detail (current availability of “good funds”) which is at the bank level. Therefore those funds aren’t made available within in the customer’s Dwolla account(balance) until an ACH transfer is created and completed. It sounds like you’re wanting to initiate an ACH debit from a customer’s bank into the Dwolla network (balance), which is possible using our API. You’d first attach the funding source (bank account) to an account in Dwolla. Once you have that bank attached, the API will return a funding source url which is used to identify the customer’s bank for initiating bank transfers (source). You’d then want to fetch the list of funding sources to obtain the balance funding source url, which is used to identify the destination of the transfer. Once that transfer completes, the funds will be made available in the Dwolla account (balance) and can then be sent on to another party.

I do want to point out that you can use the funding source url that is used to identify the customer’s bank for initiating bank transfers to another customer. You don’t necessarily have to fund the balance and then create another transfer to another customer.


(Darius S) #7

Ok, that is good to know.

If I may, let me lay out what I currently have developed, and if I am missing a step or detail then that’d be great to know.

Tenant Flow

Step 1
Tenant fills out a form which includes: First Name, Last Name, Email, Account Number, Routing Number, “checking” or “savings,” and the Account Nickname.

Step 2
The form calls our API which connects, gets authorization from Dwolla, and creates a customer with the tenant’s form information. Their bank data specifically gets stored in their “/funding-sources” and in return Dwolla gives me a one-time use IAV token which I send to the front-end.

Step 3
That IAV token gets used in the front-end through the Dwolla javascript snippet I copy and paste from Dwolla’s API docs. The snippet looks for a button click and then starts the verification process using the one-time use IAV token and Dwolla’s bank login container (#iavContainer). Once they’ve logged into their bank through Dwolla’s container, Dwolla returns the href to the tenant’s funding-source, which I’ll use later so I attach it to their user profile in my database.

The tenant’s Dwolla customer account is now 100% complete and ready to send money to a verified customer of ours.

Owner Flow
Step 1
Same as tenant’s “Step 1” but with additional form inputs to verify their identity: Type (personal), Address1, City, State, postalCode, dateOfBirth, last-four of ssn

Step 2
Same as tenant’s “Step 2” but stores additional form data (identity data for Dwolla verification) to Dwolla and my database.

Step 3
Same as tenant’s “Step 3”

The owner’s Dwolla customer account is now 100% complete and ready to receive money because they’re a verified customer of ours with the identity data that was submitted in “Step 1.”

Transfer
Step 1
Create a new form for transferring funds that accepts a tenant email, an owner email, and a dollar amount.

Step 2
Submitting the form, using their emails, we find both the tenant’s and owner’s funding-source urls. We add the tenant’s funding-source url to the “requestBody” under _links.source.href and add the owner’s funding-source url to the “requestBody” under _links.destination.href and the dollar amount to the “requestBody” under amount.value with amount.currency hardcoded to ‘USD’ - then we send the “requestBody” to post to Dwolla’s transfer API.

Step 3
If the transfer is successful, Dwolla’s transfer API gives me back the location header which is the URL of the transfer. Which I store in my tenant’s and owner’s user profiles in my database just for the record.

The money is now transferred successfully because both bank accounts were verified with IAV and the owner identity was verified (because at least one customer needs to have their identity verified).


I currently have this setup running on Dwolla’s sandbox, but I still have to go into Dwolla and press the “Process Bank Transfers” button. If I am out of the sandbox, will that transfer happen without me needing to press the button?

Thanks in advance for all your help :slight_smile:


(Spencer Hunter) #8

@DesignerDarius, See my comments and feedback below.
With regards to authorization, you’ll only need to obtain authorization for the application which will be calling the API to create Customers. A single access token which belongs to you is in charge of facilitating all Customer interaction in the API.

Tenant Flow
The steps you outline here look mostly correct, however there’s no need to collect information about the users bank account if you’re also wanting to send them through the IAV flow. The IAV flow does two things; 1) adds the funding source and 2) verifies the funding source.

Owner Flow
Step 1: the only change here would be creating a business Verified Customer account.

  • step 1a) Depending on if the Customer passes the identity verification check, you may need to ask for additional information from the customer depending on their Customer verification status. Read more here on handling customer verification statuses.

Transfers
Everything looks good here. I’d recommend setting up a webhook subscription for listening to transaction state changes (bank transfers moving from pending to processed, or failed). Yes, once you move out of the Sandbox then transactions will follow the normal ACH transaction timeline.