> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.useroot.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.useroot.com/_mcp/server.

# Get subaccount by ID

GET https://api.useroot.com/api/subaccounts/{subaccount_id}

Retrieve detailed information about a specific subaccount, including current balance and virtual banking details.

**Path Parameters**

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `subaccount_id` | UUID | Yes | ID of the subaccount to retrieve |

**Response Body**

| Field | Type | Description |
|-------|------|-------------|
| `id` | UUID | Unique identifier of the subaccount |
| `name` | String | Name of the subaccount |
| `account_number` | String | Account number for deposits |
| `routing_number` | String | Deprecated: use `routing_numbers.ach`. Kept for backward compatibility |
| `routing_numbers` | Object | Routing numbers per rail |
| `routing_numbers.ach` | String | ACH routing number for ACH transfers |
| `routing_numbers.wire` | String | Wire routing number for wire transfers. For JPM VRNs with separate wire config, differs from ach. For other banks, same as ach. |
| `total_incoming_in_minor_units` | Integer | Total incoming funds in the smallest unit of the account's currency (settled payins + incoming moves). For USD, this is cents. |
| `total_outgoing_in_minor_units` | Integer | Total outgoing funds in the smallest unit of the account's currency (settled/debited payouts + outgoing moves). For USD, this is cents. |
| `created_at` | DateTime | ISO 8601 timestamp when the subaccount was created |
| `updated_at` | DateTime | ISO 8601 timestamp when the subaccount was last updated |

**Balance Information**

The subaccount tracks two key metrics:
- **Total Incoming**: Sum of all settled pay-ins and incoming moves (funds added to the subaccount)
- **Total Outgoing**: Sum of all settled/debited payouts and outgoing moves (funds removed from the subaccount)

All amounts are in the smallest unit of the account's currency (for USD, cents — so 150000 = $1,500.00).

Reference: https://docs.useroot.com/api-reference/subaccounts-api/get-subaccount-by-id

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: '[Code Generated] Root - Instant Account to Account Money Movement'
  version: 1.0.0
paths:
  /api/subaccounts/{subaccount_id}:
    get:
      operationId: get-subaccount-by-id
      summary: Get subaccount by ID
      description: >-
        Retrieve detailed information about a specific subaccount, including
        current balance and virtual banking details.


        **Path Parameters**


        | Field | Type | Required | Description |

        |-------|------|----------|-------------|

        | `subaccount_id` | UUID | Yes | ID of the subaccount to retrieve |


        **Response Body**


        | Field | Type | Description |

        |-------|------|-------------|

        | `id` | UUID | Unique identifier of the subaccount |

        | `name` | String | Name of the subaccount |

        | `account_number` | String | Account number for deposits |

        | `routing_number` | String | Deprecated: use `routing_numbers.ach`.
        Kept for backward compatibility |

        | `routing_numbers` | Object | Routing numbers per rail |

        | `routing_numbers.ach` | String | ACH routing number for ACH transfers
        |

        | `routing_numbers.wire` | String | Wire routing number for wire
        transfers. For JPM VRNs with separate wire config, differs from ach. For
        other banks, same as ach. |

        | `total_incoming_in_minor_units` | Integer | Total incoming funds in
        the smallest unit of the account's currency (settled payins + incoming
        moves). For USD, this is cents. |

        | `total_outgoing_in_minor_units` | Integer | Total outgoing funds in
        the smallest unit of the account's currency (settled/debited payouts +
        outgoing moves). For USD, this is cents. |

        | `created_at` | DateTime | ISO 8601 timestamp when the subaccount was
        created |

        | `updated_at` | DateTime | ISO 8601 timestamp when the subaccount was
        last updated |


        **Balance Information**


        The subaccount tracks two key metrics:

        - **Total Incoming**: Sum of all settled pay-ins and incoming moves
        (funds added to the subaccount)

        - **Total Outgoing**: Sum of all settled/debited payouts and outgoing
        moves (funds removed from the subaccount)


        All amounts are in the smallest unit of the account's currency (for USD,
        cents — so 150000 = $1,500.00).
      tags:
        - subaccountsApi
      parameters:
        - name: subaccount_id
          in: path
          description: The ID of the subaccount to retrieve
          required: true
          schema:
            type: string
            format: uuid
        - name: x-api-key
          in: header
          description: >-
            RootPay API key sent in the x-api-key header. Keys are
            environment-scoped: live_* for production, test_* for sandbox.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Subaccount retrieved successfully
          content:
            application/json:
              schema:
                description: Any type
servers:
  - url: https://api.useroot.com
    description: Production
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        RootPay API key sent in the x-api-key header. Keys are
        environment-scoped: live_* for production, test_* for sandbox.

```

## Examples



**Response**

```json
{
  "data": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "name": "Nike Store Operations",
    "account_number": "1234567890",
    "routing_number": "111000025",
    "routing_numbers": {
      "ach": "111000025",
      "wire": "111000025"
    },
    "currency_code": "USD",
    "total_incoming_cents": 100000,
    "total_outgoing_cents": 45000,
    "created_at": "2024-01-15T10:30:00Z",
    "updated_at": "2024-01-15T10:30:00Z"
  }
}
```

**SDK Code**

```python Active subaccount
import requests

url = "https://api.useroot.com/api/subaccounts/subaccount_id"

headers = {"x-api-key": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript Active subaccount
const url = 'https://api.useroot.com/api/subaccounts/subaccount_id';
const options = {method: 'GET', headers: {'x-api-key': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Active subaccount
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.useroot.com/api/subaccounts/subaccount_id"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-api-key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Active subaccount
require 'uri'
require 'net/http'

url = URI("https://api.useroot.com/api/subaccounts/subaccount_id")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java Active subaccount
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.useroot.com/api/subaccounts/subaccount_id")
  .header("x-api-key", "<apiKey>")
  .asString();
```

```php Active subaccount
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.useroot.com/api/subaccounts/subaccount_id', [
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Active subaccount
using RestSharp;

var client = new RestClient("https://api.useroot.com/api/subaccounts/subaccount_id");
var request = new RestRequest(Method.GET);
request.AddHeader("x-api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Active subaccount
import Foundation

let headers = ["x-api-key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.useroot.com/api/subaccounts/subaccount_id")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```