C# Dwolla: List Funding Sources for an Account

Back to Index

Retrieve a list of funding sources that belong to an Account. By default, all funding sources are returned unless the removed querystring parameter is set to false in the request.

Documentation: https://docsv2.dwolla.com/#list-funding-sources-for-an-account

CURL Command

curl -X GET https://api-sandbox.dwolla.com/accounts/DWOLLA_ACCOUNT_ID/funding-sources \
-H "Accept: application/vnd.dwolla.v1.hal+json" \
-H "Authorization: Bearer DWOLLA_ACCESS_TOKEN" \
-d "removed=true"

C# Example

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

//  URL: https://api-sandbox.dwolla.com/accounts/DWOLLA_ACCOUNT_ID/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;
}

rest.AddQueryParam("removed","true");

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

string strResponseBody = rest.FullRequestFormUrlEncoded("GET","/accounts/DWOLLA_ACCOUNT_ID/funding-sources");
if (rest.LastMethodSuccess != true) {
    Debug.WriteLine(rest.LastErrorText);
    return;
}

Chilkat.JsonObject jsonResponse = new Chilkat.JsonObject();
jsonResponse.Load(strResponseBody);

string v_linksSelfHref;
string v_linksSelfType;
string v_linksSelfResource_type;
int i;
int count_i;
string v_linksTransfer_from_balanceHref;
string v_linksTransfer_from_balanceType;
string v_linksTransfer_from_balanceResource_type;
string v_linksTransfer_to_balanceHref;
string v_linksTransfer_to_balanceType;
string v_linksTransfer_to_balanceResource_type;
string v_linksTransfer_sendHref;
string v_linksTransfer_sendType;
string v_linksTransfer_sendResource_type;
string v_linksRemoveHref;
string v_linksRemoveType;
string v_linksRemoveResource_type;
string v_linksTransfer_receiveHref;
string v_linksTransfer_receiveType;
string v_linksTransfer_receiveResource_type;
string v_linksAccountHref;
string v_linksAccountType;
string v_linksAccountResource_type;
string id;
string status;
string type;
string bankAccountType;
string name;
string created;
bool removed;
string bankName;
string v_linksInitiate_micro_depositsHref;
string v_linksInitiate_micro_depositsType;
string v_linksInitiate_micro_depositsResource_type;
string v_linksBalanceHref;
string v_linksBalanceType;
string v_linksBalanceResource_type;
string v_linksWith_available_balanceHref;
string v_linksWith_available_balanceType;
string v_linksWith_available_balanceResource_type;
int j;
int count_j;
string strVal;

