Programmatically Withdraw?


(Tomer S) #1

Hello! Just wondering if the ability to ‘withdraw’ money from Dwolla to your bank account is available as part of the API. If not, is this something that’s in the roadmap?
Thanks!


(Spencer Hunter) #2

Hi @Tomer_S, It is possible to transfer money from your Dwolla account balance to an attached bank account. You’d first want to obtain an access token for the Dwolla account that is wanting to transfer funds. Once you have obtained authorization, you’ll call the API to fetch your Account’s list of funding sources.

Example:
Contained in this response you’ll see a list of funding sources with one of them being the balance and the other being the bank account that you want to send funds to.

GET https://api-uat.dwolla.com/accounts/ad5f2162-404a-4c4c-994e-6ab6c3a13254/funding-sources?removed=false
Accept: application/vnd.dwolla.v1.hal+json
Authorization: Bearer {{Your access token}}

{
  "_links": {
    "self": {
      "href": "https://api-uat.dwolla.com/accounts/ad5f2162-404a-4c4c-994e-6ab6c3a13254/funding-sources?removed=false",
      "type": "application/vnd.dwolla.v1.hal+json",
      "resource-type": "funding-source"
    }
  },
  "_embedded": {
    "funding-sources": [
      {
        "_links": {
          "self": {
            "href": "https://api-uat.dwolla.com/funding-sources/707177c3-bf15-4e7e-b37c-55c3898d9bf4",
            "type": "application/vnd.dwolla.v1.hal+json",
            "resource-type": "funding-source"
          },
          "account": {
            "href": "https://api-uat.dwolla.com/accounts/ad5f2162-404a-4c4c-994e-6ab6c3a13254",
            "type": "application/vnd.dwolla.v1.hal+json",
            "resource-type": "account"
          }
        },
        "id": "707177c3-bf15-4e7e-b37c-55c3898d9bf4",
        "status": "verified",
        "type": "bank",
        "name": "First Midwestern Bank",
        "created": "2014-07-09T20:39:37.000Z",
        "removed": false,
        "channels": [
          "ach"
        ]
      },
      {
        "_links": {
          "self": {
            "href": "https://api-uat.dwolla.com/funding-sources/b268f6b9-db3b-4ecc-83a2-8823a53ec8b7",
            "type": "application/vnd.dwolla.v1.hal+json",
            "resource-type": "funding-source"
          },
          "account": {
            "href": "https://api-uat.dwolla.com/accounts/ad5f2162-404a-4c4c-994e-6ab6c3a13254",
            "type": "application/vnd.dwolla.v1.hal+json",
            "resource-type": "account"
          },
          "with-available-balance": {
            "href": "https://api-uat.dwolla.com/funding-sources/b268f6b9-db3b-4ecc-83a2-8823a53ec8b7",
            "type": "application/vnd.dwolla.v1.hal+json",
            "resource-type": "funding-source"
          },
          "balance": {
            "href": "https://api-uat.dwolla.com/funding-sources/b268f6b9-db3b-4ecc-83a2-8823a53ec8b7/balance",
            "type": "application/vnd.dwolla.v1.hal+json",
            "resource-type": "balance"
          }
        },
        "id": "b268f6b9-db3b-4ecc-83a2-8823a53ec8b7",
        "status": "verified",
        "type": "balance",
        "name": "Balance",
        "created": "2014-07-09T20:39:33.000Z",
        "removed": false,
        "channels": []
      }
    ]
  }
}

Once you obtain the links that represent your account balance and the bank you want to send funds to then you’ll call the API to transfer money.

Example:
Specify the source and destination links to transfer funds.

POST https://api-uat.dwolla.com/transfers 
Accept: application/vnd.dwolla.v1.hal+json
Authorization: Bearer {{Your access token}}
Content-Type: application/json

{
    "_links": {
        "source": {
            "href": "https://api-uat.dwolla.com/funding-sources/b268f6b9-db3b-4ecc-83a2-8823a53ec8b7"
        },
        "destination": {
            "href": "https://api-uat.dwolla.com/funding-sources/707177c3-bf15-4e7e-b37c-55c3898d9bf4"
        }
    },
    "amount": {
        "currency": "USD",
        "value": "200.00"
    }
}

(Tomer S) #3

Ah, clever!! Thanks!