Create a Chart of Accounts Template
curl --request POST \
--url https://api.sandbox.teal.dev/v0/platform-gl/coa-templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Coffee Shop Sole Prop",
"accounting_basis": "accrual"
}
'import requests
url = "https://api.sandbox.teal.dev/v0/platform-gl/coa-templates"
payload = {
"name": "Coffee Shop Sole Prop",
"accounting_basis": "accrual"
}
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({name: 'Coffee Shop Sole Prop', accounting_basis: 'accrual'})
};
fetch('https://api.sandbox.teal.dev/v0/platform-gl/coa-templates', 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",
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([
'name' => 'Coffee Shop Sole Prop',
'accounting_basis' => 'accrual'
]),
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"
payload := strings.NewReader("{\n \"name\": \"Coffee Shop Sole Prop\",\n \"accounting_basis\": \"accrual\"\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")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Coffee Shop Sole Prop\",\n \"accounting_basis\": \"accrual\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.teal.dev/v0/platform-gl/coa-templates")
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 \"name\": \"Coffee Shop Sole Prop\",\n \"accounting_basis\": \"accrual\"\n}"
response = http.request(request)
puts response.read_body{
"id": "PpvsmFEv14yGDyT6iV6kXw",
"name": "Coffee Shop Sole Prop",
"accounting_basis": "accrual",
"type": "agent",
"ledger_ids": [
"7JRNsKwy2Lw66caxVU7WGC",
"HLn8oy2eqMUCwjp1Cwdgco"
],
"ledgers": 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"
}Chart of Accounts Templates
Create a Chart of Accounts Template
Creates a Chart of Accounts Template.
POST
/
v0
/
platform-gl
/
coa-templates
Create a Chart of Accounts Template
curl --request POST \
--url https://api.sandbox.teal.dev/v0/platform-gl/coa-templates \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Coffee Shop Sole Prop",
"accounting_basis": "accrual"
}
'import requests
url = "https://api.sandbox.teal.dev/v0/platform-gl/coa-templates"
payload = {
"name": "Coffee Shop Sole Prop",
"accounting_basis": "accrual"
}
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({name: 'Coffee Shop Sole Prop', accounting_basis: 'accrual'})
};
fetch('https://api.sandbox.teal.dev/v0/platform-gl/coa-templates', 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",
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([
'name' => 'Coffee Shop Sole Prop',
'accounting_basis' => 'accrual'
]),
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"
payload := strings.NewReader("{\n \"name\": \"Coffee Shop Sole Prop\",\n \"accounting_basis\": \"accrual\"\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")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Coffee Shop Sole Prop\",\n \"accounting_basis\": \"accrual\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.teal.dev/v0/platform-gl/coa-templates")
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 \"name\": \"Coffee Shop Sole Prop\",\n \"accounting_basis\": \"accrual\"\n}"
response = http.request(request)
puts response.read_body{
"id": "PpvsmFEv14yGDyT6iV6kXw",
"name": "Coffee Shop Sole Prop",
"accounting_basis": "accrual",
"type": "agent",
"ledger_ids": [
"7JRNsKwy2Lw66caxVU7WGC",
"HLn8oy2eqMUCwjp1Cwdgco"
],
"ledgers": 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.
Query Parameters
Comma-separated list of expandable paths.
Available options:
ledgers Body
application/json
Response
Successful Response
The unique ID of the object.
Example:
"PpvsmFEv14yGDyT6iV6kXw"
An arbitrary string on the object, useful for identifying the Chart of Accounts template.
Example:
"Coffee Shop Sole Prop"
The accounting basis for this Chart of Accounts template.
Available options:
cash, accrual Example:
"accrual"
Whether this template belongs to an agent or a platform.
Available options:
agent, platform Example:
"agent"
A list of IDs of the Ledger Template objects associated with the Chart of Accounts Template
Example:
[
"7JRNsKwy2Lw66caxVU7WGC",
"HLn8oy2eqMUCwjp1Cwdgco"
]
Expandable. A list of the Ledger Templates associated with the Chart of Accounts Template.
Show child attributes
Show child attributes
Example:
null