Introducing the Treasury Prime Developer Sandbox

A safe space to experiment and bring your fintech innovations to life.
Headshot of Remy Carole
Remy Carole
Chief Operating Officer
,
February 25, 2021
Treasury Prime Developer Sandbox interface
Screenshot of the Treasury Prime Developer Sandbox

Today, we are proud to announce the launch of the Treasury Prime Developer Sandbox, a space that allows developers to begin using Treasury Prime’s advanced banking services, all in the safety of an enclosed environment, without requiring a connection to a production bank account. And it's free to use, allows immediate access, and is available now. With the launch of the Developer Sandbox, developers can build in a consequence-free environment. When you don’t have to worry about a typo causing a million dollar error, you're set free to experiment, and experimentation leads to innovation.

Treasury Prime began with a mission to make banking technology more accessible, while providing enough guide rails to keep things safe and secure. We wanted to design an elegant, powerful API that lets developers do what they do best: change the world by creating innovative software solutions. At the same time–having collectively spent decades working in the banking industry–our team knows the substantial value that banks provide. As such, we also strive to empower banks to do what they do best: risk management, security at scale, and providing knowledgeable customer support. So, by helping to match the fintechs inventing the future with the forward-looking banks who are here to support them, Treasury Prime aims to enable a new generation of financial innovation.

Features

The Developer Sandbox allows you to test all of the Treasury Prime APIs (with a few minor exceptions), so you can build a proof of concept quickly and get to market fast. There is no cost for using this environment, so you are free to build and test as long as you like without worrying about fees or contracts. And when you’re ready to make the jump to production, you just need to swap out your environment URLs and generate some production API keys. You’ll also need to get connected with a bank, which is why we’ve partnered with a growing number of banks to make sure we can help connect almost any fintech with a banking partner.

The Treasury Prime APIs were designed around the principles of REST, and all response bodies are JSON encoded, so they should feel familiar to almost anyone who’s worked with APIs before, and be easy to understand for those who are new to the game. So what exactly can you do with Treasury Prime's APIs?

  • Apply to open new bank accounts
  • Issue branded debit cards
  • Make deposits with remote deposit capture
  • Make payments and card transactions 
  • Fund accounts

And that’s just to name a few… So, now that you know a bit more about what we do, let's take a look at how you can build the next big fintech innovation!

Getting Started

In the examples below, we’ll look at how you can transfer funds between two accounts at the same bank using a book transfer, then follow that up by checking the available balance on an account.

If you’d like to follow along, you can sign up for a free Developer Sandbox account (it’s fast and painless I promise). Once you’ve signed up, you can then log into the Developer Sandbox, and generate a set of API Keys which will be used to authenticate your requests. In our examples these keys are shown as $API_KEY_ID and $API_SECRET_KEY. You'll need to swap these out with Key ID and Secret Key you generate in your sandbox when making requests.

Note: If you’d like more in-depth information on any of our APIs, please see our API Reference Documentation.

Book Transfer

A book transfer is an electronic funds transfer between two accounts at the same bank. In this example we’ll look at how you can transfer funds from a checking account to a savings account.

Note: A checking and savings account are automatically created in your Developer Sandbox for testing purposes.

The first step in creating a book transfer is to obtain the IDs of the accounts you wish to transfer funds between. To accomplish this, make a GET request to the account endpoint.

curl -u $API_KEY_ID:$API_SECRET_KEY https://api.treasuryprime.com/account

This will return a list of Account objects. In order to make a book transfer, you will need the account ID for both the sending and receiving accounts, which are stored in the 'id' property of each account object.

