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": "cash",
"status": "live"
}
'import requests
url = "https://api.sandbox.teal.dev/v0/platform-gl/coa-templates"
payload = {
"name": "Coffee Shop Sole Prop",
"accounting_basis": "cash",
"status": "live"
}
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: 'cash', status: 'live'})
};
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' => 'cash',
'status' => 'live'
]),
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\": \"cash\",\n \"status\": \"live\"\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\": \"cash\",\n \"status\": \"live\"\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\": \"cash\",\n \"status\": \"live\"\n}"
response = http.request(request)
puts response.read_body{
"id": "PpvsmFEv14yGDyT6iV6kXw",
"name": "Coffee Shop Sole Prop",
"accounting_basis": "accrual",
"status": "live",
"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"
}Create a Chart of Accounts Template
Creates 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": "cash",
"status": "live"
}
'import requests
url = "https://api.sandbox.teal.dev/v0/platform-gl/coa-templates"
payload = {
"name": "Coffee Shop Sole Prop",
"accounting_basis": "cash",
"status": "live"
}
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: 'cash', status: 'live'})
};
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' => 'cash',
'status' => 'live'
]),
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\": \"cash\",\n \"status\": \"live\"\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\": \"cash\",\n \"status\": \"live\"\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\": \"cash\",\n \"status\": \"live\"\n}"
response = http.request(request)
puts response.read_body{
"id": "PpvsmFEv14yGDyT6iV6kXw",
"name": "Coffee Shop Sole Prop",
"accounting_basis": "accrual",
"status": "live",
"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.
- Token URL
- https://developer.teal.dev
Query Parameters
Comma-separated list of expandable paths.
ledgers Body
An arbitrary string on the object, useful for identifying the Chart of Accounts template.
"Coffee Shop Sole Prop"
The accounting basis for this Chart of Accounts template.
cash, accrual "cash"
draft, live "live"
Response
Successful Response
The unique ID of the object.
"PpvsmFEv14yGDyT6iV6kXw"
An arbitrary string on the object, useful for identifying the Chart of Accounts template.
"Coffee Shop Sole Prop"
The accounting basis for this Chart of Accounts template.
cash, accrual "accrual"
draft, live "live"
Whether this template belongs to an agent or a platform.
agent, platform "agent"
A list of IDs of the Ledger Template objects associated with the Chart of Accounts Template
[
"7JRNsKwy2Lw66caxVU7WGC",
"HLn8oy2eqMUCwjp1Cwdgco"
]
Expandable. A list of the Ledger Templates associated with the Chart of Accounts Template.
Show child attributes
Show child attributes
null