Issue with Transfer between funding source and customer


(Swathi Reddy) #1

Hello guys,

Iam trying to send money from funding source to a customer on restclinet. And i get, Badrequest(400) saying “the request body contains bad syntax or is incomplete”

POST Request : https://api-uat.dwolla.com/transfers

Headers:
Authorization:Bearer oAuth
Accept:application/vnd.dwolla.v1.hal+json
Content-Type:application/json

here is the json body:

{
"_links":{
“destination”:{
“href”:“https://api-uat.dwolla.com/customer/id-id-id-id-accountid
},
“source”:{
“href”:“https://api-uat.dwolla.com/funding-sources/id-id-id-id-accountid
}
},
“amount”:{
“currency”:“USD”,
“value”:“1.00”
},
“metadata”:{
“foo”:“bar”,
“baz”:“boo”
}
}

Can you guys just let me know where am going wrong.

Regards
Swathi Nomula


(Spencer Hunter) #2

@Swathi_reddy, I see something minor which is likely the cause of the 400 error response. The resource should be a plural “customers” and not “customer”. Update your destination link to https://api-uat.dwolla.com/customers/id-id-id-id-accountid and the request should work!


(Swathi Reddy) #3

Made changes which were told. Now am getting “Customer Not Found” error. Is it beacause the customer is UnVerified? And also, I’ve tried changing customer to another funding source. But, i get the same error saying “funding source not found”.


(Spencer Hunter) #4

@Swathi_reddy, Can you provide the id of the customer you are attempting to send to?


(Swathi Reddy) #5

Here is the id : 556b9daf-632b-4d83-9007-73fb5f9f6d4e


(Spencer Hunter) #6

hmm @Swathi_reddy, That looks to be a valid customer. A few things you can check: a) if the receiving Customer has a bank attached. (needed in order to send to this customer type) and b) If the source Customer or Account that is sending is sending from a verified funding source.


(Swathi Reddy) #7

I’ve checked those two things which you have mentioned. Customer has a bank account attached with name “Superhero savings bank” and source account has verified funding source. For now, let me keep aside the transfer between customer and funding source because things are taking a lot of time.

Now, making transaction between two funding sources which are verified and both has name ‘Superhero Savings Bank’. I’ve created two sandbox accounts to check with transaction history. Still i observe same error as “funding source not found”.

Please let me know what are the things still left to correct.


(Spencer Hunter) #8

This sounds like a fake bank that we’ll attach to an Account in the Sandbox and not a Customer. Can you share some of your code and provide the request body that is resulting in the error? This will help us debug what could be causing the error. Please include the full links that you are passing into source and destination objects in the transfer request.


(Swathi Reddy) #9

here is the request body :

{
"_links":{
“destination”:{
“href”:“https://api-uat.dwolla.com/funding-sources/13e8a763-6210-4a34-8ee2-18fee1bcf246
},
“source”:{
“href”:“https://api-uat.dwolla.com/funding-sources/5a7dfb22-439b-4299-8005-a58c6ab1af98
}
},
“amount”:{
“currency”:“USD”,
“value”:“7.00”
}
}

Headers:

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

POST url: https://api-uat.dwolla.com/transfers

and error is: 400(bad request)

{
“code”: “ValidationError”,
“message”: “Validation error(s) present. See embedded errors list for more details.”,
"_embedded": {
“errors”: [
{
“code”: “Invalid”,
“message”: “Funding source not found.”,
“path”: “/_links/source/href”,
"_links": {}
}
]
}
}

Please let me know if you need any other information.


(Spencer Hunter) #10

This id represents a Account and not a Funding Source. Try looking up that accounts list of funding sources and selecting a funding source for that account (either bank or balance). A funding source must always be used as the source of a transfer.

You’ll want to also update the destination link to point to the account that you’re sending to. e.g. https://api-uat.dwolla.com/accounts/13e8a763-6210-4a34-8ee2-18fee1bcf246


(Swathi Reddy) #11

Thank you. Am able to transfer funds now.

please clarify this point,

Under destination types in “Transfers”, one option is Funding Source. then why it is not allowed to transfer funds b/w funding sources.

Regards
Swathi Nomula


(Spencer Hunter) #12

@Swathi_reddy, Between a single Dwolla account’s connected funding sources(Bank Accounts) or between two funding sources connected to different Dwolla accounts?


(Swathi Reddy) #13

two different dwolla accounts.


(Spencer Hunter) #14

@Swathi_reddy, You can’t specify the bank funding source(/funding-sources/{id}) for the source account and the bank funding source(/funding-source/{id}) for the destination account because the sending party doesn’t have access to the destination account’s bank information. The transfer will need to be made from the source funding source to a destination account.


(Swathi Reddy) #15

okey, Thankyou.


(SnapExit) #16

Please help. And what could be my problem? I’m testing the transfer from my funding source to another account with next request body:

{"_links":{"source":{"href":"https://api-uat.dwolla.com/funding-sources/b54fbc10-d0a3-4eed-a20b-8480ca966935"},"destination":{"href":"https://api-uat.dwolla.com/accounts/e55e0eae-e3ae-43e3-89ac-277fd111a58c"}},"amount":{"currency":"USD","value":1.0}}

And get the error:

{"code":"ValidationError","message":"Validation error(s) present. See
        embedded errors list for more details.","_embedded":{"errors":[{"code":"Invalid","message":"Funding
        source not found.","path":"/_links/source/href","_links":{}}]}}

Although many times I checked and my account has the funding source


(SnapExit) #17

Do you know anything about this problem? Our users can’t withdraw money now via dwolla direct :confused:


(Spencer Hunter) #18

Hey @SnapExit, Your previous request body looks correct to me. As a sanity check, are you passing in the source user’s access token when making the request?

Also, can you provide more detail on your latest error where your users can’t withdraw funds? I just tested the transfer and Direct receive flow and everything looks okay to me. Is this problem related to your previous reply?


(SnapExit) #19

Yes, it’s my mistake. I used the tokens received via the authorization_code, but not application. Thank you very much!