v_linksSelfHref = jsonResponse.StringOf("_links.self.href");
v_linksSelfType = jsonResponse.StringOf("_links.self.type");
v_linksSelfResource_type = jsonResponse.StringOf("_links.self.resource-type");
i = 0;
count_i = jsonResponse.SizeOfArray("_embedded.funding-sources");
while (i < count_i) {
    jsonResponse.I = i;
    v_linksTransfer_from_balanceHref = jsonResponse.StringOf("_embedded.funding-sources[i]._links.transfer-from-balance.href");
    v_linksTransfer_from_balanceType = jsonResponse.StringOf("_embedded.funding-sources[i]._links.transfer-from-balance.type");
    v_linksTransfer_from_balanceResource_type = jsonResponse.StringOf("_embedded.funding-sources[i]._links.transfer-from-balance.resource-type");
    v_linksSelfHref = jsonResponse.StringOf("_embedded.funding-sources[i]._links.self.href");
    v_linksSelfType = jsonResponse.StringOf("_embedded.funding-sources[i]._links.self.type");
    v_linksSelfResource_type = jsonResponse.StringOf("_embedded.funding-sources[i]._links.self.resource-type");
    v_linksTransfer_to_balanceHref = jsonResponse.StringOf("_embedded.funding-sources[i]._links.transfer-to-balance.href");
    v_linksTransfer_to_balanceType = jsonResponse.StringOf("_embedded.funding-sources[i]._links.transfer-to-balance.type");
    v_linksTransfer_to_balanceResource_type = jsonResponse.StringOf("_embedded.funding-sources[i]._links.transfer-to-balance.resource-type");
    v_linksTransfer_sendHref = jsonResponse.StringOf("_embedded.funding-sources[i]._links.transfer-send.href");
    v_linksTransfer_sendType = jsonResponse.StringOf("_embedded.funding-sources[i]._links.transfer-send.type");
    v_linksTransfer_sendResource_type = jsonResponse.StringOf("_embedded.funding-sources[i]._links.transfer-send.resource-type");
    v_linksRemoveHref = jsonResponse.StringOf("_embedded.funding-sources[i]._links.remove.href");
    v_linksRemoveType = jsonResponse.StringOf("_embedded.funding-sources[i]._links.remove.type");
    v_linksRemoveResource_type = jsonResponse.StringOf("_embedded.funding-sources[i]._links.remove.resource-type");
    v_linksTransfer_receiveHref = jsonResponse.StringOf("_embedded.funding-sources[i]._links.transfer-receive.href");
    v_linksTransfer_receiveType = jsonResponse.StringOf("_embedded.funding-sources[i]._links.transfer-receive.type");
    v_linksTransfer_receiveResource_type = jsonResponse.StringOf("_embedded.funding-sources[i]._links.transfer-receive.resource-type");
    v_linksAccountHref = jsonResponse.StringOf("_embedded.funding-sources[i]._links.account.href");
    v_linksAccountType = jsonResponse.StringOf("_embedded.funding-sources[i]._links.account.type");
    v_linksAccountResource_type = jsonResponse.StringOf("_embedded.funding-sources[i]._links.account.resource-type");
    id = jsonResponse.StringOf("_embedded.funding-sources[i].id");
    status = jsonResponse.StringOf("_embedded.funding-sources[i].status");
    type = jsonResponse.StringOf("_embedded.funding-sources[i].type");
    bankAccountType = jsonResponse.StringOf("_embedded.funding-sources[i].bankAccountType");
    name = jsonResponse.StringOf("_embedded.funding-sources[i].name");
    created = jsonResponse.StringOf("_embedded.funding-sources[i].created");
    removed = jsonResponse.BoolOf("_embedded.funding-sources[i].removed");
    bankName = jsonResponse.StringOf("_embedded.funding-sources[i].bankName");
    v_linksInitiate_micro_depositsHref = jsonResponse.StringOf("_embedded.funding-sources[i]._links.initiate-micro-deposits.href");
    v_linksInitiate_micro_depositsType = jsonResponse.StringOf("_embedded.funding-sources[i]._links.initiate-micro-deposits.type");
    v_linksInitiate_micro_depositsResource_type = jsonResponse.StringOf("_embedded.funding-sources[i]._links.initiate-micro-deposits.resource-type");
    v_linksBalanceHref = jsonResponse.StringOf("_embedded.funding-sources[i]._links.balance.href");
    v_linksBalanceType = jsonResponse.StringOf("_embedded.funding-sources[i]._links.balance.type");
    v_linksBalanceResource_type = jsonResponse.StringOf("_embedded.funding-sources[i]._links.balance.resource-type");
    v_linksWith_available_balanceHref = jsonResponse.StringOf("_embedded.funding-sources[i]._links.with-available-balance.href");
    v_linksWith_available_balanceType = jsonResponse.StringOf("_embedded.funding-sources[i]._links.with-available-balance.type");
    v_linksWith_available_balanceResource_type = jsonResponse.StringOf("_embedded.funding-sources[i]._links.with-available-balance.resource-type");
    j = 0;
    count_j = jsonResponse.SizeOfArray("_embedded.funding-sources[i].channels");
    while (j < count_j) {
        jsonResponse.J = j;
        strVal = jsonResponse.StringOf("_embedded.funding-sources[i].channels[j]");
        j = j + 1;
    }

    i = i + 1;
}

Sample JSON Response Body

