curl --request POST \
--url https://api.sandbox.teal.dev/v0/source-accounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'teal-instance-id: <teal-instance-id>' \
--data '
{
"name": "<string>",
"ledger_id": "<string>",
"ledger": {
"opening_balance": 123
},
"invert_transaction_amounts": false
}
'import requests
url = "https://api.sandbox.teal.dev/v0/source-accounts"
payload = {
"name": "<string>",
"ledger_id": "<string>",
"ledger": { "opening_balance": 123 },
"invert_transaction_amounts": False
}
headers = {
"teal-instance-id": "<teal-instance-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'teal-instance-id': '<teal-instance-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
ledger_id: '<string>',
ledger: {opening_balance: 123},
invert_transaction_amounts: false
})
};
fetch('https://api.sandbox.teal.dev/v0/source-accounts', 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/source-accounts",
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' => '<string>',
'ledger_id' => '<string>',
'ledger' => [
'opening_balance' => 123
],
'invert_transaction_amounts' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"teal-instance-id: <teal-instance-id>"
],
]);
$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/source-accounts"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"ledger_id\": \"<string>\",\n \"ledger\": {\n \"opening_balance\": 123\n },\n \"invert_transaction_amounts\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("teal-instance-id", "<teal-instance-id>")
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/source-accounts")
.header("teal-instance-id", "<teal-instance-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"ledger_id\": \"<string>\",\n \"ledger\": {\n \"opening_balance\": 123\n },\n \"invert_transaction_amounts\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.teal.dev/v0/source-accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["teal-instance-id"] = '<teal-instance-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"ledger_id\": \"<string>\",\n \"ledger\": {\n \"opening_balance\": 123\n },\n \"invert_transaction_amounts\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "KdE7Q37LeQhFQCfEejfibT",
"name": "<string>",
"debit_credit": "debit",
"ledger_id": "<string>",
"type": "plaid",
"business_personal": "business",
"invert_transaction_amounts": false
}{
"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 Transaction Source Account
Create a transaction source account to manually write transactions.
curl --request POST \
--url https://api.sandbox.teal.dev/v0/source-accounts \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'teal-instance-id: <teal-instance-id>' \
--data '
{
"name": "<string>",
"ledger_id": "<string>",
"ledger": {
"opening_balance": 123
},
"invert_transaction_amounts": false
}
'import requests
url = "https://api.sandbox.teal.dev/v0/source-accounts"
payload = {
"name": "<string>",
"ledger_id": "<string>",
"ledger": { "opening_balance": 123 },
"invert_transaction_amounts": False
}
headers = {
"teal-instance-id": "<teal-instance-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'teal-instance-id': '<teal-instance-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: '<string>',
ledger_id: '<string>',
ledger: {opening_balance: 123},
invert_transaction_amounts: false
})
};
fetch('https://api.sandbox.teal.dev/v0/source-accounts', 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/source-accounts",
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' => '<string>',
'ledger_id' => '<string>',
'ledger' => [
'opening_balance' => 123
],
'invert_transaction_amounts' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"teal-instance-id: <teal-instance-id>"
],
]);
$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/source-accounts"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"ledger_id\": \"<string>\",\n \"ledger\": {\n \"opening_balance\": 123\n },\n \"invert_transaction_amounts\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("teal-instance-id", "<teal-instance-id>")
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/source-accounts")
.header("teal-instance-id", "<teal-instance-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"ledger_id\": \"<string>\",\n \"ledger\": {\n \"opening_balance\": 123\n },\n \"invert_transaction_amounts\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.teal.dev/v0/source-accounts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["teal-instance-id"] = '<teal-instance-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"ledger_id\": \"<string>\",\n \"ledger\": {\n \"opening_balance\": 123\n },\n \"invert_transaction_amounts\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "KdE7Q37LeQhFQCfEejfibT",
"name": "<string>",
"debit_credit": "debit",
"ledger_id": "<string>",
"type": "plaid",
"business_personal": "business",
"invert_transaction_amounts": false
}{
"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 Teal instance ID
An optional identifier for audit logging.
Body
Deprecated. The source account's name now mirrors the linked ledger's name; provide the ledger name when creating the ledger instead.
Whether the account is a business or personal account.
business, personal The ledger where transactions will be posted. The ledger must have a financial account type. Exactly one of ledger_id or ledger must be provided.
Details for a new ledger to create for this source account. Exactly one of ledger_id or ledger must be provided.
Show child attributes
Show child attributes
If true transaction amounts are inverted during manual import only.
Response
Successful Response
"KdE7Q37LeQhFQCfEejfibT"
Deprecated. Returns the linked ledger's name; read it from the ledger directly.
Whether the account is a debit or credit account.
debit, credit The ledger ID where transactions will be posted.
The type of the transaction source.
plaid, manual Whether the account is a business or personal account.
business, personal If true transaction amounts are inverted during manual import only.