Ledger
List Ledger Accounts
Retrieve all ledger accounts with their current balances.
GET
/
v1
/
ledger
/
accounts
List ledger accounts
curl --request GET \
--url https://billing.example.com/v1/ledger/accounts \
--header 'Authorization: Bearer <token>'import requests
url = "https://billing.example.com/v1/ledger/accounts"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://billing.example.com/v1/ledger/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://billing.example.com/v1/ledger/accounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://billing.example.com/v1/ledger/accounts"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://billing.example.com/v1/ledger/accounts")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/v1/ledger/accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Accounts Receivable",
"type": "asset",
"code": 123,
"ledger_id": 123,
"user_data_128": {},
"credits_posted": 1,
"debits_posted": 1,
"currency": "<string>",
"balance": 123,
"created_at": "2023-11-07T05:31:56Z"
}
]
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}Returns every ledger account configured in your organization. Each account includes its current balance, currency, and type classification. Ledger accounts follow double-entry accounting principles and are used to track revenue, liabilities, and receivables.
Example Request
curl -X GET https://api.recurso.io/v1/ledger/accounts \
-H "Authorization: Bearer sk_live_26PHem9AhJZvU..." \
-H "Content-Type: application/json"
Response
{
"object": "list",
"data": [
{
"id": "acct_1aB2CdEfGh",
"code": "1000",
"name": "Accounts Receivable",
"type": "asset",
"balance": 12450000,
"currency": "usd"
},
{
"id": "acct_3iJ4KlMnOp",
"code": "2000",
"name": "Deferred Revenue",
"type": "liability",
"balance": 8730000,
"currency": "usd"
},
{
"id": "acct_5qR6StUvWx",
"code": "4000",
"name": "Subscription Revenue",
"type": "revenue",
"balance": 34520000,
"currency": "usd"
},
{
"id": "acct_7yZ8AbCdEf",
"code": "4100",
"name": "Usage Revenue",
"type": "revenue",
"balance": 5680000,
"currency": "usd"
},
{
"id": "acct_9gH0IjKlMn",
"code": "5000",
"name": "Refunds & Credits",
"type": "contra_revenue",
"balance": 1240000,
"currency": "usd"
}
]
}
Authorizations
Tenant API key obtained from POST /auth/register or POST /v1/developer/keys.
Query Parameters
Max rows returned (clamped to 1000).
Required range:
x <= 1000Rows to skip, for paging past the clamp.
Required range:
x >= 0Response
Ledger accounts.
Show child attributes
Show child attributes
⌘I
List ledger accounts
curl --request GET \
--url https://billing.example.com/v1/ledger/accounts \
--header 'Authorization: Bearer <token>'import requests
url = "https://billing.example.com/v1/ledger/accounts"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://billing.example.com/v1/ledger/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://billing.example.com/v1/ledger/accounts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://billing.example.com/v1/ledger/accounts"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://billing.example.com/v1/ledger/accounts")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://billing.example.com/v1/ledger/accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"tenant_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "Accounts Receivable",
"type": "asset",
"code": 123,
"ledger_id": 123,
"user_data_128": {},
"credits_posted": 1,
"debits_posted": 1,
"currency": "<string>",
"balance": 123,
"created_at": "2023-11-07T05:31:56Z"
}
]
}{
"error": {
"code": "BAD_REQUEST",
"message": "<string>"
}
}