curl --request POST \
--url https://api.sandbox.teal.dev/v0/platform-gl/coa-templates/{coa_template_id}/ledgers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"editable": false,
"debit_credit": "debit",
"ledger_sub_type": "current_assets",
"ledger_type": "asset",
"name": "Pluto Checking 4242",
"report_cash_flow": true,
"sort_code": "1400",
"financial_account_type": "bank_account",
"parent_id": null
}
'import requests
url = "https://api.sandbox.teal.dev/v0/platform-gl/coa-templates/{coa_template_id}/ledgers"
payload = {
"editable": False,
"debit_credit": "debit",
"ledger_sub_type": "current_assets",
"ledger_type": "asset",
"name": "Pluto Checking 4242",
"report_cash_flow": True,
"sort_code": "1400",
"financial_account_type": "bank_account",
"parent_id": None
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
editable: false,
debit_credit: 'debit',
ledger_sub_type: 'current_assets',
ledger_type: 'asset',
name: 'Pluto Checking 4242',
report_cash_flow: true,
sort_code: '1400',
financial_account_type: 'bank_account',
parent_id: null
})
};
fetch('https://api.sandbox.teal.dev/v0/platform-gl/coa-templates/{coa_template_id}/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/platform-gl/coa-templates/{coa_template_id}/ledgers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'editable' => false,
'debit_credit' => 'debit',
'ledger_sub_type' => 'current_assets',
'ledger_type' => 'asset',
'name' => 'Pluto Checking 4242',
'report_cash_flow' => true,
'sort_code' => '1400',
'financial_account_type' => 'bank_account',
'parent_id' => null
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.teal.dev/v0/platform-gl/coa-templates/{coa_template_id}/ledgers"
payload := strings.NewReader("{\n \"editable\": false,\n \"debit_credit\": \"debit\",\n \"ledger_sub_type\": \"current_assets\",\n \"ledger_type\": \"asset\",\n \"name\": \"Pluto Checking 4242\",\n \"report_cash_flow\": true,\n \"sort_code\": \"1400\",\n \"financial_account_type\": \"bank_account\",\n \"parent_id\": null\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sandbox.teal.dev/v0/platform-gl/coa-templates/{coa_template_id}/ledgers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"editable\": false,\n \"debit_credit\": \"debit\",\n \"ledger_sub_type\": \"current_assets\",\n \"ledger_type\": \"asset\",\n \"name\": \"Pluto Checking 4242\",\n \"report_cash_flow\": true,\n \"sort_code\": \"1400\",\n \"financial_account_type\": \"bank_account\",\n \"parent_id\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.teal.dev/v0/platform-gl/coa-templates/{coa_template_id}/ledgers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"editable\": false,\n \"debit_credit\": \"debit\",\n \"ledger_sub_type\": \"current_assets\",\n \"ledger_type\": \"asset\",\n \"name\": \"Pluto Checking 4242\",\n \"report_cash_flow\": true,\n \"sort_code\": \"1400\",\n \"financial_account_type\": \"bank_account\",\n \"parent_id\": null\n}"
response = http.request(request)
puts response.read_body{
"id": "7JRNsKwy2Lw66caxVU7WGC",
"debit_credit": "debit",
"editable": false,
"financial_account_type": "bank_account",
"is_required": false,
"name": "Pluto Checking 4242",
"parent_id": null,
"report_cash_flow": true,
"sort_code": "1400",
"sub_type": "current_assets",
"type": "asset",
"children": null
}{
"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"
}Create a Ledger Template
Creates a new Ledger Template within a Chart of Accounts Template.
curl --request POST \
--url https://api.sandbox.teal.dev/v0/platform-gl/coa-templates/{coa_template_id}/ledgers \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"editable": false,
"debit_credit": "debit",
"ledger_sub_type": "current_assets",
"ledger_type": "asset",
"name": "Pluto Checking 4242",
"report_cash_flow": true,
"sort_code": "1400",
"financial_account_type": "bank_account",
"parent_id": null
}
'import requests
url = "https://api.sandbox.teal.dev/v0/platform-gl/coa-templates/{coa_template_id}/ledgers"
payload = {
"editable": False,
"debit_credit": "debit",
"ledger_sub_type": "current_assets",
"ledger_type": "asset",
"name": "Pluto Checking 4242",
"report_cash_flow": True,
"sort_code": "1400",
"financial_account_type": "bank_account",
"parent_id": None
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
editable: false,
debit_credit: 'debit',
ledger_sub_type: 'current_assets',
ledger_type: 'asset',
name: 'Pluto Checking 4242',
report_cash_flow: true,
sort_code: '1400',
financial_account_type: 'bank_account',
parent_id: null
})
};
fetch('https://api.sandbox.teal.dev/v0/platform-gl/coa-templates/{coa_template_id}/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/platform-gl/coa-templates/{coa_template_id}/ledgers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'editable' => false,
'debit_credit' => 'debit',
'ledger_sub_type' => 'current_assets',
'ledger_type' => 'asset',
'name' => 'Pluto Checking 4242',
'report_cash_flow' => true,
'sort_code' => '1400',
'financial_account_type' => 'bank_account',
'parent_id' => null
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.teal.dev/v0/platform-gl/coa-templates/{coa_template_id}/ledgers"
payload := strings.NewReader("{\n \"editable\": false,\n \"debit_credit\": \"debit\",\n \"ledger_sub_type\": \"current_assets\",\n \"ledger_type\": \"asset\",\n \"name\": \"Pluto Checking 4242\",\n \"report_cash_flow\": true,\n \"sort_code\": \"1400\",\n \"financial_account_type\": \"bank_account\",\n \"parent_id\": null\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sandbox.teal.dev/v0/platform-gl/coa-templates/{coa_template_id}/ledgers")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"editable\": false,\n \"debit_credit\": \"debit\",\n \"ledger_sub_type\": \"current_assets\",\n \"ledger_type\": \"asset\",\n \"name\": \"Pluto Checking 4242\",\n \"report_cash_flow\": true,\n \"sort_code\": \"1400\",\n \"financial_account_type\": \"bank_account\",\n \"parent_id\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.teal.dev/v0/platform-gl/coa-templates/{coa_template_id}/ledgers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"editable\": false,\n \"debit_credit\": \"debit\",\n \"ledger_sub_type\": \"current_assets\",\n \"ledger_type\": \"asset\",\n \"name\": \"Pluto Checking 4242\",\n \"report_cash_flow\": true,\n \"sort_code\": \"1400\",\n \"financial_account_type\": \"bank_account\",\n \"parent_id\": null\n}"
response = http.request(request)
puts response.read_body{
"id": "7JRNsKwy2Lw66caxVU7WGC",
"debit_credit": "debit",
"editable": false,
"financial_account_type": "bank_account",
"is_required": false,
"name": "Pluto Checking 4242",
"parent_id": null,
"report_cash_flow": true,
"sort_code": "1400",
"sub_type": "current_assets",
"type": "asset",
"children": null
}{
"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.
Path Parameters
The ID of the Chart of Accounts Template.
Body
Whether line entries can be manually added or removed from the ledger.
false
Indicates if the ledger is a credit or debit ledger.
debit, credit "debit"
Indicates similar characteristics and accounting treatment for a group of ledgers within a type.
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 "current_assets"
Indicates the purpose and location of the funds and value recorded in the ledger and which report it is included in: asset, liability and equity ledgers are displayed on the balance sheet; revenue and expenses are displayed on the income statement.
asset, liability, equity, revenue, expense "asset"
The name of the ledger.
"Pluto Checking 4242"
Whether or not this ledger is included in the cash flow report. For ledgers with a financial_account_type, this value is automatically determined and cannot be modified.
true
Determines the display order in reports, ordered digit by digit, starting from the leftmost position. For example, 20010 will come before 3050.
20^[0-9]+$"1400"
Indicates that the ledger represents a real-world financial account.
bank_account, credit_card, payments, payroll, loan, prepaid_card, accounts_receivable, accounts_payable, treasury, investment "bank_account"
If the ledger is a child Ledger, the ID of the parent ledger object.
null
Response
Successful Response
The unique ID of the object.
"7JRNsKwy2Lw66caxVU7WGC"
Indicates if the ledger is a credit or debit ledger.
debit, credit "debit"
Whether line entries can be manually added or removed from the ledger.
false
Indicates that the ledger represents a real-world financial account.
bank_account, credit_card, payments, payroll, loan, prepaid_card, accounts_receivable, accounts_payable, treasury, investment "bank_account"
Indicates that the ledger is a system ledger required for Teal to work. These ledgers can be renamed to fit your needs but cannot be deleted. Their behaviour is identified by required_ledger_purpose; see that field's enum for the full set of purposes (e.g. account_transfers, opening_balances, uncat_inflow, uncat_outflow, retained_earnings, current_year_earnings, accounts_receivable, accounts_payable, and the payroll system ledgers).
false
The name of the ledger.
"Pluto Checking 4242"
If the ledger is a child Ledger, the ID of the parent ledger object.
null
Whether or not this ledger is included in the cash flow report. For ledgers with a financial_account_type, this value is automatically determined and cannot be modified.
true
Determines the display order in reports, ordered digit by digit, starting from the leftmost position. For example, 20010 will come before 3050.
"1400"
Indicates similar characteristics and accounting treatment for a group of ledgers within a type.
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 "current_assets"
Indicates the purpose and location of the funds and value recorded in the ledger and which report it is included in: asset, liability and equity ledgers are displayed on the balance sheet; revenue and expenses are displayed on the income statement.
asset, liability, equity, revenue, expense "asset"
If the Ledger has child ledgers, a list of the Ledger objects.
null