Update a fixed asset

Operation ID: updateFixedAsset

Group: Accounting › Asset Management › Fixed Assets

Open in the interactive reference

PATCH /fixed-assets/{id}

Retry-safe: A write that accepts Idempotency-Key: repeating a request with the same key replays the stored answer instead of executing twice.

Updates a fixed asset, the same as editing it in Lensing. Send only the fields you want to change. A field you leave out keeps its value, and a field you send with its current value is not a change. The input is the item of GET fixed-assets/:id minus the fields the server owns: fixedAssetNumber, fixedAssetStatus, companyAssetId, assetNumber, typeName, depreciationStatus, depreciableAmount, depreciatedAmount, initialDepreciatedAmount, remainingValue, lastModifiedDate and sources. Sending one of those is rejected with HTTP 400 and no code (unexpected property), so remove them before you send a GET body back.

Once depreciation has started for the fixed asset (its depreciation schedule is no longer 'NotStarted'), the fields the schedule is calculated from cannot be changed: entityId, bookId, currency, typeId, depreciationMethod, depreciationInterval, depreciationConvention, acquisitionValueAmount, salvageValueAmount, degressionRate, inServiceDate and acquisitionDate. Changing one fails with FIELDS_LOCKED_DEPRECIATION_STARTED. A fixed asset created from a journal entry line keeps the line's entityId, bookId, currency, acquisitionValueAmount and acquisitionDate; changing one fails with FIELDS_LOCKED_BY_SOURCE. A fixed asset registered with POST fixed-assets from a journal entry line, or from a draft made from lines, has a source, so these fields are locked for it.

While depreciation has not started, changing a field the schedule is calculated from recalculates the depreciation schedule. A fixed asset imported part-way through its life keeps the start date its schedule was imported with. Changing depreciationMethod to 'Bypassed' while the fixed asset has a depreciation schedule fails with DEPRECIATION_METHOD_CHANGE_NOT_ALLOWED, and the schedule is kept: the API never deletes one.

The name, serial number, asset tag, asset status, department and business unit can be changed at any time. After depreciation has started, a department or business unit change applies to the periods not yet recorded; recorded depreciation keeps the department and business unit it was recorded with.

When you change typeId and leave out depreciationConvention, the fixed asset takes the convention of the new type's depreciation policy. When you change depreciationMethod, a convention the new method does not accept is replaced by the method's default.

Every error code declared for this endpoint is returned with HTTP status 400; branch on the code. A request turned away before the action runs carries no code: 401 when the credentials are missing or invalid, 403 when the access token does not hold this endpoint's permission task, and 400 when the body does not match the input schema, for example an unexpected property. The Api-Version header is required: a missing or empty header, or one that names no published version, fails with 400, and a route that does not exist in the version it names fails with 404.

Parameters

Name In Type Required Description
Api-Version header string · v1 yes The API version this request targets, named by its public identifier. Required on every request; omitting it, or naming a version this company does not have, is answered with 400. This document describes version v1.
Idempotency-Key header string no An opaque caller-chosen string (1-255 characters) that makes this request safe to retry. Repeating the same key with an identical request body replays the original response instead of re-executing - but only once that original request succeeded; a failed attempt re-executes on retry. Repeating the key with a different body is answered with 422. A key still in flight is answered with 409 - as is a key whose original request was interrupted before it finished, for a few minutes afterwards, until that attempt is presumed dead. A completed response stays replayable for 24 hours. The key is scoped to the caller, not to the action: reusing it for a different action is answered with 409 or 422 rather than treated independently. On read actions this header is ignored. On write actions that cannot offer the guarantee it is answered with 400 IDEMPOTENCY_NOT_SUPPORTED rather than silently ignored.
id path string yes The unique identifier of the fixed asset to update. Example: "9d5b1f42-7c30-4e88-b1a6-2f0c7e34d915".

Request body

Required, application/json: updateFixedAssetInput.

