Issue with transferring funds from customer to account


(Yasho Sagar) #1

How do I transfer money from a customer to account? I create customers in my application. I’m okay with transferring money from account to a customer. Now when I try to transfer money from a customer to account, I’m running into trouble. Here’s my code.

            requestBody = {
                _links: {
                    source: {
                        href: customerFSUrl
                    },
                    destination: {
                        href: obj._links.account.href
                    }
                },
                amount: {
                    currency: 'USD',
                    value: amount
                }
            };

customerFSUrl is the funding source of the customer and the destination href is the account.
upon posting to transfers,
accountToken.post(‘transfers’, requestBody)
i’m getting a 500 server error

the headers in the error look like this:


(Spencer Hunter) #2

@Yasho_Sagar, Sorry for the delay in response! Do you have an output of the raw request body that is being sent to the Dwolla API?


(Yasho Sagar) #3
requestBody = {
    _links: {
        source: {
            href: 'https://api-uat.dwolla.com/funding-sources/698ec96f-703d-4d33-a975-336d11ece0f2'
        },
        destination: {
            href: 'https://api-uat.dwolla.com/accounts/abd9f230-98af-4df8-9916-965ef3ec6a20'
        }
    },
    amount: {
        currency: 'USD',
        value: 10
    }
}

var accountToken = new client.Token({access_token: obj.access_token});

accountToken.post('transfers', requestBody).then(function(res) {
    console.log(result)
}, function(err) {
    console.log(err)
});

Here, the source is the customer and destination is the dwolla account. The funding source for the customer is created using IAV. After the funding source is created, I’m initiating a money transfer from this customer’s funding source to the Dwolla account. In response we receive a 500 Server Error There is no balance in the customer’s funding source and I’m assuming that could be the reason for 500 error.

The Dwolla account has been given some balance for testing. When initiating a transfer from Dwoll account to a customer, the transfer is happening and I see it in my sandbox console.


(Thevoodoo Project) #4

hey yasshosagar,

i am facing the same issue while transfer of funds from customer to account.
The IAV is successful
i get a 500 internal error when I initiate a transfer(deposit) from customer to account.

@spencer Can you help out please.


(Spencer Hunter) #5

@Yasho_Sagar, The request body looks okay to me. Do you have a log of the response body which includes the errorId? This will help me look up what caused the particular error.


(Yasho Sagar) #6

@spencer I’ve uploaded the screenshots of logs.
The images are above in the thread.


(Spencer Hunter) #7

Thanks @Yasho_Sagar, Can you verify that the values are getting properly set in your request? It looks like there’s an uncaught exception where you are specifying a null value in a required field. I’ve created a bug ticket to return a ValidationError instead.


(Cory Anderson) #8

(Cory Anderson) #9

(Cory Anderson) #10