{
    "data": [{
        "account_type": "savings",
        "bank_id": "bank_treasuryprime",
        "updated_at": "2021-02-01T16:32:34Z",
        "currency": null,
        "routing_number": "000000000",
        "account_number": "123000012345",
        "id": "acct_qda4pJZfpzn4fc",
        "created_at": "2021-01-13T15:05:14Z",
        "userdata": null
    }, {
        "account_type": "checking",
        "bank_id": "bank_treasuryprime",
        "updated_at": "2021-02-01T16:32:34Z",
        "currency": null,
        "routing_number": "000000000",
        "account_number": "123000067890",
        "id": "acct_wVwR87rxhMRdwD",
        "created_at": "2021-01-13T15:05:13Z",
        "userdata": null
    }],
    "total_estimated": 10
}

After obtaining the IDs of the accounts you wish to transfer funds between, you have all the necessary information required to issue a book transfer. To accomplish this, make a POST request to the book endpoint, passing the 'amount' of the transfer, as well as the 'from_account_id' and the 'to_account_id' (representing the funding account and receiving account respectively).

Note: You will need to replace the 'from_account_id' and 'to_account_id' values with those from your own account.

curl -u $API_KEY_ID:$API_SECRET_KEY https://api.treasuryprime.com/book \\
    -H 'Content-Type: application/json' \\
    -d '{
          "amount": "100.00",
          "from_account_id": "acct_1234567890",
          "to_account_id": "acct_0987654321"
        }'

A successful response will return a Book Transfer object. Note that the status of this request is currently set to "pending". You can register webhooks to notify you when the transfer is complete, but that is a bit beyond the scope of this example.

{
  "amount": "100.00",
  "created_at": "2017-11-02T11:55:14Z",
  "description:" null,
  "from_account_id": "acct_1234567890",
  "id": "book_1029384756",
  "status": "pending",
  "to_account_id": "acct_0987654321",
  "updated_at": "2017-11-02T11:55:14Z",
  "userdata": null
}

Congratulations, you’ve just made your first book transfer! Next let’s quickly check the account balance of the receiving account.

Check Account Balance

To check the available balance on an account, make a request to the account endpoint including the ID of the account you provided for the 'to_account_id' above.

Note: You will need to replace the :id below with the account ID of one of the accounts in your developer sandbox (you can use the same account ID provided for the 'to_account_id' value above, or any other account of your choosing).

curl -u "$API_KEY_ID:$API_SECRET_KEY" https://api.sandbox.treasuryprime.com/account/:id

The response data includes a lot of information about the account, including the 'available_balance' which shows the amount of money in the account that is immediately available for transactions.

{
  "address": {
    "street_line_1": "123 Kearny St",
    "street_line_2": null,
    "city": "San Francisco",
    "state": "CA",
    "postal_code": "94102"
  },
  "account_type": "checking",
  "bank_id": "bank_treasuryprime",
  "person_ids": [
    "psn_26a98dsf184j7a"
  ],
  "available_balance": "5000.00",
  "name": "Account Owner",
  "updated_at": "2021-01-28T14:47:13Z",
  "currency": "USD",
  "routing_number": "000000000",
  "status": "open",
  "primary_person_id": "psn_26a98dsf184j7a",
  "account_number": "098234989485",
  "locked": false,
  "id": "acct_23f18dja392m60",
  "funded": false,
  "business_ids": [],
  "current_balance": "5000.00",
  "created_at": "2021-01-28T14:47:11Z",
  "userdata": null
}

Recap

Great work! In a matter of minutes, you’ve been able to transfer funds between two bank accounts, and check the available balance of an account. Banking can seem intimidating to work with at first, but–as you’ve hopefully now discovered–it doesn’t have to be. We’ve worked hard to make working with financial services as fast and easy as possible, all so you can share your next great innovation with the world. 

We truly believe that fintechs have the opportunity to change the way that finance works and empower every person to take control of their financial future. And by working with the right banking partner, you’ll have the backing of a team who can help you avoid any roadblocks and ensure your solution scales in a safe and secure way.

If you’ve made it this far and still haven’t signed up for a Developer Sandbox account, what are you waiting for?  You could build your proof of concept in the next few days, and have a product ready to hit the market in a matter of weeks. We can’t wait to see what you build!

← Back to blog