Bulk Create Journal Entries
Create up to 100 Journal Entries in one request. An entry that cannot be
created is reported in errors, by its external_id and its position in
the submitted list, and does not stop the rest of the batch from being
created.
Scopes: journal_entry:create
curl --request POST \
--url https://api.sandbox.getasset.com/v0/business/{business_id}/journal-entries/bulk \
--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",
"document_id": "doc_R2fAXCjqJPdpYata112zyW",
"tags": {
"Department": "Engineering",
"Location": "NYC"
}
}
]
'import requests
url = "https://api.sandbox.getasset.com/v0/business/{business_id}/journal-entries/bulk"
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",
"document_id": "doc_R2fAXCjqJPdpYata112zyW",
"tags": {
"Department": "Engineering",
"Location": "NYC"
}
}
]
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',
document_id: 'doc_R2fAXCjqJPdpYata112zyW',
tags: {Department: 'Engineering', Location: 'NYC'}
}
])
};
fetch('https://api.sandbox.getasset.com/v0/business/{business_id}/journal-entries/bulk', 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/bulk",
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',
'document_id' => 'doc_R2fAXCjqJPdpYata112zyW',
'tags' => [
'Department' => 'Engineering',
'Location' => 'NYC'
]
]
]),
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/bulk"
payload := strings.NewReader("[\n {\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 \"document_id\": \"doc_R2fAXCjqJPdpYata112zyW\",\n \"tags\": {\n \"Department\": \"Engineering\",\n \"Location\": \"NYC\"\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/bulk")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("[\n {\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 \"document_id\": \"doc_R2fAXCjqJPdpYata112zyW\",\n \"tags\": {\n \"Department\": \"Engineering\",\n \"Location\": \"NYC\"\n }\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.getasset.com/v0/business/{business_id}/journal-entries/bulk")
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 {\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 \"document_id\": \"doc_R2fAXCjqJPdpYata112zyW\",\n \"tags\": {\n \"Department\": \"Engineering\",\n \"Location\": \"NYC\"\n }\n }\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",
"bill_id": "bil_WQMDNUHpBThYSNh4AprDBo",
"external_id": "je-2023-11-07-001",
"tags": {
"Location": [
{
"amount": "75.00",
"value": "NYC"
},
{
"amount": "25.00",
"value": "LA"
}
]
}
}
],
"errors": [
{
"error": "Lines do not balance",
"external_id": "je-2023-11-07-001",
"index": 3
}
]
}{
"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.
Scopes
Headers
Optional external entity identifier that performed the action
Path Parameters
The id of the business
"biz_GA6EG2qFxA97NZHtxeLPUy"
Body
100The description of the Journal Entry
"HomeDepot purchase"
The datetime the Journal Entry was created in UTC ISO-8601 format
"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
255"je-2023-11-07-001"
An optional Document to associate the Journal Entry with
"doc_R2fAXCjqJPdpYata112zyW"
Tags to apply to the Journal Entry, keyed by tag field name (the field must already exist). Each value is a tag value string, or a list of {value, amount?, ledger_id?} objects to split the amount across values and optionally pin a value to a ledger. Amounts left out are split evenly across the values. Tags apply to the net amount of the Journal Entry's revenue and expense lines. Supplying tags replaces any tags carried by the lines' tag_value_ids.
Show child attributes
Show child attributes
{
"Department": "Engineering",
"Location": "NYC"
}
curl --request POST \
--url https://api.sandbox.getasset.com/v0/business/{business_id}/journal-entries/bulk \
--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",
"document_id": "doc_R2fAXCjqJPdpYata112zyW",
"tags": {
"Department": "Engineering",
"Location": "NYC"
}
}
]
'import requests
url = "https://api.sandbox.getasset.com/v0/business/{business_id}/journal-entries/bulk"
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",
"document_id": "doc_R2fAXCjqJPdpYata112zyW",
"tags": {
"Department": "Engineering",
"Location": "NYC"
}
}
]
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',
document_id: 'doc_R2fAXCjqJPdpYata112zyW',
tags: {Department: 'Engineering', Location: 'NYC'}
}
])
};
fetch('https://api.sandbox.getasset.com/v0/business/{business_id}/journal-entries/bulk', 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/bulk",
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',
'document_id' => 'doc_R2fAXCjqJPdpYata112zyW',
'tags' => [
'Department' => 'Engineering',
'Location' => 'NYC'
]
]
]),
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/bulk"
payload := strings.NewReader("[\n {\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 \"document_id\": \"doc_R2fAXCjqJPdpYata112zyW\",\n \"tags\": {\n \"Department\": \"Engineering\",\n \"Location\": \"NYC\"\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/bulk")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("[\n {\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 \"document_id\": \"doc_R2fAXCjqJPdpYata112zyW\",\n \"tags\": {\n \"Department\": \"Engineering\",\n \"Location\": \"NYC\"\n }\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.getasset.com/v0/business/{business_id}/journal-entries/bulk")
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 {\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 \"document_id\": \"doc_R2fAXCjqJPdpYata112zyW\",\n \"tags\": {\n \"Department\": \"Engineering\",\n \"Location\": \"NYC\"\n }\n }\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",
"bill_id": "bil_WQMDNUHpBThYSNh4AprDBo",
"external_id": "je-2023-11-07-001",
"tags": {
"Location": [
{
"amount": "75.00",
"value": "NYC"
},
{
"amount": "25.00",
"value": "LA"
}
]
}
}
],
"errors": [
{
"error": "Lines do not balance",
"external_id": "je-2023-11-07-001",
"index": 3
}
]
}{
"error": "<string>",
"data": "<unknown>"
}{
"error": "<string>",
"data": "<unknown>"
}{
"error": "<string>",
"data": "<unknown>"
}{
"error": "<string>",
"data": "<unknown>"
}{
"error": "<string>",
"data": "<unknown>"
}