Update an asset value update
curl --request PATCH \
--url https://sandbox.layerfi.com/v1/businesses/{businessId}/assets/value-updates/{valueUpdateId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 123,
"update_type": "DEPRECIATION_AMORTIZATION",
"counter_account": {
"type": "AccountId",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"date": "2023-11-07T05:31:56Z",
"memo": "<string>",
"metadata": {},
"reference_number": "<string>"
}
'import requests
url = "https://sandbox.layerfi.com/v1/businesses/{businessId}/assets/value-updates/{valueUpdateId}"
payload = {
"amount": 123,
"update_type": "DEPRECIATION_AMORTIZATION",
"counter_account": {
"type": "AccountId",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"date": "2023-11-07T05:31:56Z",
"memo": "<string>",
"metadata": {},
"reference_number": "<string>"
}
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({
amount: 123,
update_type: 'DEPRECIATION_AMORTIZATION',
counter_account: {type: 'AccountId', id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'},
date: '2023-11-07T05:31:56Z',
memo: '<string>',
metadata: {},
reference_number: '<string>'
})
};
fetch('https://sandbox.layerfi.com/v1/businesses/{businessId}/assets/value-updates/{valueUpdateId}', 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://sandbox.layerfi.com/v1/businesses/{businessId}/assets/value-updates/{valueUpdateId}",
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([
'amount' => 123,
'update_type' => 'DEPRECIATION_AMORTIZATION',
'counter_account' => [
'type' => 'AccountId',
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'date' => '2023-11-07T05:31:56Z',
'memo' => '<string>',
'metadata' => [
],
'reference_number' => '<string>'
]),
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://sandbox.layerfi.com/v1/businesses/{businessId}/assets/value-updates/{valueUpdateId}"
payload := strings.NewReader("{\n \"amount\": 123,\n \"update_type\": \"DEPRECIATION_AMORTIZATION\",\n \"counter_account\": {\n \"type\": \"AccountId\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"date\": \"2023-11-07T05:31:56Z\",\n \"memo\": \"<string>\",\n \"metadata\": {},\n \"reference_number\": \"<string>\"\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://sandbox.layerfi.com/v1/businesses/{businessId}/assets/value-updates/{valueUpdateId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 123,\n \"update_type\": \"DEPRECIATION_AMORTIZATION\",\n \"counter_account\": {\n \"type\": \"AccountId\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"date\": \"2023-11-07T05:31:56Z\",\n \"memo\": \"<string>\",\n \"metadata\": {},\n \"reference_number\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.layerfi.com/v1/businesses/{businessId}/assets/value-updates/{valueUpdateId}")
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 \"amount\": 123,\n \"update_type\": \"DEPRECIATION_AMORTIZATION\",\n \"counter_account\": {\n \"type\": \"AccountId\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"date\": \"2023-11-07T05:31:56Z\",\n \"memo\": \"<string>\",\n \"metadata\": {},\n \"reference_number\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"business_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 123,
"update_type": "DEPRECIATION_AMORTIZATION",
"date": "2023-11-07T05:31:56Z",
"transaction_tags": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "ExampleTagKey",
"value": "ExampleTagValue",
"dimension_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"definition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dimension_display_name": "<string>",
"value_display_name": "<string>",
"archived_at": "2023-11-07T05:31:56Z"
}
],
"external_id": "<string>",
"archived_at": "2023-11-07T05:31:56Z",
"memo": "<string>",
"metadata": {},
"reference_number": "<string>"
}
}Value Updates
Update an asset value update
Updates an asset value update. Changing the amount, type, account, or date re-posts the underlying journal entry.
PATCH
/
v1
/
businesses
/
{businessId}
/
assets
/
value-updates
/
{valueUpdateId}
Update an asset value update
curl --request PATCH \
--url https://sandbox.layerfi.com/v1/businesses/{businessId}/assets/value-updates/{valueUpdateId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 123,
"update_type": "DEPRECIATION_AMORTIZATION",
"counter_account": {
"type": "AccountId",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"date": "2023-11-07T05:31:56Z",
"memo": "<string>",
"metadata": {},
"reference_number": "<string>"
}
'import requests
url = "https://sandbox.layerfi.com/v1/businesses/{businessId}/assets/value-updates/{valueUpdateId}"
payload = {
"amount": 123,
"update_type": "DEPRECIATION_AMORTIZATION",
"counter_account": {
"type": "AccountId",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"date": "2023-11-07T05:31:56Z",
"memo": "<string>",
"metadata": {},
"reference_number": "<string>"
}
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({
amount: 123,
update_type: 'DEPRECIATION_AMORTIZATION',
counter_account: {type: 'AccountId', id: '3c90c3cc-0d44-4b50-8888-8dd25736052a'},
date: '2023-11-07T05:31:56Z',
memo: '<string>',
metadata: {},
reference_number: '<string>'
})
};
fetch('https://sandbox.layerfi.com/v1/businesses/{businessId}/assets/value-updates/{valueUpdateId}', 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://sandbox.layerfi.com/v1/businesses/{businessId}/assets/value-updates/{valueUpdateId}",
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([
'amount' => 123,
'update_type' => 'DEPRECIATION_AMORTIZATION',
'counter_account' => [
'type' => 'AccountId',
'id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'date' => '2023-11-07T05:31:56Z',
'memo' => '<string>',
'metadata' => [
],
'reference_number' => '<string>'
]),
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://sandbox.layerfi.com/v1/businesses/{businessId}/assets/value-updates/{valueUpdateId}"
payload := strings.NewReader("{\n \"amount\": 123,\n \"update_type\": \"DEPRECIATION_AMORTIZATION\",\n \"counter_account\": {\n \"type\": \"AccountId\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"date\": \"2023-11-07T05:31:56Z\",\n \"memo\": \"<string>\",\n \"metadata\": {},\n \"reference_number\": \"<string>\"\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://sandbox.layerfi.com/v1/businesses/{businessId}/assets/value-updates/{valueUpdateId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 123,\n \"update_type\": \"DEPRECIATION_AMORTIZATION\",\n \"counter_account\": {\n \"type\": \"AccountId\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"date\": \"2023-11-07T05:31:56Z\",\n \"memo\": \"<string>\",\n \"metadata\": {},\n \"reference_number\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.layerfi.com/v1/businesses/{businessId}/assets/value-updates/{valueUpdateId}")
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 \"amount\": 123,\n \"update_type\": \"DEPRECIATION_AMORTIZATION\",\n \"counter_account\": {\n \"type\": \"AccountId\",\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n },\n \"date\": \"2023-11-07T05:31:56Z\",\n \"memo\": \"<string>\",\n \"metadata\": {},\n \"reference_number\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"business_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"asset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"amount": 123,
"update_type": "DEPRECIATION_AMORTIZATION",
"date": "2023-11-07T05:31:56Z",
"transaction_tags": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"key": "ExampleTagKey",
"value": "ExampleTagValue",
"dimension_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"definition_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dimension_display_name": "<string>",
"value_display_name": "<string>",
"archived_at": "2023-11-07T05:31:56Z"
}
],
"external_id": "<string>",
"archived_at": "2023-11-07T05:31:56Z",
"memo": "<string>",
"metadata": {},
"reference_number": "<string>"
}
}Authorizations
Path Parameters
Body
application/json
The value update fields to update.
Parameters for updating an asset value update. Only include the fields you want to change. Changing the amount, type, account, or date re-posts the underlying journal entry.
The kind of value change applied to an asset. DEPRECIATION_AMORTIZATION, IMPAIRMENT, and REVALUATION_DOWN decrease the asset's carrying value; IMPROVEMENT and REVALUATION_UP increase it. DEPRECIATION_AMORTIZATION requires the asset to have an accumulated_depreciation_account configured.
Available options:
DEPRECIATION_AMORTIZATION, IMPROVEMENT, IMPAIRMENT, REVALUATION_UP, REVALUATION_DOWN Example:
"DEPRECIATION_AMORTIZATION"