# Add Funding Source in Sandbox

**URL:** <https://discuss.dwolla.com/t/add-funding-source-in-sandbox/5499>\
**Category:** Funding Sources\
**Created:** [January 15, 2020, 10:56pm UTC](https://discuss.dwolla.com/t/add-funding-source-in-sandbox/5499 "2020-01-15T22:56:35Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![dgreenly](https://avatars.discourse-cdn.com/v4/letter/d/a6a055/32.png) [@dgreenly](https://discuss.dwolla.com/u/dgreenly)\
**Post date:** [January 15, 2020, 10:56pm UTC](https://discuss.dwolla.com/t/add-funding-source-in-sandbox/5499/1 "2020-01-15T22:56:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![stephen](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/stephen/32/2936_2.png) [@stephen](https://discuss.dwolla.com/u/stephen)\
**Post date:** [January 16, 2020, 3:14pm UTC](https://discuss.dwolla.com/t/add-funding-source-in-sandbox/5499/2 "2020-01-16T15:14:22Z")

</div>

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:

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

```

---

<div class="post-metadata">

**Author:** ![dgreenly](https://avatars.discourse-cdn.com/v4/letter/d/a6a055/32.png) [@dgreenly](https://discuss.dwolla.com/u/dgreenly)\
**Post date:** [January 16, 2020, 6:12pm UTC](https://discuss.dwolla.com/t/add-funding-source-in-sandbox/5499/3 "2020-01-16T18:12:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dgreenly](https://avatars.discourse-cdn.com/v4/letter/d/a6a055/32.png) [@dgreenly](https://discuss.dwolla.com/u/dgreenly)\
**Post date:** [January 16, 2020, 6:27pm UTC](https://discuss.dwolla.com/t/add-funding-source-in-sandbox/5499/4 "2020-01-16T18:27:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![shreya](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/shreya/32/2154_2.png) [@shreya](https://discuss.dwolla.com/u/shreya)\
**Post date:** [January 16, 2020, 10:16pm UTC](https://discuss.dwolla.com/t/add-funding-source-in-sandbox/5499/6 "2020-01-16T22:16:41Z")

</div>

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](https://github.com/Dwolla/dwolla-v2-kotlin#high-level-methods--under-construction) 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!

---

<div class="post-metadata">

**Author:** ![shreya](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/shreya/32/2154_2.png) [@shreya](https://discuss.dwolla.com/u/shreya)\
**Post date:** [January 16, 2020, 10:19pm UTC](https://discuss.dwolla.com/t/add-funding-source-in-sandbox/5499/7 "2020-01-16T22:19:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dgreenly](https://avatars.discourse-cdn.com/v4/letter/d/a6a055/32.png) [@dgreenly](https://discuss.dwolla.com/u/dgreenly)\
**Post date:** [January 16, 2020, 10:59pm UTC](https://discuss.dwolla.com/t/add-funding-source-in-sandbox/5499/8 "2020-01-16T22:59:31Z")

</div>

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,"");

---

<div class="post-metadata">

**Author:** ![dgreenly](https://avatars.discourse-cdn.com/v4/letter/d/a6a055/32.png) [@dgreenly](https://discuss.dwolla.com/u/dgreenly)\
**Post date:** [January 16, 2020, 11:06pm UTC](https://discuss.dwolla.com/t/add-funding-source-in-sandbox/5499/9 "2020-01-16T23:06:22Z")

</div>

![image](https://global.discourse-cdn.com/dwolla/original/2X/7/70852898036ac860d4bb2b3fd634bd26838342d0.png)

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

---

<div class="post-metadata">

**Author:** ![stephen](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/stephen/32/2936_2.png) [@stephen](https://discuss.dwolla.com/u/stephen)\
**Post date:** [January 17, 2020, 4:20pm UTC](https://discuss.dwolla.com/t/add-funding-source-in-sandbox/5499/10 "2020-01-17T16:20:14Z")

</div>

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](https://docs.dwolla.com/#create-a-funding-source-for-a-customer)

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

---

<div class="post-metadata">

**Author:** ![stephen](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/stephen/32/2936_2.png) [@stephen](https://discuss.dwolla.com/u/stephen)\
**Post date:** [January 17, 2020, 4:25pm UTC](https://discuss.dwolla.com/t/add-funding-source-in-sandbox/5499/11 "2020-01-17T16:25:15Z")

</div>

I just noticed the URL you’re `POST`ing to is:

`dwollaUrl + “customers/” + customerId `

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

---

<div class="post-metadata">

**Author:** ![shreya](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/shreya/32/2154_2.png) [@shreya](https://discuss.dwolla.com/u/shreya)\
**Post date:** [January 17, 2020, 5:49pm UTC](https://discuss.dwolla.com/t/add-funding-source-in-sandbox/5499/12 "2020-01-17T17:49:38Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![dgreenly](https://avatars.discourse-cdn.com/v4/letter/d/a6a055/32.png) [@dgreenly](https://discuss.dwolla.com/u/dgreenly)\
**Post date:** [January 17, 2020, 6:01pm UTC](https://discuss.dwolla.com/t/add-funding-source-in-sandbox/5499/13 "2020-01-17T18:01:02Z")

</div>

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

Thanks

Dave

![image001.jpg](https://global.discourse-cdn.com/dwolla/original/2X/f/f464dd1c7c382c015b3fc53eebe1cd1aadffee61.jpeg)

---

<div class="post-metadata">

**Author:** ![dgreenly](https://avatars.discourse-cdn.com/v4/letter/d/a6a055/32.png) [@dgreenly](https://discuss.dwolla.com/u/dgreenly)\
**Post date:** [January 21, 2020, 4:47pm UTC](https://discuss.dwolla.com/t/add-funding-source-in-sandbox/5499/15 "2020-01-21T16:47:16Z")

</div>

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.

 ![image](https://global.discourse-cdn.com/dwolla/original/2X/3/30113202dc4429805bed7f3916987c0b74d5a6e2.png)

---

<div class="post-metadata">

**Author:** ![dgreenly](https://avatars.discourse-cdn.com/v4/letter/d/a6a055/32.png) [@dgreenly](https://discuss.dwolla.com/u/dgreenly)\
**Post date:** [January 24, 2020, 3:30pm UTC](https://discuss.dwolla.com/t/add-funding-source-in-sandbox/5499/16 "2020-01-24T15:30:12Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![shreya](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/shreya/32/2154_2.png) [@shreya](https://discuss.dwolla.com/u/shreya)\
**Post date:** [January 24, 2020, 3:52pm UTC](https://discuss.dwolla.com/t/add-funding-source-in-sandbox/5499/17 "2020-01-24T15:52:34Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![dgreenly](https://avatars.discourse-cdn.com/v4/letter/d/a6a055/32.png) [@dgreenly](https://discuss.dwolla.com/u/dgreenly)\
**Post date:** [January 24, 2020, 4:15pm UTC](https://discuss.dwolla.com/t/add-funding-source-in-sandbox/5499/18 "2020-01-24T16:15:12Z")

</div>

@shreya - that is correct.

---

<div class="post-metadata">

**Author:** ![shreya](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/shreya/32/2154_2.png) [@shreya](https://discuss.dwolla.com/u/shreya)\
**Post date:** [January 24, 2020, 5:28pm UTC](https://discuss.dwolla.com/t/add-funding-source-in-sandbox/5499/19 "2020-01-24T17:28:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![allano](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/allano/32/3652_2.png) [@allano](https://discuss.dwolla.com/u/allano)\
**Post date:** [October 29, 2022, 11:02am UTC](https://discuss.dwolla.com/t/add-funding-source-in-sandbox/5499/23 "2022-10-29T11:02:54Z")

</div>

> [@stephen](#):
>
> `/funding-sources`

That worked for me thanks!
