curl --request POST \
--url https://api.sandbox.teal.dev/v0/instance \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"coa_template_id": "CNmWM3X6AcvRdEwZKxq4bL",
"entries_start": "2024-01-01T00:00:00Z",
"name": "ACME Goods Inc",
"subscription": "tier3",
"accounting_basis": "accrual"
}
'import requests
url = "https://api.sandbox.teal.dev/v0/instance"
payload = {
"coa_template_id": "CNmWM3X6AcvRdEwZKxq4bL",
"entries_start": "2024-01-01T00:00:00Z",
"name": "ACME Goods Inc",
"subscription": "tier3",
"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({
coa_template_id: 'CNmWM3X6AcvRdEwZKxq4bL',
entries_start: '2024-01-01T00:00:00Z',
name: 'ACME Goods Inc',
subscription: 'tier3',
accounting_basis: 'accrual'
})
};
fetch('https://api.sandbox.teal.dev/v0/instance', 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/instance",
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([
'coa_template_id' => 'CNmWM3X6AcvRdEwZKxq4bL',
'entries_start' => '2024-01-01T00:00:00Z',
'name' => 'ACME Goods Inc',
'subscription' => 'tier3',
'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/instance"
payload := strings.NewReader("{\n \"coa_template_id\": \"CNmWM3X6AcvRdEwZKxq4bL\",\n \"entries_start\": \"2024-01-01T00:00:00Z\",\n \"name\": \"ACME Goods Inc\",\n \"subscription\": \"tier3\",\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/instance")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"coa_template_id\": \"CNmWM3X6AcvRdEwZKxq4bL\",\n \"entries_start\": \"2024-01-01T00:00:00Z\",\n \"name\": \"ACME Goods Inc\",\n \"subscription\": \"tier3\",\n \"accounting_basis\": \"accrual\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.teal.dev/v0/instance")
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 \"coa_template_id\": \"CNmWM3X6AcvRdEwZKxq4bL\",\n \"entries_start\": \"2024-01-01T00:00:00Z\",\n \"name\": \"ACME Goods Inc\",\n \"subscription\": \"tier3\",\n \"accounting_basis\": \"accrual\"\n}"
response = http.request(request)
puts response.read_body{
"id": "RKtPbubK5NcbBsUmU1ktSP",
"entries_start": "2024-01-01T00:00:00Z",
"name": "ACME Goods Inc",
"subscription": "tier3",
"accounting_basis": "accrual",
"coa_template_id": "CNmWM3X6AcvRdEwZKxq4bL"
}{
"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 an Instance
Creates a new Instance based on the given parameters.
curl --request POST \
--url https://api.sandbox.teal.dev/v0/instance \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"coa_template_id": "CNmWM3X6AcvRdEwZKxq4bL",
"entries_start": "2024-01-01T00:00:00Z",
"name": "ACME Goods Inc",
"subscription": "tier3",
"accounting_basis": "accrual"
}
'import requests
url = "https://api.sandbox.teal.dev/v0/instance"
payload = {
"coa_template_id": "CNmWM3X6AcvRdEwZKxq4bL",
"entries_start": "2024-01-01T00:00:00Z",
"name": "ACME Goods Inc",
"subscription": "tier3",
"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({
coa_template_id: 'CNmWM3X6AcvRdEwZKxq4bL',
entries_start: '2024-01-01T00:00:00Z',
name: 'ACME Goods Inc',
subscription: 'tier3',
accounting_basis: 'accrual'
})
};
fetch('https://api.sandbox.teal.dev/v0/instance', 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/instance",
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([
'coa_template_id' => 'CNmWM3X6AcvRdEwZKxq4bL',
'entries_start' => '2024-01-01T00:00:00Z',
'name' => 'ACME Goods Inc',
'subscription' => 'tier3',
'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/instance"
payload := strings.NewReader("{\n \"coa_template_id\": \"CNmWM3X6AcvRdEwZKxq4bL\",\n \"entries_start\": \"2024-01-01T00:00:00Z\",\n \"name\": \"ACME Goods Inc\",\n \"subscription\": \"tier3\",\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/instance")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"coa_template_id\": \"CNmWM3X6AcvRdEwZKxq4bL\",\n \"entries_start\": \"2024-01-01T00:00:00Z\",\n \"name\": \"ACME Goods Inc\",\n \"subscription\": \"tier3\",\n \"accounting_basis\": \"accrual\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.teal.dev/v0/instance")
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 \"coa_template_id\": \"CNmWM3X6AcvRdEwZKxq4bL\",\n \"entries_start\": \"2024-01-01T00:00:00Z\",\n \"name\": \"ACME Goods Inc\",\n \"subscription\": \"tier3\",\n \"accounting_basis\": \"accrual\"\n}"
response = http.request(request)
puts response.read_body{
"id": "RKtPbubK5NcbBsUmU1ktSP",
"entries_start": "2024-01-01T00:00:00Z",
"name": "ACME Goods Inc",
"subscription": "tier3",
"accounting_basis": "accrual",
"coa_template_id": "CNmWM3X6AcvRdEwZKxq4bL"
}{
"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 agent id
Body
The ID of the Chart of Accounts Template used to pre-populate the Instance's ledgers.
"CNmWM3X6AcvRdEwZKxq4bL"
The datetime in UTC time from which the API will sync an Instance's accounting data. Transactions or journal entries cannot be entered before this date. The time component is ignored — the value is always stored as start-of-day UTC (00:00:00Z).
"2024-01-01T00:00:00Z"
The name of the business.
"ACME Goods Inc"
The Instance's subscription tier.
tier0, tier1, tier2, tier3, tier4 "tier3"
The accounting method used: cash basis or accrual basis.
cash, accrual "accrual"
Response
Successful Response
The unique ID of the object.
"RKtPbubK5NcbBsUmU1ktSP"
The datetime in UTC time from which the API will sync an Instance's accounting data. Transactions or journal entries cannot be entered before this date. The time component is ignored — the value is always stored as start-of-day UTC (00:00:00Z).
"2024-01-01T00:00:00Z"
The name of the business.
"ACME Goods Inc"
The Instance's subscription tier.
tier0, tier1, tier2, tier3, tier4 "tier3"
The accounting method used: cash basis or accrual basis.
cash, accrual "accrual"
The ID of the Chart of Accounts Template used to pre-populate the Instance's ledgers.
"CNmWM3X6AcvRdEwZKxq4bL"