> ## Documentation Index
> Fetch the complete documentation index at: https://docs.treasuryprime.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Getting Started

> Start building today with Treasury Prime's APIs for banking.

This guide uses the following endpoints:

* [`/ping`](https://docs.treasuryprime.com/reference/health-check#/)
* [`/account`](https://docs.treasuryprime.com/reference/account#/)

#### To accomplish this you will need to

1. [Create a Developer Sandbox account](#1-create-a-developer-sandbox-account)
2. [Create API keys](#2-create-api-keys)
3. [Test the API keys](#3-test-the-api-keys)
4. [Get an account balance](#4-get-an-account-balance)

## 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](https://app.sandbox.treasuryprime.com/sign_up). 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](https://app.sandbox.treasuryprime.com/sign_up) 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.

First store your API Key ID and API Secret Key as environment variables. Run the following in your command-line, replacing \<your\_api\_key\_id> and \<your\_api\_key\_value> with your API Key ID and API Secret Key values:

<CodeGroup>
  ```bash bash theme={null}
  $ export API_KEY_ID=<your_api_key_id>
  $ export API_SECRET_KEY=<your_api_key_value>
  ```
</CodeGroup>

Call the `ping` endpoint using [HTTP Basic Auth](http://en.wikipedia.org/wiki/Basic_access_authentication), providing your API Key ID as the username, and the API Secret Key as the password.

<CodeGroup>
  ```bash bash theme={null}
  $ curl -u "$API_KEY_ID:$API_SECRET_KEY" https://api.sandbox.treasuryprime.com/ping
  ```
</CodeGroup>

The response should look similar to the one below.

<CodeGroup>
  ```bash bash theme={null}
  {
    "api_version": "1",
    "version": "1.11.207-gb5accf2c",
    "time": "2021-02-25T01:59:23.091Z"
  }
  ```
</CodeGroup>

## 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.

<CodeGroup>
  ```bash bash theme={null}
  curl -u "$API_KEY_ID:$API_SECRET_KEY" https://api.sandbox.treasuryprime.com/account
  ```
</CodeGroup>

The response should look similar to the one below.

<CodeGroup>
  ```bash bash theme={null}
  {
    "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
  }
  ```
</CodeGroup>

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).

<CodeGroup>
  ```bash bash theme={null}
  curl -u "$API_KEY_ID:$API_SECRET_KEY" https://api.sandbox.treasuryprime.com/account/:id
  ```
</CodeGroup>

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.

<CodeGroup>
  ```bash bash theme={null}
  {
    "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
  }
  ```
</CodeGroup>
