Skip to main content
GET
/
v1
/
organizations
/
{organization_id}
/
ledgers
/
{ledger_id}
/
accounts
List Accounts
curl --request GET \
  --url https://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/ledgers/{ledger_id}/accounts
import requests

url = "https://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/ledgers/{ledger_id}/accounts"

response = requests.get(url)

print(response.text)
const options = {method: 'GET'};

fetch('https://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/ledgers/{ledger_id}/accounts', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/ledgers/{ledger_id}/accounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

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

func main() {

url := "https://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/ledgers/{ledger_id}/accounts"

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

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

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

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/ledgers/{ledger_id}/accounts")
.asString();
require 'uri'
require 'net/http'

url = URI("https://ledger.sandbox.lerian.net/v1/organizations/{organization_id}/ledgers/{ledger_id}/accounts")

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

request = Net::HTTP::Get.new(url)

response = http.request(request)
puts response.read_body
{
  "items": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "organizationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "ledgerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "assetCode": "<string>",
      "name": "<string>",
      "alias": "<string>",
      "type": "<string>",
      "blocked": false,
      "parentAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "entityId": "<string>",
      "portfolioId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "segmentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "status": {
        "code": "<string>",
        "description": "<string>"
      },
      "metadata": {},
      "createdAt": "2023-11-07T05:31:56Z",
      "updatedAt": "2023-11-07T05:31:56Z",
      "deletedAt": "2023-11-07T05:31:56Z"
    }
  ],
  "page": 123,
  "limit": 123
}

Headers

Content-Type
string

The type of media of the resource. Recommended value is application/json.

X-Request-Id
string<uuid>

A unique identifier used to trace and track each request.

Authorization
string

Bearer JWT token for authentication. Required when PLUGIN_AUTH_ENABLED=true (enforced in multi-tenant deployments). Optional in default OSS single-tenant mode. Format: Bearer <token>

Path Parameters

organization_id
string<uuid>
required

The unique identifier of the Organization associated with the Ledger.

ledger_id
string<uuid>
required

The unique identifier of the associated Ledger.

Query Parameters

limit
integer
default:10

The maximum number of items to include in the response. Max: 100

Required range: 1 <= x <= 100
start_date
string

The beginning of the period you want to retrieve. start_date and end_date are all-or-nothing: supplying only one returns 400. If both are omitted, a default window of the last 1 month is used.

end_date
string

The end of the period you want to retrieve. start_date and end_date are all-or-nothing: supplying only one returns 400. If both are omitted, a default window of the last 1 month is used.

sort_order
enum<string>
default:asc

The order used to sort the results.

Available options:
asc,
desc
page
integer
default:1

The number of the page that you want to retrieve.

Required range: x >= 1
portfolio_id
string<uuid>

Filter accounts by portfolio. Returns only accounts assigned to this portfolio.

segment_id
string<uuid>

Filter accounts by segment. Returns only accounts assigned to this segment.

status
enum<string>

Filter accounts by their status code. Accepted values are ACTIVE, INACTIVE, or BLOCKED (uppercase, exact match).

Available options:
ACTIVE,
INACTIVE,
BLOCKED
type
string

Filter accounts by type (exact match, case-insensitive). Common values include deposit, savings, loans, marketplace, creditCard, and external.

asset_code
string

Filter accounts by asset code (e.g. BRL, USD).

entity_id
string

Filter accounts by entity identifier.

blocked
boolean

Filter accounts by blocked state. Use true to list only blocked accounts, false for unblocked.

parent_account_id
string<uuid>

Filter accounts by parent account. Returns only sub-accounts of the specified parent.

name
string

Filter accounts by name. Uses prefix matching (case-insensitive).

alias
string

Filter accounts by alias. Uses prefix matching (case-insensitive).

metadata.key
string

Filter by metadata using dot-notation. Replace key with your metadata field name (e.g. metadata.costCenter=BR_11101997).

Response

Indicates that the request was successful and the response contains the expected data.

items
object[]
page
integer

The number of pages returned.

limit
integer

The maximum number of items included in the response.