curl --request GET \
--url https://api.sandbox.teal.dev/v0/ledgers \
--header 'Authorization: Bearer <token>' \
--header 'teal-instance-id: <teal-instance-id>'import requests
url = "https://api.sandbox.teal.dev/v0/ledgers"
headers = {
"teal-instance-id": "<teal-instance-id>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'teal-instance-id': '<teal-instance-id>', Authorization: 'Bearer <token>'}
};
fetch('https://api.sandbox.teal.dev/v0/ledgers', 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://api.sandbox.teal.dev/v0/ledgers",
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>",
"teal-instance-id: <teal-instance-id>"
],
]);
$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://api.sandbox.teal.dev/v0/ledgers"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("teal-instance-id", "<teal-instance-id>")
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://api.sandbox.teal.dev/v0/ledgers")
.header("teal-instance-id", "<teal-instance-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.teal.dev/v0/ledgers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["teal-instance-id"] = '<teal-instance-id>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"next_page_token": "ikal0NEVfMhF8dJf4yQ6KQZmGD",
"prev_page_token": "vuA7JeKI5c6FLnPt5JfRcZcJxW",
"records": [
{
"created_at": "2024-01-01T00:00:00",
"debit_credit": "debit",
"editable": false,
"financial_account_type": "bank_account",
"id": "7JRNsKwy2Lw66caxVU7WGC",
"is_autocat_category": false,
"is_required": false,
"name": "Pluto Checking 4242",
"report_cash_flow": true,
"sort_code": "2240",
"sub_type": "current_assets",
"type": "asset"
}
]
}{
"message": "<string>",
"data": "<unknown>",
"display_message": "<string>",
"error_code": "invalid_date"
}{
"message": "<string>",
"data": "<unknown>",
"display_message": "<string>",
"error_code": "invalid_date"
}{
"message": "<string>",
"data": "<unknown>",
"display_message": "<string>",
"error_code": "invalid_date"
}{
"message": "<string>",
"data": "<unknown>",
"display_message": "<string>",
"error_code": "invalid_date"
}List all Ledgers
Lists all of an Instance’s Ledgers.
curl --request GET \
--url https://api.sandbox.teal.dev/v0/ledgers \
--header 'Authorization: Bearer <token>' \
--header 'teal-instance-id: <teal-instance-id>'import requests
url = "https://api.sandbox.teal.dev/v0/ledgers"
headers = {
"teal-instance-id": "<teal-instance-id>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'teal-instance-id': '<teal-instance-id>', Authorization: 'Bearer <token>'}
};
fetch('https://api.sandbox.teal.dev/v0/ledgers', 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://api.sandbox.teal.dev/v0/ledgers",
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>",
"teal-instance-id: <teal-instance-id>"
],
]);
$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://api.sandbox.teal.dev/v0/ledgers"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("teal-instance-id", "<teal-instance-id>")
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://api.sandbox.teal.dev/v0/ledgers")
.header("teal-instance-id", "<teal-instance-id>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.teal.dev/v0/ledgers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["teal-instance-id"] = '<teal-instance-id>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"next_page_token": "ikal0NEVfMhF8dJf4yQ6KQZmGD",
"prev_page_token": "vuA7JeKI5c6FLnPt5JfRcZcJxW",
"records": [
{
"created_at": "2024-01-01T00:00:00",
"debit_credit": "debit",
"editable": false,
"financial_account_type": "bank_account",
"id": "7JRNsKwy2Lw66caxVU7WGC",
"is_autocat_category": false,
"is_required": false,
"name": "Pluto Checking 4242",
"report_cash_flow": true,
"sort_code": "2240",
"sub_type": "current_assets",
"type": "asset"
}
]
}{
"message": "<string>",
"data": "<unknown>",
"display_message": "<string>",
"error_code": "invalid_date"
}{
"message": "<string>",
"data": "<unknown>",
"display_message": "<string>",
"error_code": "invalid_date"
}{
"message": "<string>",
"data": "<unknown>",
"display_message": "<string>",
"error_code": "invalid_date"
}{
"message": "<string>",
"data": "<unknown>",
"display_message": "<string>",
"error_code": "invalid_date"
}Authorizations
Bearer authentication header of the form Bearer , where is your auth token.
Headers
The Teal instance ID
Query Parameters
Optional ledger type used for filtering.
asset, liability, equity, revenue, expense Optional ledger sub type used for filtering.
current_assets, non-current_assets, transfers_between_accounts, uncategorized_assets, current_liabilities, non-current_liabilities, equity, operating_revenues, other_income, cost_of_goods_sold, operating_expenses, other_expenses, retained_earnings Optional financial account type used for filtering.
bank_account, credit_card, payments, payroll, loan, prepaid_card, accounts_receivable, accounts_payable, treasury, investment Optional ledger debit/credit used for filtering.
debit, credit Optional special ledger type used for filtering. Special ledgers are ledgers that have special behaviour in the system.
uncat_inflow, uncat_outflow, account_transfers, opening_balances, retained_earnings, current_year_earnings, accounts_receivable, accounts_payable, wages_expense, bonus_expense, commissions_expense, contractor_expense, employee_reimbursements, severance_expense, payroll_tax_expense, employer_benefits_expense, health_insurance_expense, wages_payable, payroll_tax_payable, employee_benefit_liabilities, payroll_liabilities, payroll_adjustments_clearing A comma separated list of sort orders for the results.
name, -name, type, -type, sub_type, -sub_type, debit_credit, -debit_credit Comma-separated list of Ledger expand paths.
parent, parent.parent, details Deprecated: use ids instead. Comma-separated list of ledger IDs.
Alias for ledger_ids. Comma-separated list of ledger IDs. Returns 404 if an ID is not found, 403 if any ID is not authorized.
The number of records to return. Max limit is 1000.
x >= 1Opaque page token
Response
Successful Response
The token to use to request the next page
"ikal0NEVfMhF8dJf4yQ6KQZmGD"
The token to use to request the previous page
"vuA7JeKI5c6FLnPt5JfRcZcJxW"
List of ledgers
Show child attributes
Show child attributes
[
{
"created_at": "2024-01-01T00:00:00",
"debit_credit": "debit",
"editable": false,
"financial_account_type": "bank_account",
"id": "7JRNsKwy2Lw66caxVU7WGC",
"is_autocat_category": false,
"is_required": false,
"name": "Pluto Checking 4242",
"report_cash_flow": true,
"sort_code": "2240",
"sub_type": "current_assets",
"type": "asset"
}
]