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 usecurl
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.
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 theaccount
endpoint.
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).
available_balance
which shows the amount of money in the account that is immediately available for transactions.