Add Funding Source in Sandbox

I am using the Kotlin Dwolla client from a Java application version 0.1.1.

When I attempt (via the API) to add a funding source to a customer that does not have any funding sources, I get a successful response (200), but the funding source does not show up in the dashboard.

This is my payload:
{
“bankAccountType”: “CHECKING”,
“routingNumber”: “102000021”,
“accountNumber”: “8687245429”,
“accountName”: “RockyMountains”
}

Using this API:
com.dwolla.http.Response addResponse = dwollaClient.post(dwollaUrl + “customers/” + customerId, fundingSourceAdd);

Thanks
Dave

Hey Dave,

That does seem odd since typically you should receive a 201 from our API upon creation.

Would you be able to share the code that defines dwollaUrl and fundingSourceAdd and we’ll see if we can recreate on our side? Also, I think accountName is supposed to be name in the payload.

This particular API endpoint has a high-level method available as well if you’d like to use that instead:

dwolla.fundingSources.createForCustomer(
    customerId,
    routingNumber,
    accountNumber,
    bankAccountType, // BankAccountType.CHECKING
    name // "RockyMountains"
);

I just verified, and I am getting a 200 response, not a 201 which is fine with me.

Couple of questions on the high-level method.

  1. Where can I find documentation on the high-level functions available. I can’t seem to find them, although I do remember looking at them in the past.
  2. When I attempt to use the high-level method, it is requiring all 10 parameters, so I just put in blank values for the others, and, the funding source was created. Great news!!

Thanks
Dave

Another thing I just noticed. If I remove a funding source, when I attempt to recreate it, the API responds with a 200, but it is not created again. Changing the account number works, but this could be a bit problematic in certain cases.

Thanks
Dave

Hi @dgreenly,

Would you be able to post the x-request-id for the call that returned a 200 instead of a 201 for creating a funding-source for a deeper look? I’m not able to recreate using the Kotlin SDK.

  1. Here’s the Kotlin README section that has links to the High level methods in the SDK.
  2. The high level method for creating a funding-source should only contain 5 fields as documented by Stephen in the above message. Would you be able to share the method that you used that asked for 10 parameters?

Thanks!

Regarding adding a removed funding-source, the API does send a 201 for re-creating a previously removed funding-source. If added within 48 hours, the fs will maintain the same id, but the API response statusCode should be 201.

Would you be able to share the request-id for this request too? The request-id can be found in the x-request-id response header.

Here is the call I am making: (Format is not very clean)

If I do not have the last five empty params it does not compile.

dwollaClient.fundingSources.createForCustomer(customerId,
achInformation.getRoutingNumber(),
achInformation.getAccountNumber(),
BankAccountType.valueOf(achInformation.getBankAccountType()),
achInformation.getAccountName(),
“”,listChannel,"",false,"");

In the attachment you can see the 200 response (addResponse is the variable) I am getting from this call: (and the req ID looks like the f4f12 number in the x-request-id)

addResponse = dwollaClient.post(dwollaUrl + “customers/” + customerId, fundingSourceAdd);

The structure fundingSourceAdd has the same information for the bank account I just removed from the customer. There is not a new fs created.

Thanks
Dave

Yeah you’re right! Sorry about that @dgreenly. If you call that method in Kotlin it will default the values to null, but Java doesn’t support default values for parameters and I forgot to include them. I’ll work on adding some overloaded methods so you don’t have to guess which parameters are optional/required when using it in Java.

In the meantime, you can check our docs to see which parameters are optional/can be set to null. https://docs.dwolla.com/#create-a-funding-source-for-a-customer

I will let you know when the overloaded methods have been added.

I just noticed the URL you’re POSTing to is:

dwollaUrl + “customers/” + customerId

which would be for updating a customer. Appending /funding-sources to the URL should work.

Hi @samuelbillmills9 ! Are you referring to the $5000 you are seeing in your dashboard? If so, what you are seeing is virtual money, with no real value. You are likely operating in our Sandbox testing environment. This is an area where developers can run simulations and test using “fake” money, before switching over to actual transactions.

Please let me know if you have any questions!

Hi Shreya – I think this came to the wrong person.

Thanks

Dave

image001.jpg

Ah duh - yes I see that now. Missed that in your documentation. I put that in and the funding sources are getting created, but there is an interesting situation I found.

I have a customer that has no funding sources. (I have removed them all) Here are the steps I take:

  1. Create a new funding source
  2. Wait a few minutes, attempt to create the same funding source. I get the correct 400 error noting the bank already exists. (code = DuplicateResource)
  3. Change the account number on the request and send the request again.
  4. I get a 400 error again stating the bank already exists, but, the new funding source is created as I can view it in the sandbox dashboard. (code = DuplicateResource)

Here is the request ID from the exception I received.

@stephen Any chance to look at this? Is it better for me to tag someone - or just post? Thanks!!

Hi @dgreenly, are you able to share the Customer ID?

If I’m understanding correctly, did you mean that a new funding-source was created with unique data but you got a 400 DuplicateResource error?

@shreya - that is correct.

I was able to locate the Funding-source with the ID aa67fe10-bcd6-446a-84f3-5cf35bc964ab. However, looking at our logs, the API request to create this funding-source looks to have been successful with a statusCode=201 response.

The request with the request-id : 4d33cbe1-3c36-4c1d-bf41-d7f9e2f2de86 was made a second later to add the same funding-source which failed with a 400 and returned the existing funding-source in the response body as expected.