{
  "_links": {
    "self": {
      "href": "https://api-sandbox.dwolla.com/accounts/721c463c-c328-4467-882a-f1e5120700b0/funding-sources",
      "type": "application/vnd.dwolla.v1.hal+json",
      "resource-type": "funding-source"
    }
  },
  "_embedded": {
    "funding-sources": [
      {
        "_links": {
          "transfer-from-balance": {
            "href": "https://api-sandbox.dwolla.com/transfers",
            "type": "application/vnd.dwolla.v1.hal+json",
            "resource-type": "transfer"
          },
          "self": {
            "href": "https://api-sandbox.dwolla.com/funding-sources/0c5d1842-9a15-4f9f-9b11-b0e73d22e8c7",
            "type": "application/vnd.dwolla.v1.hal+json",
            "resource-type": "funding-source"
          },
          "transfer-to-balance": {
            "href": "https://api-sandbox.dwolla.com/transfers",
            "type": "application/vnd.dwolla.v1.hal+json",
            "resource-type": "transfer"
          },
          "transfer-send": {
            "href": "https://api-sandbox.dwolla.com/transfers",
            "type": "application/vnd.dwolla.v1.hal+json",
            "resource-type": "transfer"
          },
          "remove": {
            "href": "https://api-sandbox.dwolla.com/funding-sources/0c5d1842-9a15-4f9f-9b11-b0e73d22e8c7",
            "type": "application/vnd.dwolla.v1.hal+json",
            "resource-type": "funding-source"
          },
          "transfer-receive": {
            "href": "https://api-sandbox.dwolla.com/transfers",
            "type": "application/vnd.dwolla.v1.hal+json",
            "resource-type": "transfer"
          },
          "account": {
            "href": "https://api-sandbox.dwolla.com/accounts/721c463c-c328-4467-882a-f1e5120700b0",
            "type": "application/vnd.dwolla.v1.hal+json",
            "resource-type": "account"
          }
        },
        "id": "0c5d1842-9a15-4f9f-9b11-b0e73d22e8c7",
        "status": "verified",
        "type": "bank",
        "bankAccountType": "checking",
        "name": "Superhero Savings Bank",
        "created": "2018-03-20T17:46:44.000Z",
        "removed": false,
        "channels": [
          "ach"
        ],
        "bankName": "SANDBOX TEST BANK"
      },
      {
        "_links": {
          "transfer-from-balance": {
            "href": "https://api-sandbox.dwolla.com/transfers",
            "type": "application/vnd.dwolla.v1.hal+json",
            "resource-type": "transfer"
          },
          "self": {
            "href": "https://api-sandbox.dwolla.com/funding-sources/4d03565f-6d9e-4c07-a7d6-958833f91c09",
            "type": "application/vnd.dwolla.v1.hal+json",
            "resource-type": "funding-source"
          },
          "remove": {
            "href": "https://api-sandbox.dwolla.com/funding-sources/4d03565f-6d9e-4c07-a7d6-958833f91c09",
            "type": "application/vnd.dwolla.v1.hal+json",
            "resource-type": "funding-source"
          },
          "initiate-micro-deposits": {
            "href": "https://api-sandbox.dwolla.com/funding-sources/4d03565f-6d9e-4c07-a7d6-958833f91c09/micro-deposits",
            "type": "application/vnd.dwolla.v1.hal+json",
            "resource-type": "micro-deposits"
          },
          "transfer-receive": {
            "href": "https://api-sandbox.dwolla.com/transfers",
            "type": "application/vnd.dwolla.v1.hal+json",
            "resource-type": "transfer"
          },
          "account": {
            "href": "https://api-sandbox.dwolla.com/accounts/721c463c-c328-4467-882a-f1e5120700b0",
            "type": "application/vnd.dwolla.v1.hal+json",
            "resource-type": "account"
          }
        },
        "id": "4d03565f-6d9e-4c07-a7d6-958833f91c09",
        "status": "unverified",
        "type": "bank",
        "bankAccountType": "checking",
        "name": "My Bank",
        "created": "2018-03-20T20:24:11.000Z",
        "removed": false,
        "channels": [
          "ach"
        ],
        "bankName": "SANDBOX TEST BANK"
      },
      {
        "_links": {
          "self": {
            "href": "https://api-sandbox.dwolla.com/funding-sources/3dfeb498-ab5a-4930-b6a3-f16f438727ee",
            "type": "application/vnd.dwolla.v1.hal+json",
            "resource-type": "funding-source"
          },
          "balance": {
            "href": "https://api-sandbox.dwolla.com/funding-sources/3dfeb498-ab5a-4930-b6a3-f16f438727ee/balance",
            "type": "application/vnd.dwolla.v1.hal+json",
            "resource-type": "balance"
          },
          "transfer-send": {
            "href": "https://api-sandbox.dwolla.com/transfers",
            "type": "application/vnd.dwolla.v1.hal+json",
            "resource-type": "transfer"
          },
          "with-available-balance": {
            "href": "https://api-sandbox.dwolla.com/funding-sources/3dfeb498-ab5a-4930-b6a3-f16f438727ee",
            "type": "application/vnd.dwolla.v1.hal+json",
            "resource-type": "funding-source"
          },
          "transfer-receive": {
            "href": "https://api-sandbox.dwolla.com/transfers",
            "type": "application/vnd.dwolla.v1.hal+json",
            "resource-type": "transfer"
          },
          "account": {
            "href": "https://api-sandbox.dwolla.com/accounts/721c463c-c328-4467-882a-f1e5120700b0",
            "type": "application/vnd.dwolla.v1.hal+json",
            "resource-type": "account"
          }
        },
        "id": "3dfeb498-ab5a-4930-b6a3-f16f438727ee",
        "status": "verified",
        "type": "balance",
        "name": "Balance",
        "created": "2018-03-20T17:46:37.000Z",
        "removed": false,
        "channels": [
        ]
      }
    ]
  }
}