Hello! I’m using Braintree for front-end transactions (credit/debit Drop-In UI) and Dwolla for back-end payouts via ACH (with a facilitator fee). When I try to initiate a transfer via my Python API, I’m getting this error printed:
dwollav2.error.BadRequestError: {"code":"BadRequest","message":"The request body contains bad syntax or is incomplete."}
However, I printed the full request body and found that it contains all required parameters and is formatted correctly. What else usually causes this error? Here is what I do in my API:
# Using dwollav2 - https://github.com/Dwolla/dwolla-v2-python
request_body = {
'_links': {
'source': {
'href': 'https://api-sandbox.dwolla.com/funding-sources/{my_dwolla_funding_source_id}'
},
'destination': {
'href': dest
}
},
'amount': {
'currency': 'USD',
'value': amount
},
'fees':[
{
'_links': {
'charge-to': {
'href': dest
}
},
'amount':{
"value":feeAmount,
'currency':'USD'
}
}
]
}
transfer = app_token.post('transfers', request_body)
transfer.headers['location']
print(request_body)