curl --request POST \
--url https://sandbox.layerfi.com/v1/businesses/{businessId}/assets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Forklift",
"asset_type": "EQUIPMENT",
"original_value": 100000,
"useful_life_months": 60,
"accumulated_depreciation_account": "ACCUMULATED_DEPRECIATION"
}
'import requests
url = "https://sandbox.layerfi.com/v1/businesses/{businessId}/assets"
payload = {
"name": "Forklift",
"asset_type": "EQUIPMENT",
"original_value": 100000,
"useful_life_months": 60,
"accumulated_depreciation_account": "ACCUMULATED_DEPRECIATION"
}
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({
name: 'Forklift',
asset_type: 'EQUIPMENT',
original_value: 100000,
useful_life_months: 60,
accumulated_depreciation_account: 'ACCUMULATED_DEPRECIATION'
})
};
fetch('https://sandbox.layerfi.com/v1/businesses/{businessId}/assets', 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",
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([
'name' => 'Forklift',
'asset_type' => 'EQUIPMENT',
'original_value' => 100000,
'useful_life_months' => 60,
'accumulated_depreciation_account' => 'ACCUMULATED_DEPRECIATION'
]),
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"
payload := strings.NewReader("{\n \"name\": \"Forklift\",\n \"asset_type\": \"EQUIPMENT\",\n \"original_value\": 100000,\n \"useful_life_months\": 60,\n \"accumulated_depreciation_account\": \"ACCUMULATED_DEPRECIATION\"\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://sandbox.layerfi.com/v1/businesses/{businessId}/assets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Forklift\",\n \"asset_type\": \"EQUIPMENT\",\n \"original_value\": 100000,\n \"useful_life_months\": 60,\n \"accumulated_depreciation_account\": \"ACCUMULATED_DEPRECIATION\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.layerfi.com/v1/businesses/{businessId}/assets")
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 \"name\": \"Forklift\",\n \"asset_type\": \"EQUIPMENT\",\n \"original_value\": 100000,\n \"useful_life_months\": 60,\n \"accumulated_depreciation_account\": \"ACCUMULATED_DEPRECIATION\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"business_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"asset_type": "EQUIPMENT",
"ledger_account": {
"type": "Single_Chart_Account",
"id": {
"type": "AccountId",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"name": "Current Assets",
"account_number": "4000",
"stable_name": {
"type": "StableName",
"stable_name": "CURRENT_ASSETS"
},
"normality": "DEBIT",
"account_type": {
"value": "ASSET",
"display_name": "Asset"
},
"account_subtype": {
"value": "BANK_ACCOUNTS",
"display_name": "Current Assets"
}
},
"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>",
"accumulated_depreciation_account": {
"type": "Single_Chart_Account",
"id": {
"type": "AccountId",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"name": "Current Assets",
"account_number": "4000",
"stable_name": {
"type": "StableName",
"stable_name": "CURRENT_ASSETS"
},
"normality": "DEBIT",
"account_type": {
"value": "ASSET",
"display_name": "Asset"
},
"account_subtype": {
"value": "BANK_ACCOUNTS",
"display_name": "Current Assets"
}
},
"original_value": 123,
"salvage_value": 123,
"useful_life_months": 123,
"opening_balance": {
"type": "Opening_Balance",
"external_account_external_id": "0Br385JmgbTryJn8nEBnUb4A5ydv06U9Vbqqq",
"external_account_source": "PLAID",
"balance": 432100,
"effective_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "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"
}
],
"memo": "<string>",
"metadata": {
"custom_field": "value",
"any valid json": "below 1kb",
"nested": {
"meaning of life": 42,
"array": []
}
},
"reference_number": "<string>"
},
"archived_at": "2023-11-07T05:31:56Z",
"memo": "<string>",
"metadata": {},
"reference_number": "<string>"
}
}Create an asset
Creates a fixed asset for the specified business, or upserts an existing one: if an asset with the same external_id already exists it is updated in place. A dedicated ledger account is created for new assets.
curl --request POST \
--url https://sandbox.layerfi.com/v1/businesses/{businessId}/assets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Forklift",
"asset_type": "EQUIPMENT",
"original_value": 100000,
"useful_life_months": 60,
"accumulated_depreciation_account": "ACCUMULATED_DEPRECIATION"
}
'import requests
url = "https://sandbox.layerfi.com/v1/businesses/{businessId}/assets"
payload = {
"name": "Forklift",
"asset_type": "EQUIPMENT",
"original_value": 100000,
"useful_life_months": 60,
"accumulated_depreciation_account": "ACCUMULATED_DEPRECIATION"
}
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({
name: 'Forklift',
asset_type: 'EQUIPMENT',
original_value: 100000,
useful_life_months: 60,
accumulated_depreciation_account: 'ACCUMULATED_DEPRECIATION'
})
};
fetch('https://sandbox.layerfi.com/v1/businesses/{businessId}/assets', 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",
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([
'name' => 'Forklift',
'asset_type' => 'EQUIPMENT',
'original_value' => 100000,
'useful_life_months' => 60,
'accumulated_depreciation_account' => 'ACCUMULATED_DEPRECIATION'
]),
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"
payload := strings.NewReader("{\n \"name\": \"Forklift\",\n \"asset_type\": \"EQUIPMENT\",\n \"original_value\": 100000,\n \"useful_life_months\": 60,\n \"accumulated_depreciation_account\": \"ACCUMULATED_DEPRECIATION\"\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://sandbox.layerfi.com/v1/businesses/{businessId}/assets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Forklift\",\n \"asset_type\": \"EQUIPMENT\",\n \"original_value\": 100000,\n \"useful_life_months\": 60,\n \"accumulated_depreciation_account\": \"ACCUMULATED_DEPRECIATION\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.layerfi.com/v1/businesses/{businessId}/assets")
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 \"name\": \"Forklift\",\n \"asset_type\": \"EQUIPMENT\",\n \"original_value\": 100000,\n \"useful_life_months\": 60,\n \"accumulated_depreciation_account\": \"ACCUMULATED_DEPRECIATION\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"business_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"asset_type": "EQUIPMENT",
"ledger_account": {
"type": "Single_Chart_Account",
"id": {
"type": "AccountId",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"name": "Current Assets",
"account_number": "4000",
"stable_name": {
"type": "StableName",
"stable_name": "CURRENT_ASSETS"
},
"normality": "DEBIT",
"account_type": {
"value": "ASSET",
"display_name": "Asset"
},
"account_subtype": {
"value": "BANK_ACCOUNTS",
"display_name": "Current Assets"
}
},
"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>",
"accumulated_depreciation_account": {
"type": "Single_Chart_Account",
"id": {
"type": "AccountId",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"name": "Current Assets",
"account_number": "4000",
"stable_name": {
"type": "StableName",
"stable_name": "CURRENT_ASSETS"
},
"normality": "DEBIT",
"account_type": {
"value": "ASSET",
"display_name": "Asset"
},
"account_subtype": {
"value": "BANK_ACCOUNTS",
"display_name": "Current Assets"
}
},
"original_value": 123,
"salvage_value": 123,
"useful_life_months": 123,
"opening_balance": {
"type": "Opening_Balance",
"external_account_external_id": "0Br385JmgbTryJn8nEBnUb4A5ydv06U9Vbqqq",
"external_account_source": "PLAID",
"balance": 432100,
"effective_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "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"
}
],
"memo": "<string>",
"metadata": {
"custom_field": "value",
"any valid json": "below 1kb",
"nested": {
"meaning of life": 42,
"array": []
}
},
"reference_number": "<string>"
},
"archived_at": "2023-11-07T05:31:56Z",
"memo": "<string>",
"metadata": {},
"reference_number": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The UUID of the business.
Body
The asset to create.
Parameters for creating a fixed asset. Creates a dedicated ledger account for the asset under the parent account (defaults to Fixed Assets).
Name of the asset.
The type of fixed asset.
RIGHT_OF_USE_ASSET, VEHICLE, EQUIPMENT, GOODWILL "EQUIPMENT"
Unique ID of the asset in your system for linking purposes. Creating an asset with an external_id that already exists upserts the existing asset.
Parent ledger account under which the asset's dedicated account is created. Defaults to Fixed Assets.
- Account ID
- Account Stable Name
Show child attributes
Show child attributes
Accumulated depreciation account for the asset. Required before recording DEPRECIATION_AMORTIZATION value updates.
- Account ID
- Account Stable Name
Show child attributes
Show child attributes
Original purchase value, in cents.
Estimated salvage (residual) value, in cents.
Useful life of the asset, in months.
Opening balance for the asset, posted against Opening Balance Equity. Omit if the asset has no opening balance.
Show child attributes
Show child attributes
Internal note about the asset.
Arbitrary JSON object you can attach for your own use. Layer stores and returns it unchanged.
Reference number for the asset.
Response
Asset created successfully.
A fixed asset held by a business. Each asset has a dedicated ledger account.
Show child attributes
Show child attributes