Issue creating transfer 'The request body contains bad syntax or is incomplete.'


Having issues with the following code using the python dwollaswagger library

transfers_api = dwollaswagger.TransfersApi(client) body = {'_links': {'destination': {'href': ''}, 'source': {'href': ''}}, 'amount': {'currency': 'USD', 'value': '100.00'}} new_xfer = transfers_api.create(body = body)

I am completely stumped on why this will not go through. Every time I run it, I receive a 400 error with error message

{'message': 'The request body contains bad syntax or is incomplete.', 'code': 'BadRequest'}

Any ideas on how to fix this?

(Spencer Hunter) #2

Hmm, strange. I just attempted this same request (swapping out funding source links) and was able to get a successful response. I am curious if there is unnecessary whitespace somewhere in the request body that may be causing an issue.


That must have been it. Thanks for the quick response Spencer. Is there a way to add a second funding source to a Sandbox account. I am now running into this error and I would like to do it between funding sources that are not type balance

(Spencer Hunter) #4

@tgehrs, Using the user account access token of your Sandbox account you can call this endpoint. (python method) You can then verify that funding source by POSTing two amounts under $0.10 in this endpoint.

Note: You cannot initiate a bank to bank transfer between two Dwolla Accounts. You must send to the account resource like the example below. As mentioned in Shea’s reply. This is because the sender (token holder) is restricted and does not have access to view the recipients funding sources.
{'destination': {'href': ''}, 'source': {'href': ''}}, 'amount': {'currency': 'USD', 'value': '100.00'}}


Perfect thanks, to be clear it is possible to initiate a transfer between two funding sources in the same account correct?

(Spencer Hunter) #6

@tgehrs, If you are transferring from an Account’s ‘bank’ funding source to the ‘balance’ funding source then yes you can specify both resources as the source and destination. (i.e - /funding-sources/{id} & /funding-sources/{id}). However if you are wanting to transfer for example, between a user account’s link bank accounts(i.e. - checking to savings) then it will need to go to the balance first and then a subsequent transfer will need to be made out to the second bank account.


Unless the user has auto-withdrawal set, correct? If they have auto-withdrawal set how long does it take to hit their account?

(Spencer Hunter) #8

If the receiving user has auto-withdrawal set then once the funds clear to the recipient’s balance it will take an additional 1-2 business days to be available in the bank account. However, if there is an issue with the bank that is set up for auto-withdrawal then the funds will sit in the receiving user accounts balance until they fix the issue with their linked bank account.