C# Dwolla: Create Funding Source for an Account

Back to Index

Shows how to add a bank account to a Dwolla account. The bank account will have a status of unverified upon creation. Before a Dwolla account is eligible to transfer money from their bank or credit union account they need to verify ownership of the account via micro-deposit verification. Success is indicated by a 201 response status code with an empty response body.

Documentation: https://docsv2.dwolla.com/#create-a-funding-source-for-an-account

CURL Command

curl -X POST https://api-sandbox.dwolla.com/funding-sources \
-H "Content-Type: application/vnd.dwolla.v1.hal+json" \
-H "Accept: application/vnd.dwolla.v1.hal+json" \
-H "Authorization: Bearer DWOLLA_ACCESS_TOKEN" \
-d '{
    "routingNumber": "222222226",
    "accountNumber": "123456789",
    "bankAccountType": "checking",
    "name": "My Bank"
}'

C# Example

Chilkat.Rest rest = new Chilkat.Rest();
bool success;

//  URL: https://api-sandbox.dwolla.com/funding-sources
bool bTls = true;
int port = 443;
bool bAutoReconnect = true;
success = rest.Connect("api-sandbox.dwolla.com",port,bTls,bAutoReconnect);
if (success != true) {
    Debug.WriteLine("ConnectFailReason: " + Convert.ToString(rest.ConnectFailReason));
    Debug.WriteLine(rest.LastErrorText);
    return;
}

Chilkat.JsonObject json = new Chilkat.JsonObject();
json.UpdateString("routingNumber","222222226");
json.UpdateString("accountNumber","123456789");
json.UpdateString("bankAccountType","checking");
json.UpdateString("name","My Bank");

rest.AddHeader("Content-Type","application/vnd.dwolla.v1.hal+json");
rest.AddHeader("Authorization","Bearer DWOLLA_ACCESS_TOKEN");
rest.AddHeader("Accept","application/vnd.dwolla.v1.hal+json");

Chilkat.StringBuilder sbRequestBody = new Chilkat.StringBuilder();
json.EmitSb(sbRequestBody);
Chilkat.StringBuilder sbResponseBody = new Chilkat.StringBuilder();
success = rest.FullRequestSb("POST","/funding-sources",sbRequestBody,sbResponseBody);
if (success != true) {
    Debug.WriteLine(rest.LastErrorText);
    return;
}