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": "HomeDepot purchase",
"datetime": "2023-11-07T05:31:56Z",
"lines": [
{
"ledger_id": "ldg_Ns6rRRLYVZPh4cVB7MDby5",
"description": "HomeDepot purchase",
"debit_credit": "debit",
"amount": "89.23",
"tag_value_ids": [
"tv_Ns6rRRLYVZPh4cVB7MDby5"
]
}
],
"external_id": "je-2023-11-07-001"
}
'import requests
url = "https://api.sandbox.getasset.com/v0/business/{business_id}/journal-entries"
payload = {
"description": "HomeDepot purchase",
"datetime": "2023-11-07T05:31:56Z",
"lines": [
{
"ledger_id": "ldg_Ns6rRRLYVZPh4cVB7MDby5",
"description": "HomeDepot purchase",
"debit_credit": "debit",
"amount": "89.23",
"tag_value_ids": ["tv_Ns6rRRLYVZPh4cVB7MDby5"]
}
],
"external_id": "je-2023-11-07-001"
}
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: 'HomeDepot purchase',
datetime: '2023-11-07T05:31:56Z',
lines: [
{
ledger_id: 'ldg_Ns6rRRLYVZPh4cVB7MDby5',
description: 'HomeDepot purchase',
debit_credit: 'debit',
amount: '89.23',
tag_value_ids: ['tv_Ns6rRRLYVZPh4cVB7MDby5']
}
],
external_id: 'je-2023-11-07-001'
})
};
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' => 'HomeDepot purchase',
'datetime' => '2023-11-07T05:31:56Z',
'lines' => [
[
'ledger_id' => 'ldg_Ns6rRRLYVZPh4cVB7MDby5',
'description' => 'HomeDepot purchase',
'debit_credit' => 'debit',
'amount' => '89.23',
'tag_value_ids' => [
'tv_Ns6rRRLYVZPh4cVB7MDby5'
]
]
],
'external_id' => 'je-2023-11-07-001'
]),
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\": \"HomeDepot purchase\",\n \"datetime\": \"2023-11-07T05:31:56Z\",\n \"lines\": [\n {\n \"ledger_id\": \"ldg_Ns6rRRLYVZPh4cVB7MDby5\",\n \"description\": \"HomeDepot purchase\",\n \"debit_credit\": \"debit\",\n \"amount\": \"89.23\",\n \"tag_value_ids\": [\n \"tv_Ns6rRRLYVZPh4cVB7MDby5\"\n ]\n }\n ],\n \"external_id\": \"je-2023-11-07-001\"\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\": \"HomeDepot purchase\",\n \"datetime\": \"2023-11-07T05:31:56Z\",\n \"lines\": [\n {\n \"ledger_id\": \"ldg_Ns6rRRLYVZPh4cVB7MDby5\",\n \"description\": \"HomeDepot purchase\",\n \"debit_credit\": \"debit\",\n \"amount\": \"89.23\",\n \"tag_value_ids\": [\n \"tv_Ns6rRRLYVZPh4cVB7MDby5\"\n ]\n }\n ],\n \"external_id\": \"je-2023-11-07-001\"\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\": \"HomeDepot purchase\",\n \"datetime\": \"2023-11-07T05:31:56Z\",\n \"lines\": [\n {\n \"ledger_id\": \"ldg_Ns6rRRLYVZPh4cVB7MDby5\",\n \"description\": \"HomeDepot purchase\",\n \"debit_credit\": \"debit\",\n \"amount\": \"89.23\",\n \"tag_value_ids\": [\n \"tv_Ns6rRRLYVZPh4cVB7MDby5\"\n ]\n }\n ],\n \"external_id\": \"je-2023-11-07-001\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"business_id": "biz_Pk2fNFDd8wj7EFeLWJywc7",
"description": "HomeDepot purchase",
"clean_description": "HomeDepot purchase",
"datetime": "2023-11-07T05:31:56Z",
"is_reconciled": true,
"review_status": "bookkeeper_pending",
"basis": "both",
"id": "je_R2fAXCjqJPdpYata112zyW",
"transaction_id": "txn_WQMDNUHpBThYSNh4AprDBo",
"line_entries": [
{
"ledger_id": "ldg_Ns6rRRLYVZPh4cVB7MDby5",
"description": "HomeDepot purchase",
"debit_credit": "debit",
"amount": "89.23",
"id": "le_GA6EG2qFxA97NZHtxeLPUy",
"journal_entry_id": "je_R2fAXCjqJPdpYata112zyW",
"transaction_id": "txn_WQMDNUHpBThYSNh4AprDBo",
"tag_value_ids": [
"tv_Ns6rRRLYVZPh4cVB7MDby5"
]
}
],
"categorization_method": "manual",
"invoice_id": "inv_WQMDNUHpBThYSNh4AprDBo",
"external_id": "je-2023-11-07-001"
}
}{
"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
An optional external identifier for the Journal Entry
Maximum string length:
255Example:
"je-2023-11-07-001"
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": "HomeDepot purchase",
"datetime": "2023-11-07T05:31:56Z",
"lines": [
{
"ledger_id": "ldg_Ns6rRRLYVZPh4cVB7MDby5",
"description": "HomeDepot purchase",
"debit_credit": "debit",
"amount": "89.23",
"tag_value_ids": [
"tv_Ns6rRRLYVZPh4cVB7MDby5"
]
}
],
"external_id": "je-2023-11-07-001"
}
'import requests
url = "https://api.sandbox.getasset.com/v0/business/{business_id}/journal-entries"
payload = {
"description": "HomeDepot purchase",
"datetime": "2023-11-07T05:31:56Z",
"lines": [
{
"ledger_id": "ldg_Ns6rRRLYVZPh4cVB7MDby5",
"description": "HomeDepot purchase",
"debit_credit": "debit",
"amount": "89.23",
"tag_value_ids": ["tv_Ns6rRRLYVZPh4cVB7MDby5"]
}
],
"external_id": "je-2023-11-07-001"
}
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: 'HomeDepot purchase',
datetime: '2023-11-07T05:31:56Z',
lines: [
{
ledger_id: 'ldg_Ns6rRRLYVZPh4cVB7MDby5',
description: 'HomeDepot purchase',
debit_credit: 'debit',
amount: '89.23',
tag_value_ids: ['tv_Ns6rRRLYVZPh4cVB7MDby5']
}
],
external_id: 'je-2023-11-07-001'
})
};
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' => 'HomeDepot purchase',
'datetime' => '2023-11-07T05:31:56Z',
'lines' => [
[
'ledger_id' => 'ldg_Ns6rRRLYVZPh4cVB7MDby5',
'description' => 'HomeDepot purchase',
'debit_credit' => 'debit',
'amount' => '89.23',
'tag_value_ids' => [
'tv_Ns6rRRLYVZPh4cVB7MDby5'
]
]
],
'external_id' => 'je-2023-11-07-001'
]),
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\": \"HomeDepot purchase\",\n \"datetime\": \"2023-11-07T05:31:56Z\",\n \"lines\": [\n {\n \"ledger_id\": \"ldg_Ns6rRRLYVZPh4cVB7MDby5\",\n \"description\": \"HomeDepot purchase\",\n \"debit_credit\": \"debit\",\n \"amount\": \"89.23\",\n \"tag_value_ids\": [\n \"tv_Ns6rRRLYVZPh4cVB7MDby5\"\n ]\n }\n ],\n \"external_id\": \"je-2023-11-07-001\"\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\": \"HomeDepot purchase\",\n \"datetime\": \"2023-11-07T05:31:56Z\",\n \"lines\": [\n {\n \"ledger_id\": \"ldg_Ns6rRRLYVZPh4cVB7MDby5\",\n \"description\": \"HomeDepot purchase\",\n \"debit_credit\": \"debit\",\n \"amount\": \"89.23\",\n \"tag_value_ids\": [\n \"tv_Ns6rRRLYVZPh4cVB7MDby5\"\n ]\n }\n ],\n \"external_id\": \"je-2023-11-07-001\"\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\": \"HomeDepot purchase\",\n \"datetime\": \"2023-11-07T05:31:56Z\",\n \"lines\": [\n {\n \"ledger_id\": \"ldg_Ns6rRRLYVZPh4cVB7MDby5\",\n \"description\": \"HomeDepot purchase\",\n \"debit_credit\": \"debit\",\n \"amount\": \"89.23\",\n \"tag_value_ids\": [\n \"tv_Ns6rRRLYVZPh4cVB7MDby5\"\n ]\n }\n ],\n \"external_id\": \"je-2023-11-07-001\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"business_id": "biz_Pk2fNFDd8wj7EFeLWJywc7",
"description": "HomeDepot purchase",
"clean_description": "HomeDepot purchase",
"datetime": "2023-11-07T05:31:56Z",
"is_reconciled": true,
"review_status": "bookkeeper_pending",
"basis": "both",
"id": "je_R2fAXCjqJPdpYata112zyW",
"transaction_id": "txn_WQMDNUHpBThYSNh4AprDBo",
"line_entries": [
{
"ledger_id": "ldg_Ns6rRRLYVZPh4cVB7MDby5",
"description": "HomeDepot purchase",
"debit_credit": "debit",
"amount": "89.23",
"id": "le_GA6EG2qFxA97NZHtxeLPUy",
"journal_entry_id": "je_R2fAXCjqJPdpYata112zyW",
"transaction_id": "txn_WQMDNUHpBThYSNh4AprDBo",
"tag_value_ids": [
"tv_Ns6rRRLYVZPh4cVB7MDby5"
]
}
],
"categorization_method": "manual",
"invoice_id": "inv_WQMDNUHpBThYSNh4AprDBo",
"external_id": "je-2023-11-07-001"
}
}{
"error": "<string>",
"data": "<unknown>"
}{
"error": "<string>",
"data": "<unknown>"
}{
"error": "<string>",
"data": "<unknown>"
}{
"error": "<string>",
"data": "<unknown>"
}{
"error": "<string>",
"data": "<unknown>"
}