Journal Entries
Create a Journal Entry
Scopes: journal_entry:create
POST
/
v0
/
business
/
{business_id}
/
journal-entries
Create a Journal Entry
curl --request POST \
--url https://api.sandbox.getasset.com/v0/business/{business_id}/journal-entries \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "<string>",
"datetime": "2023-11-07T05:31:56Z",
"lines": [
{
"ledger_id": "<string>",
"description": "<string>",
"amount": "89.23",
"tag_value_ids": [
"tv_Ns6rRRLYVZPh4cVB7MDby5"
]
}
]
}
'import requests
url = "https://api.sandbox.getasset.com/v0/business/{business_id}/journal-entries"
payload = {
"description": "<string>",
"datetime": "2023-11-07T05:31:56Z",
"lines": [
{
"ledger_id": "<string>",
"description": "<string>",
"amount": "89.23",
"tag_value_ids": ["tv_Ns6rRRLYVZPh4cVB7MDby5"]
}
]
}
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({
description: '<string>',
datetime: '2023-11-07T05:31:56Z',
lines: [
{
ledger_id: '<string>',
description: '<string>',
amount: '89.23',
tag_value_ids: ['tv_Ns6rRRLYVZPh4cVB7MDby5']
}
]
})
};
fetch('https://api.sandbox.getasset.com/v0/business/{business_id}/journal-entries', 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.getasset.com/v0/business/{business_id}/journal-entries",
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([
'description' => '<string>',
'datetime' => '2023-11-07T05:31:56Z',
'lines' => [
[
'ledger_id' => '<string>',
'description' => '<string>',
'amount' => '89.23',
'tag_value_ids' => [
'tv_Ns6rRRLYVZPh4cVB7MDby5'
]
]
]
]),
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.getasset.com/v0/business/{business_id}/journal-entries"
payload := strings.NewReader("{\n \"description\": \"<string>\",\n \"datetime\": \"2023-11-07T05:31:56Z\",\n \"lines\": [\n {\n \"ledger_id\": \"<string>\",\n \"description\": \"<string>\",\n \"amount\": \"89.23\",\n \"tag_value_ids\": [\n \"tv_Ns6rRRLYVZPh4cVB7MDby5\"\n ]\n }\n ]\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.getasset.com/v0/business/{business_id}/journal-entries")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"<string>\",\n \"datetime\": \"2023-11-07T05:31:56Z\",\n \"lines\": [\n {\n \"ledger_id\": \"<string>\",\n \"description\": \"<string>\",\n \"amount\": \"89.23\",\n \"tag_value_ids\": [\n \"tv_Ns6rRRLYVZPh4cVB7MDby5\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.getasset.com/v0/business/{business_id}/journal-entries")
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 \"description\": \"<string>\",\n \"datetime\": \"2023-11-07T05:31:56Z\",\n \"lines\": [\n {\n \"ledger_id\": \"<string>\",\n \"description\": \"<string>\",\n \"amount\": \"89.23\",\n \"tag_value_ids\": [\n \"tv_Ns6rRRLYVZPh4cVB7MDby5\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"business_id": "<string>",
"description": "<string>",
"clean_description": "HomeDepot purchase",
"datetime": "2023-11-07T05:31:56Z",
"is_reconciled": true,
"id": "<string>",
"transaction_id": "txn_WQMDNUHpBThYSNh4AprDBo",
"line_entries": [
{
"ledger_id": "<string>",
"description": "<string>",
"amount": 123,
"id": "<string>",
"journal_entry_id": "<string>",
"transaction_id": "txn_WQMDNUHpBThYSNh4AprDBo",
"tag_value_ids": [
"<string>"
]
}
],
"categorization_method": "manual",
"invoice_id": "inv_WQMDNUHpBThYSNh4AprDBo"
}
}{
"error": "<string>",
"data": "<unknown>"
}{
"error": "<string>",
"data": "<unknown>"
}{
"error": "<string>",
"data": "<unknown>"
}{
"error": "<string>",
"data": "<unknown>"
}{
"error": "<string>",
"data": "<unknown>"
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Headers
Optional external entity identifier that performed the action
Path Parameters
The id of the business
Example:
"biz_GA6EG2qFxA97NZHtxeLPUy"
Body
application/json
The description of the Journal Entry
Example:
"HomeDepot purchase"
The datetime the Journal Entry was created in UTC ISO-8601 format
Example:
"2023-11-07T05:31:56Z"
The line entries associate with the Journal Entry. All debits and credits must balance and there must be at least one debit and one credit line
Show child attributes
Show child attributes
Response
Successful Response
Show child attributes
Show child attributes
⌘I
Create a Journal Entry
curl --request POST \
--url https://api.sandbox.getasset.com/v0/business/{business_id}/journal-entries \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "<string>",
"datetime": "2023-11-07T05:31:56Z",
"lines": [
{
"ledger_id": "<string>",
"description": "<string>",
"amount": "89.23",
"tag_value_ids": [
"tv_Ns6rRRLYVZPh4cVB7MDby5"
]
}
]
}
'import requests
url = "https://api.sandbox.getasset.com/v0/business/{business_id}/journal-entries"
payload = {
"description": "<string>",
"datetime": "2023-11-07T05:31:56Z",
"lines": [
{
"ledger_id": "<string>",
"description": "<string>",
"amount": "89.23",
"tag_value_ids": ["tv_Ns6rRRLYVZPh4cVB7MDby5"]
}
]
}
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({
description: '<string>',
datetime: '2023-11-07T05:31:56Z',
lines: [
{
ledger_id: '<string>',
description: '<string>',
amount: '89.23',
tag_value_ids: ['tv_Ns6rRRLYVZPh4cVB7MDby5']
}
]
})
};
fetch('https://api.sandbox.getasset.com/v0/business/{business_id}/journal-entries', 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.getasset.com/v0/business/{business_id}/journal-entries",
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([
'description' => '<string>',
'datetime' => '2023-11-07T05:31:56Z',
'lines' => [
[
'ledger_id' => '<string>',
'description' => '<string>',
'amount' => '89.23',
'tag_value_ids' => [
'tv_Ns6rRRLYVZPh4cVB7MDby5'
]
]
]
]),
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.getasset.com/v0/business/{business_id}/journal-entries"
payload := strings.NewReader("{\n \"description\": \"<string>\",\n \"datetime\": \"2023-11-07T05:31:56Z\",\n \"lines\": [\n {\n \"ledger_id\": \"<string>\",\n \"description\": \"<string>\",\n \"amount\": \"89.23\",\n \"tag_value_ids\": [\n \"tv_Ns6rRRLYVZPh4cVB7MDby5\"\n ]\n }\n ]\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.getasset.com/v0/business/{business_id}/journal-entries")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"<string>\",\n \"datetime\": \"2023-11-07T05:31:56Z\",\n \"lines\": [\n {\n \"ledger_id\": \"<string>\",\n \"description\": \"<string>\",\n \"amount\": \"89.23\",\n \"tag_value_ids\": [\n \"tv_Ns6rRRLYVZPh4cVB7MDby5\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.getasset.com/v0/business/{business_id}/journal-entries")
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 \"description\": \"<string>\",\n \"datetime\": \"2023-11-07T05:31:56Z\",\n \"lines\": [\n {\n \"ledger_id\": \"<string>\",\n \"description\": \"<string>\",\n \"amount\": \"89.23\",\n \"tag_value_ids\": [\n \"tv_Ns6rRRLYVZPh4cVB7MDby5\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"business_id": "<string>",
"description": "<string>",
"clean_description": "HomeDepot purchase",
"datetime": "2023-11-07T05:31:56Z",
"is_reconciled": true,
"id": "<string>",
"transaction_id": "txn_WQMDNUHpBThYSNh4AprDBo",
"line_entries": [
{
"ledger_id": "<string>",
"description": "<string>",
"amount": 123,
"id": "<string>",
"journal_entry_id": "<string>",
"transaction_id": "txn_WQMDNUHpBThYSNh4AprDBo",
"tag_value_ids": [
"<string>"
]
}
],
"categorization_method": "manual",
"invoice_id": "inv_WQMDNUHpBThYSNh4AprDBo"
}
}{
"error": "<string>",
"data": "<unknown>"
}{
"error": "<string>",
"data": "<unknown>"
}{
"error": "<string>",
"data": "<unknown>"
}{
"error": "<string>",
"data": "<unknown>"
}{
"error": "<string>",
"data": "<unknown>"
}