Perl 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"

Perl Example

use chilkat();

$rest = chilkat::CkRest->new();

#  URL: https://api-sandbox.dwolla.com/accounts/DWOLLA_ACCOUNT_ID/funding-sources
$bTls = 1;
$port = 443;
$bAutoReconnect = 1;
$success = $rest->Connect("api-sandbox.dwolla.com",$port,$bTls,$bAutoReconnect);
if ($success != 1) {
    print "ConnectFailReason: " . $rest->get_ConnectFailReason() . "\r\n";
    print $rest->lastErrorText() . "\r\n";
    exit;
}

$rest->AddQueryParam("removed","true");

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

$strResponseBody = $rest->fullRequestFormUrlEncoded("GET","/accounts/DWOLLA_ACCOUNT_ID/funding-sources");
if ($rest->get_LastMethodSuccess() != 1) {
    print $rest->lastErrorText() . "\r\n";
    exit;
}

$jsonResponse = chilkat::CkJsonObject->new();
$jsonResponse->Load($strResponseBody);

$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->put_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->put_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": [
        ]
      }
    ]
  }
}