Update a Journal Entry
Scopes: journal_entry:update
curl --request PATCH \
--url https://api.sandbox.getasset.com/v0/business/{business_id}/journal-entries/{journal_entry_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "<string>",
"datetime": "2023-11-07T05:31:56Z",
"line_changes": {
"create_lines": [
{
"ledger_id": "ldg_Ns6rRRLYVZPh4cVB7MDby5",
"description": "HomeDepot purchase",
"debit_credit": "debit",
"amount": "89.23",
"tag_value_ids": [
"tv_Ns6rRRLYVZPh4cVB7MDby5"
]
}
],
"delete_lines": [
"<string>"
]
},
"is_reconciled": true,
"tags": {
"Department": "Engineering",
"Location": "NYC"
}
}
'import requests
url = "https://api.sandbox.getasset.com/v0/business/{business_id}/journal-entries/{journal_entry_id}"
payload = {
"description": "<string>",
"datetime": "2023-11-07T05:31:56Z",
"line_changes": {
"create_lines": [
{
"ledger_id": "ldg_Ns6rRRLYVZPh4cVB7MDby5",
"description": "HomeDepot purchase",
"debit_credit": "debit",
"amount": "89.23",
"tag_value_ids": ["tv_Ns6rRRLYVZPh4cVB7MDby5"]
}
],
"delete_lines": ["<string>"]
},
"is_reconciled": True,
"tags": {
"Department": "Engineering",
"Location": "NYC"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: '<string>',
datetime: '2023-11-07T05:31:56Z',
line_changes: {
create_lines: [
{
ledger_id: 'ldg_Ns6rRRLYVZPh4cVB7MDby5',
description: 'HomeDepot purchase',
debit_credit: 'debit',
amount: '89.23',
tag_value_ids: ['tv_Ns6rRRLYVZPh4cVB7MDby5']
}
],
delete_lines: ['<string>']
},
is_reconciled: true,
tags: {Department: 'Engineering', Location: 'NYC'}
})
};
fetch('https://api.sandbox.getasset.com/v0/business/{business_id}/journal-entries/{journal_entry_id}', 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/{journal_entry_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'description' => '<string>',
'datetime' => '2023-11-07T05:31:56Z',
'line_changes' => [
'create_lines' => [
[
'ledger_id' => 'ldg_Ns6rRRLYVZPh4cVB7MDby5',
'description' => 'HomeDepot purchase',
'debit_credit' => 'debit',
'amount' => '89.23',
'tag_value_ids' => [
'tv_Ns6rRRLYVZPh4cVB7MDby5'
]
]
],
'delete_lines' => [
'<string>'
]
],
'is_reconciled' => true,
'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/{journal_entry_id}"
payload := strings.NewReader("{\n \"description\": \"<string>\",\n \"datetime\": \"2023-11-07T05:31:56Z\",\n \"line_changes\": {\n \"create_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 \"delete_lines\": [\n \"<string>\"\n ]\n },\n \"is_reconciled\": true,\n \"tags\": {\n \"Department\": \"Engineering\",\n \"Location\": \"NYC\"\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.sandbox.getasset.com/v0/business/{business_id}/journal-entries/{journal_entry_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"<string>\",\n \"datetime\": \"2023-11-07T05:31:56Z\",\n \"line_changes\": {\n \"create_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 \"delete_lines\": [\n \"<string>\"\n ]\n },\n \"is_reconciled\": true,\n \"tags\": {\n \"Department\": \"Engineering\",\n \"Location\": \"NYC\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.getasset.com/v0/business/{business_id}/journal-entries/{journal_entry_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"<string>\",\n \"datetime\": \"2023-11-07T05:31:56Z\",\n \"line_changes\": {\n \"create_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 \"delete_lines\": [\n \"<string>\"\n ]\n },\n \"is_reconciled\": true,\n \"tags\": {\n \"Department\": \"Engineering\",\n \"Location\": \"NYC\"\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",
"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.
- Token URL
- /v0/auth/token
Headers
Optional external entity identifier that performed the update
Path Parameters
The id of the business
"biz_GA6EG2qFxA97NZHtxeLPUy"
The id of the journal entry
"je_R2fAXCjqJPdpYata112zyW"
Body
The description of the Journal Entry
The datetime the Journal Entry was created in UTC ISO-8601 format
An object with optional create and delete values that modify the
lines in the Journal Entry. To update a line, simply remove the old line and add a
new one.
Show child attributes
Show child attributes
The new status to set on the Journal Entry
bookkeeper_pending, business_pending, confirmed Whether the Journal Entry is reconciled
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. Supplying tags replaces all of the Journal Entry's tags; an empty object clears them. Only Journal Entries with no source transaction, invoice, or bill can be tagged this way.
Show child attributes
Show child attributes
{
"Department": "Engineering",
"Location": "NYC"
}
Response
Successful Response
Show child attributes
Show child attributes
curl --request PATCH \
--url https://api.sandbox.getasset.com/v0/business/{business_id}/journal-entries/{journal_entry_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "<string>",
"datetime": "2023-11-07T05:31:56Z",
"line_changes": {
"create_lines": [
{
"ledger_id": "ldg_Ns6rRRLYVZPh4cVB7MDby5",
"description": "HomeDepot purchase",
"debit_credit": "debit",
"amount": "89.23",
"tag_value_ids": [
"tv_Ns6rRRLYVZPh4cVB7MDby5"
]
}
],
"delete_lines": [
"<string>"
]
},
"is_reconciled": true,
"tags": {
"Department": "Engineering",
"Location": "NYC"
}
}
'import requests
url = "https://api.sandbox.getasset.com/v0/business/{business_id}/journal-entries/{journal_entry_id}"
payload = {
"description": "<string>",
"datetime": "2023-11-07T05:31:56Z",
"line_changes": {
"create_lines": [
{
"ledger_id": "ldg_Ns6rRRLYVZPh4cVB7MDby5",
"description": "HomeDepot purchase",
"debit_credit": "debit",
"amount": "89.23",
"tag_value_ids": ["tv_Ns6rRRLYVZPh4cVB7MDby5"]
}
],
"delete_lines": ["<string>"]
},
"is_reconciled": True,
"tags": {
"Department": "Engineering",
"Location": "NYC"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: '<string>',
datetime: '2023-11-07T05:31:56Z',
line_changes: {
create_lines: [
{
ledger_id: 'ldg_Ns6rRRLYVZPh4cVB7MDby5',
description: 'HomeDepot purchase',
debit_credit: 'debit',
amount: '89.23',
tag_value_ids: ['tv_Ns6rRRLYVZPh4cVB7MDby5']
}
],
delete_lines: ['<string>']
},
is_reconciled: true,
tags: {Department: 'Engineering', Location: 'NYC'}
})
};
fetch('https://api.sandbox.getasset.com/v0/business/{business_id}/journal-entries/{journal_entry_id}', 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/{journal_entry_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'description' => '<string>',
'datetime' => '2023-11-07T05:31:56Z',
'line_changes' => [
'create_lines' => [
[
'ledger_id' => 'ldg_Ns6rRRLYVZPh4cVB7MDby5',
'description' => 'HomeDepot purchase',
'debit_credit' => 'debit',
'amount' => '89.23',
'tag_value_ids' => [
'tv_Ns6rRRLYVZPh4cVB7MDby5'
]
]
],
'delete_lines' => [
'<string>'
]
],
'is_reconciled' => true,
'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/{journal_entry_id}"
payload := strings.NewReader("{\n \"description\": \"<string>\",\n \"datetime\": \"2023-11-07T05:31:56Z\",\n \"line_changes\": {\n \"create_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 \"delete_lines\": [\n \"<string>\"\n ]\n },\n \"is_reconciled\": true,\n \"tags\": {\n \"Department\": \"Engineering\",\n \"Location\": \"NYC\"\n }\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://api.sandbox.getasset.com/v0/business/{business_id}/journal-entries/{journal_entry_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"<string>\",\n \"datetime\": \"2023-11-07T05:31:56Z\",\n \"line_changes\": {\n \"create_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 \"delete_lines\": [\n \"<string>\"\n ]\n },\n \"is_reconciled\": true,\n \"tags\": {\n \"Department\": \"Engineering\",\n \"Location\": \"NYC\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.getasset.com/v0/business/{business_id}/journal-entries/{journal_entry_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"<string>\",\n \"datetime\": \"2023-11-07T05:31:56Z\",\n \"line_changes\": {\n \"create_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 \"delete_lines\": [\n \"<string>\"\n ]\n },\n \"is_reconciled\": true,\n \"tags\": {\n \"Department\": \"Engineering\",\n \"Location\": \"NYC\"\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",
"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>"
}