curl --request PUT \
--url https://api.sandbox.teal.dev/v0/platform-gl/coa-templates/ledgers/{ledger_template_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"sort_code": "<string>",
"parent_id": "<string>",
"clear_fields": [
"parent_id"
]
}
'import requests
url = "https://api.sandbox.teal.dev/v0/platform-gl/coa-templates/ledgers/{ledger_template_id}"
payload = {
"name": "<string>",
"sort_code": "<string>",
"parent_id": "<string>",
"clear_fields": ["parent_id"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
sort_code: '<string>',
parent_id: '<string>',
clear_fields: ['parent_id']
})
};
fetch('https://api.sandbox.teal.dev/v0/platform-gl/coa-templates/ledgers/{ledger_template_id}', 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/ledgers/{ledger_template_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'sort_code' => '<string>',
'parent_id' => '<string>',
'clear_fields' => [
'parent_id'
]
]),
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/ledgers/{ledger_template_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"sort_code\": \"<string>\",\n \"parent_id\": \"<string>\",\n \"clear_fields\": [\n \"parent_id\"\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.sandbox.teal.dev/v0/platform-gl/coa-templates/ledgers/{ledger_template_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"sort_code\": \"<string>\",\n \"parent_id\": \"<string>\",\n \"clear_fields\": [\n \"parent_id\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.teal.dev/v0/platform-gl/coa-templates/ledgers/{ledger_template_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"sort_code\": \"<string>\",\n \"parent_id\": \"<string>\",\n \"clear_fields\": [\n \"parent_id\"\n ]\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,
"required_ledger_purpose": "account_transfers"
}{
"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"
}Update a Ledger Template
Updates an existing Ledger Template.
curl --request PUT \
--url https://api.sandbox.teal.dev/v0/platform-gl/coa-templates/ledgers/{ledger_template_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"sort_code": "<string>",
"parent_id": "<string>",
"clear_fields": [
"parent_id"
]
}
'import requests
url = "https://api.sandbox.teal.dev/v0/platform-gl/coa-templates/ledgers/{ledger_template_id}"
payload = {
"name": "<string>",
"sort_code": "<string>",
"parent_id": "<string>",
"clear_fields": ["parent_id"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
sort_code: '<string>',
parent_id: '<string>',
clear_fields: ['parent_id']
})
};
fetch('https://api.sandbox.teal.dev/v0/platform-gl/coa-templates/ledgers/{ledger_template_id}', 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/ledgers/{ledger_template_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'sort_code' => '<string>',
'parent_id' => '<string>',
'clear_fields' => [
'parent_id'
]
]),
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/ledgers/{ledger_template_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"sort_code\": \"<string>\",\n \"parent_id\": \"<string>\",\n \"clear_fields\": [\n \"parent_id\"\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.sandbox.teal.dev/v0/platform-gl/coa-templates/ledgers/{ledger_template_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"sort_code\": \"<string>\",\n \"parent_id\": \"<string>\",\n \"clear_fields\": [\n \"parent_id\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.teal.dev/v0/platform-gl/coa-templates/ledgers/{ledger_template_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"sort_code\": \"<string>\",\n \"parent_id\": \"<string>\",\n \"clear_fields\": [\n \"parent_id\"\n ]\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,
"required_ledger_purpose": "account_transfers"
}{
"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
Body
Response
Successful Response
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
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"
Required ledgers fulfill specific system functions and are necessary for the accounting system to operate.
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, benefits_expense, donations_expense, wages_payable, payroll_tax_payable, employee_benefit_liabilities, payroll_liabilities, payroll_adjustments_clearing, benefits_payable, payroll_tax_accruals, stock_exercise_clearing, payroll_clearing "account_transfers"