Getting Started
Start building today with Treasury Prime's APIs for banking.
This guide uses the following endpoints
To accomplish this you will need to
1. Create a Developer Sandbox Account
In order to start working with the Treasury Prime API, you will need to create a free Developer Sandbox account. This provides access to the Developer Sandbox where you can create and manage API keys, and safely test the API without worrying about interfering with production data.
2. Create API keys
Before making requests to the Treasury Prime API, you will need to generate a set of API keys. These keys act much like a username and password, and are used to authenticate each request. See our API Docs for more information.
To create your keys, login to the Developer Sandbox and click the "Create API Keys" button, then click "Create API Key". Carefully save the secret key that is generated. It is only shown once, so don't lose it.
3. Test the API keys
To make sure everything is working as expected, you can use curl
on the command-line to make a request to the ping
endpoint which validates your API Key ID and API Secret Key and returns a response as shown below.
Call the ping
endpoint using using HTTP Basic Auth, providing your API Key ID as the username, and the API Secret Key as the password.
curl -u "$API_KEY_ID:$API_SECRET_KEY" https://api.treasuryprime.com/ping
The response should look similar to the one below.
{
"api_version": "1",
"version": "1.11.207-gb5accf2c",
"time": "2021-02-25T01:59:23.091Z"
}
4. Get an account balance
Great work creating and validating your API keys, now comes the fun part! We've already created a few accounts in the Developer Sandbox for you to use. These accounts have been pre-funded with 5k, so you're ready to dive right in and check the available balance on an account.
Get a list of all the available accounts using the account
endpoint.
curl -u "$API_KEY_ID:$API_SECRET_KEY" https://api.treasuryprime.com/account
The response should look similar to the one below.
{
"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
}
The response should contain several accounts, each containing an id
property with a unique value such as acct_2w458dsi392h2m
. Using this value, you can request the details for a specific account (including the current balance) by calling the Account endpoint and passing the id
value (shown here as :id).
curl -u "$API_KEY_ID:$API_SECRET_KEY" https://api.treasuryprime.com/account/:id
In the response data, you should see 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
}
Updated 7 months ago
Congratulations! You've just taken the first step towards creating the next great fintech! Since you already have your Developer Account and API Keys, take the next step and learn about transferring money between accounts in the Book Transfer Guide, or explore the rest of the API Reference Documentation.