Create fixed asset class
curl --request POST \
--url https://api.dualentry.com/public/v1/fixed-asset-classes/ \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"name": "<string>",
"status": "active",
"company_id": 123,
"asset_account_id": 123,
"expense_account_id": 123,
"accumulation_account_id": 123,
"book_defaults": [
{
"depreciation_book_id": 123,
"useful_life": 123,
"depreciation_frequency": "monthly",
"salvage_value": 123,
"acceleration_factor": 123,
"custom_schedule": [
{
"value": 123,
"period_count": 123
}
]
}
]
}
'import requests
url = "https://api.dualentry.com/public/v1/fixed-asset-classes/"
payload = {
"name": "<string>",
"status": "active",
"company_id": 123,
"asset_account_id": 123,
"expense_account_id": 123,
"accumulation_account_id": 123,
"book_defaults": [
{
"depreciation_book_id": 123,
"useful_life": 123,
"depreciation_frequency": "monthly",
"salvage_value": 123,
"acceleration_factor": 123,
"custom_schedule": [
{
"value": 123,
"period_count": 123
}
]
}
]
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
status: 'active',
company_id: 123,
asset_account_id: 123,
expense_account_id: 123,
accumulation_account_id: 123,
book_defaults: [
{
depreciation_book_id: 123,
useful_life: 123,
depreciation_frequency: 'monthly',
salvage_value: 123,
acceleration_factor: 123,
custom_schedule: [{value: 123, period_count: 123}]
}
]
})
};
fetch('https://api.dualentry.com/public/v1/fixed-asset-classes/', 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.dualentry.com/public/v1/fixed-asset-classes/",
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' => '<string>',
'status' => 'active',
'company_id' => 123,
'asset_account_id' => 123,
'expense_account_id' => 123,
'accumulation_account_id' => 123,
'book_defaults' => [
[
'depreciation_book_id' => 123,
'useful_life' => 123,
'depreciation_frequency' => 'monthly',
'salvage_value' => 123,
'acceleration_factor' => 123,
'custom_schedule' => [
[
'value' => 123,
'period_count' => 123
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$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.dualentry.com/public/v1/fixed-asset-classes/"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"status\": \"active\",\n \"company_id\": 123,\n \"asset_account_id\": 123,\n \"expense_account_id\": 123,\n \"accumulation_account_id\": 123,\n \"book_defaults\": [\n {\n \"depreciation_book_id\": 123,\n \"useful_life\": 123,\n \"depreciation_frequency\": \"monthly\",\n \"salvage_value\": 123,\n \"acceleration_factor\": 123,\n \"custom_schedule\": [\n {\n \"value\": 123,\n \"period_count\": 123\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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.dualentry.com/public/v1/fixed-asset-classes/")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"status\": \"active\",\n \"company_id\": 123,\n \"asset_account_id\": 123,\n \"expense_account_id\": 123,\n \"accumulation_account_id\": 123,\n \"book_defaults\": [\n {\n \"depreciation_book_id\": 123,\n \"useful_life\": 123,\n \"depreciation_frequency\": \"monthly\",\n \"salvage_value\": 123,\n \"acceleration_factor\": 123,\n \"custom_schedule\": [\n {\n \"value\": 123,\n \"period_count\": 123\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dualentry.com/public/v1/fixed-asset-classes/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"status\": \"active\",\n \"company_id\": 123,\n \"asset_account_id\": 123,\n \"expense_account_id\": 123,\n \"accumulation_account_id\": 123,\n \"book_defaults\": [\n {\n \"depreciation_book_id\": 123,\n \"useful_life\": 123,\n \"depreciation_frequency\": \"monthly\",\n \"salvage_value\": 123,\n \"acceleration_factor\": 123,\n \"custom_schedule\": [\n {\n \"value\": 123,\n \"period_count\": 123\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"name": "<string>",
"status": "<string>",
"book_defaults": [
{
"id": 123,
"depreciation_book_id": 123,
"useful_life": 123,
"depreciation_method": "straight_line",
"depreciation_frequency": "monthly",
"convention": "mid_month",
"salvage_value": "<string>",
"acceleration_factor": "<string>",
"property_class": 3,
"ads_recovery_period": 3,
"custom_schedule": [
{
"value": "<string>",
"period_count": 123
}
],
"custom_schedule_type": "cost_percentage"
}
],
"company_id": 123,
"asset_account_id": 123,
"expense_account_id": 123,
"accumulation_account_id": 123
}{
"errors": {},
"success": false,
"error_code": "<string>",
"error_reason": "<string>"
}Fixed Asset Classes
Create fixed asset class (v1)
Create a fixed asset class.
POST
/
public
/
v1
/
fixed-asset-classes
/
Create fixed asset class
curl --request POST \
--url https://api.dualentry.com/public/v1/fixed-asset-classes/ \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"name": "<string>",
"status": "active",
"company_id": 123,
"asset_account_id": 123,
"expense_account_id": 123,
"accumulation_account_id": 123,
"book_defaults": [
{
"depreciation_book_id": 123,
"useful_life": 123,
"depreciation_frequency": "monthly",
"salvage_value": 123,
"acceleration_factor": 123,
"custom_schedule": [
{
"value": 123,
"period_count": 123
}
]
}
]
}
'import requests
url = "https://api.dualentry.com/public/v1/fixed-asset-classes/"
payload = {
"name": "<string>",
"status": "active",
"company_id": 123,
"asset_account_id": 123,
"expense_account_id": 123,
"accumulation_account_id": 123,
"book_defaults": [
{
"depreciation_book_id": 123,
"useful_life": 123,
"depreciation_frequency": "monthly",
"salvage_value": 123,
"acceleration_factor": 123,
"custom_schedule": [
{
"value": 123,
"period_count": 123
}
]
}
]
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
status: 'active',
company_id: 123,
asset_account_id: 123,
expense_account_id: 123,
accumulation_account_id: 123,
book_defaults: [
{
depreciation_book_id: 123,
useful_life: 123,
depreciation_frequency: 'monthly',
salvage_value: 123,
acceleration_factor: 123,
custom_schedule: [{value: 123, period_count: 123}]
}
]
})
};
fetch('https://api.dualentry.com/public/v1/fixed-asset-classes/', 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.dualentry.com/public/v1/fixed-asset-classes/",
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' => '<string>',
'status' => 'active',
'company_id' => 123,
'asset_account_id' => 123,
'expense_account_id' => 123,
'accumulation_account_id' => 123,
'book_defaults' => [
[
'depreciation_book_id' => 123,
'useful_life' => 123,
'depreciation_frequency' => 'monthly',
'salvage_value' => 123,
'acceleration_factor' => 123,
'custom_schedule' => [
[
'value' => 123,
'period_count' => 123
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$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.dualentry.com/public/v1/fixed-asset-classes/"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"status\": \"active\",\n \"company_id\": 123,\n \"asset_account_id\": 123,\n \"expense_account_id\": 123,\n \"accumulation_account_id\": 123,\n \"book_defaults\": [\n {\n \"depreciation_book_id\": 123,\n \"useful_life\": 123,\n \"depreciation_frequency\": \"monthly\",\n \"salvage_value\": 123,\n \"acceleration_factor\": 123,\n \"custom_schedule\": [\n {\n \"value\": 123,\n \"period_count\": 123\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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.dualentry.com/public/v1/fixed-asset-classes/")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"status\": \"active\",\n \"company_id\": 123,\n \"asset_account_id\": 123,\n \"expense_account_id\": 123,\n \"accumulation_account_id\": 123,\n \"book_defaults\": [\n {\n \"depreciation_book_id\": 123,\n \"useful_life\": 123,\n \"depreciation_frequency\": \"monthly\",\n \"salvage_value\": 123,\n \"acceleration_factor\": 123,\n \"custom_schedule\": [\n {\n \"value\": 123,\n \"period_count\": 123\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dualentry.com/public/v1/fixed-asset-classes/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"status\": \"active\",\n \"company_id\": 123,\n \"asset_account_id\": 123,\n \"expense_account_id\": 123,\n \"accumulation_account_id\": 123,\n \"book_defaults\": [\n {\n \"depreciation_book_id\": 123,\n \"useful_life\": 123,\n \"depreciation_frequency\": \"monthly\",\n \"salvage_value\": 123,\n \"acceleration_factor\": 123,\n \"custom_schedule\": [\n {\n \"value\": 123,\n \"period_count\": 123\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"name": "<string>",
"status": "<string>",
"book_defaults": [
{
"id": 123,
"depreciation_book_id": 123,
"useful_life": 123,
"depreciation_method": "straight_line",
"depreciation_frequency": "monthly",
"convention": "mid_month",
"salvage_value": "<string>",
"acceleration_factor": "<string>",
"property_class": 3,
"ads_recovery_period": 3,
"custom_schedule": [
{
"value": "<string>",
"period_count": 123
}
],
"custom_schedule_type": "cost_percentage"
}
],
"company_id": 123,
"asset_account_id": 123,
"expense_account_id": 123,
"accumulation_account_id": 123
}{
"errors": {},
"success": false,
"error_code": "<string>",
"error_reason": "<string>"
}Send the name, the asset account, the accumulated depreciation account, the expense account, and the book defaults. A book default sets the depreciation method and the useful life for one depreciation book.
Headers
Optional. A unique value (a UUID works well) identifying this operation. If the request is repeated with the same key, the original response is replayed instead of the operation running again, so a retry cannot create a duplicate record. Results are replayable for 48 hours. Reusing a key with a different request body returns 422.
Maximum string length:
255Body
application/json
Was this page helpful?