Create an asset
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>"
}
}Assets
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.
POST
/
v1
/
businesses
/
{businessId}
/
assets
Create an asset
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
Body
application/json
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).