Field Type Required Description
name string no The name of the asset. Omit to leave unchanged. A blank name is refused with FIELD_REQUIRED. Example: "Forklift - Warehouse 3".
entityId string no The legal entity that owns the asset. See id on GET base/entities. Omit to leave unchanged. Locked once depreciation has started, and for a fixed asset created from a journal entry line.
assetStatus string no The physical status of the asset. Accepted values: 'available', 'broken', 'inRepair', 'inUse'. Omit to leave unchanged. 'retired' and 'disposed' are set by disposing of the asset; the status of a retired or disposed asset cannot be changed.
serialNumber string no The serial number of the asset. Free text. Omit to leave unchanged; send an empty string to clear it.
assetTag string no The asset tag of the asset. Free text. Omit to leave unchanged; send an empty string to clear it.
acquisitionDate date no The date the asset was acquired. Format YYYY-MM-DD. Omit to leave unchanged. Locked once depreciation has started, and for a fixed asset created from a journal entry line.
departmentId string no The department the asset is assigned to. See id on GET people/departments/:id. Omit to leave unchanged; send an empty string to clear it. Example: "5c8a2b70-1e94-4f37-8d06-b3e75f1290ac".
businessUnitId string no The business unit the asset is assigned to. Omit to leave unchanged; send an empty string to clear it.
typeId string no The type of the fixed asset. See id on GET fixed-asset-types/:id. Omit to leave unchanged. Locked once depreciation has started.
bookId string no The accounting book the fixed asset is recorded in. See id on GET accounting/books/:id. Omit to leave unchanged. Locked once depreciation has started, and for a fixed asset created from a journal entry line.
currency string no The currency of the fixed asset. It governs acquisitionValueAmount and salvageValueAmount. Format: ISO 4217, for example 'EUR'. Omit to leave unchanged. Locked once depreciation has started, and for a fixed asset created from a journal entry line.
inServiceDate date no The date the asset was placed in service. Format YYYY-MM-DD. Omit to leave unchanged. Locked once depreciation has started.
depreciationMethod string no The depreciation method. Accepted values: 'StraightLine', 'Degressive', 'Immediate', 'Bypassed'. Omit to leave unchanged. Locked once depreciation has started. A fixed asset depreciated with 'Immediate' cannot change to another method.
depreciationInterval string no The interval at which depreciation is recorded. Accepted values: 'Monthly', 'Quarterly', 'Yearly'. Omit to leave unchanged. Locked once depreciation has started.
depreciationConvention string no How the depreciation method treats time. Accepted values: 'FullMonth', 'MidMonth', 'MidYear', 'SixMonthRule', 'ProrateFirstLast', 'ActualDays'. Omit to leave unchanged, or to let a type or method change pick it. Locked once depreciation has started.
degressionRate decimal no The yearly rate of declining-balance depreciation, as a decimal fraction. For example, 0.2 is 20%. Must be greater than 0 and at most 1, or the request fails with INVALID_FIELD_VALUE. Only for the 'Degressive' method. Omit to leave unchanged; it is cleared when the method changes away from 'Degressive'. Locked once depreciation has started.
acquisitionValueAmount decimal no The value the fixed asset is capitalized at, in the fixed asset's currency (see currency). Omit to leave unchanged. Locked once depreciation has started, and for a fixed asset created from a journal entry line.
acquisitionValueCurrency string no The currency of acquisitionValueAmount. Optional; when sent it must equal the fixed asset's currency, or the request fails with CURRENCY_MISMATCH.
salvageValueAmount decimal no The value the asset is expected to have at the end of its useful life, in the fixed asset's currency (see currency). Omit to leave unchanged; send 0 for none. Must be at least 0 and at most the acquisition value, or the request fails with INVALID_FIELD_VALUE. Locked once depreciation has started.
salvageValueCurrency string no The currency of salvageValueAmount. Optional; when sent it must equal the fixed asset's currency, or the request fails with CURRENCY_MISMATCH.
{}

Response

200 Success

{
  "data": {},
  "diagnostics": [
    {
      "code": "<code>",
      "message": "<message>",
      "severity": "error",
      "path": [
        "<path>"
      ],
      "details": "<details>"
    }
  ]
}

Response headers

Errors

Code Status
NOT_FOUND 400
FIXED_ASSET_VOIDED 400
REFERENCED_RECORD_NOT_FOUND 400
INVALID_FIELD_VALUE 400
FIELD_REQUIRED 400
FIELD_NOT_APPLICABLE 400
CURRENCY_MISMATCH 400
ASSET_STATUS_NOT_ALLOWED 400
FIELDS_LOCKED_DEPRECIATION_STARTED 400
FIELDS_LOCKED_BY_SOURCE 400
DEPRECIATION_METHOD_CHANGE_NOT_ALLOWED 400
BOOK_NOT_ENABLED_FOR_ENTITY 400
BOOK_ALREADY_USED 400
FIXED_ASSET_TYPE_NOT_ASSOCIATED_WITH_BOOK 400
DEPRECIATION_POLICY_NOT_FOUND 400
UNSUPPORTED_DEPRECIATION_CONVENTION 400
VENDOR_TAG_NOT_EDITABLE 400
VALIDATION_FAILED 400
IDEMPOTENCY_KEY_CONFLICT 409
IDEMPOTENCY_PAYLOAD_MISMATCH 422

Statuses