# Register a fixed asset

Operation ID: `createFixedAsset`

Group: Accounting › Asset Management › Fixed Assets

[Open in the interactive reference](https://lensing.ai/api-docs/lensing/v1/endpoints/createFixedAsset)

`POST /fixed-assets`

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

Registers a fixed asset from the Unscheduled list, the same as publishing a row of the Unscheduled tab of the fixed assets page in Lensing. The fixed asset gets its depreciation schedule. Registering posts nothing: depreciation is recorded with POST fixed-assets/depreciation-schedules/record.

Send exactly one of `sourceJournalEntryLineId` or `draftFixedAssetId`. Take either from GET unscheduled-fixed-assets: a row of kind 'journalEntryLine' gives its id as `sourceJournalEntryLineId`, a row of kind 'draft' as `draftFixedAssetId`. There is no way to create a fixed asset without a source.

From a journal entry line: the line is linked to the fixed asset as its source. The line decides the legal entity, the accounting book (its journal entry's), the currency, the acquisition value (the line's amount) and the acquisition date (the line's transaction date). The in-service date defaults to the line's transaction date. The name defaults to the asset's name in another book, or else the line's description. The department and business unit default to the line's. With reporting tags on, the fixed asset takes all of the line's tags, and a departmentId or businessUnitId you send replaces that tag.

From a draft: the draft is published and keeps its id, its source lines, legal entity, book, currency, acquisition value and acquisition date. Every other value defaults to what the draft holds, and the values you send replace them.

`typeId` is optional. The types you can use are the ones a depreciation policy of the book covers for the source line's account (for a draft with no source line, every type the book's policies cover), listed in `allowedTypes` on GET unscheduled-fixed-assets/:id. A draft's saved type stays allowed while its rule is unavailable. When you leave typeId out, the type is the row's `defaultTypeId`: the draft's saved type while it is allowed, or else the only type that qualifies. When there is no default, the request fails with FIXED_ASSET_TYPE_REQUIRED, which lists the types you can send.

When you leave out `depreciationMethod`, `depreciationInterval` or `depreciationConvention`, the fixed asset takes the draft's value, or else the depreciation policy's for its type.

The depreciation schedule is calculated from `inServiceDate` over the useful life the depreciation policy sets for the type. The accounting periods of the legal entity's book must cover the whole schedule, or the request fails with VALIDATION_FAILED and the rule 'accountingPeriodsNotGenerated'.

You cannot set the asset status: a registered asset starts as 'available' (a draft keeps the status saved on it). Change it afterwards with PATCH fixed-assets/:id. Sending `bookId`, `assetStatus`, `entityId`, `currency`, `acquisitionValueAmount` or `acquisitionDate` is rejected with HTTP 400 and no code, because the body has an unexpected property.

The response contains only the fixed asset's id. Read it with GET fixed-assets/:id; its `sources` name the journal entry lines it was registered from.

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. |

## Request body

Required, `application/json`: createFixedAssetInput.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `sourceJournalEntryLineId` | string | no | The journal entry line to register as a fixed asset: the id of a row of kind 'journalEntryLine' on GET unscheduled-fixed-assets. The line sets the legal entity, book, currency, acquisition value and acquisition date. Send this or draftFixedAssetId, not both. Example: `"3f6a1c88-9b27-4d05-a6e3-0c9d4b7e21f5"`. |
| `draftFixedAssetId` | string | no | The draft fixed asset to register: the id of a row of kind 'draft' on GET unscheduled-fixed-assets. The draft is published and keeps this id. Send this or sourceJournalEntryLineId, not both. |
| `typeId` | string | no | The type of the fixed asset. See typeId in allowedTypes on GET unscheduled-fixed-assets/:id. Defaults to the row's defaultTypeId: the draft's saved type while it is allowed, or else the only type that qualifies; required when there is no default. |
| `name` | string | no | The name of the asset. Defaults to the draft's name, or the asset's name in another book, or else the line's description. A blank name is refused with FIELD_REQUIRED. Example: `"Forklift - Warehouse 2"`. |
| `serialNumber` | string | no | The serial number of the asset. Free text. Defaults to the draft's. An empty string means none, the same as leaving it out of a line. Example: `"SN-77120934"`. |
| `assetTag` | string | no | The asset tag of the asset, such as the code on a label attached to it. Free text. Defaults to the draft's. An empty string means none, the same as leaving it out of a line. |
| `departmentId` | string | no | The department the asset is assigned to. See id on GET people/departments/:id. Defaults to the draft's or the line's department. |
| `businessUnitId` | string | no | The business unit the asset is assigned to. Defaults to the draft's or the line's business unit. |
| `inServiceDate` | date | no | The date the asset was placed in service. The depreciation schedule is calculated from this date. Format YYYY-MM-DD. Defaults to the draft's in-service date, or else the line's transaction date. Example: `"2026-04-01"`. |
| `depreciationMethod` | string | no | The depreciation method. Accepted values: 'StraightLine', 'Degressive', 'Immediate', 'Bypassed'. Defaults to the draft's method, or else the depreciation policy's. 'Bypassed' creates no depreciation schedule. |
| `depreciationInterval` | string | no | The interval at which depreciation is recorded. Accepted values: 'Monthly', 'Quarterly', 'Yearly'. Defaults to the draft's interval, or else the depreciation policy's. |
| `depreciationConvention` | string | no | How the depreciation method treats time. Accepted values: 'FullMonth', 'MidMonth', 'MidYear', 'SixMonthRule', 'ProrateFirstLast', 'ActualDays'. 'StraightLine' accepts all of them, 'Degressive' only 'FullMonth', and 'Immediate' and 'Bypassed' none. Defaults to the draft's convention while it suits the method, or else the depreciation policy's, or the method's default when the method does not accept the policy's. |
| `degressionRate` | decimal | no | The yearly rate of declining-balance depreciation, as a decimal fraction, the same scale GET fixed-assets/:id returns. For example, 0.25 is 25%. Must be greater than 0 and at most 1, or the request fails with INVALID_FIELD_VALUE. Required when depreciationMethod is 'Degressive' (a draft's saved rate counts), and refused with FIELD_NOT_APPLICABLE for any other method. |
| `salvageValueAmount` | decimal | no | The value the asset is expected to have at the end of its useful life, in the source's currency. Defaults to the draft's, or else 0. Must be at least 0 and at most the acquisition value, or the request fails with INVALID_FIELD_VALUE. Example: `"2000"`. |

```json
{}
```

## Response

`200` Success

Under `data` (createFixedAssetOutput):

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes | The unique identifier for the registered fixed asset. For a draft, the draft's id. Example: `"9d5b1f42-7c30-4e88-b1a6-2f0c7e34d915"`. |

```json
{
  "data": {
    "id": "9d5b1f42-7c30-4e88-b1a6-2f0c7e34d915"
  },
  "diagnostics": [
    {
      "code": "<code>",
      "message": "<message>",
      "severity": "error",
      "path": [
        "<path>"
      ],
      "details": "<details>"
    }
  ]
}
```

## Response headers

- `Idempotency-Replayed` — Present and `true` only when this response replays a previously stored one for the same Idempotency-Key, rather than reflecting a live execution. Absent on a live response - never sent as `false`.

## Errors

| Code | Status |
| --- | --- |
| `REFERENCED_RECORD_NOT_FOUND` | 400 |
| `INVALID_FIELD_VALUE` | 400 |
| `FIELD_REQUIRED` | 400 |
| `FIELD_NOT_APPLICABLE` | 400 |
| `NOT_ELIGIBLE` | 400 |
| `FIXED_ASSET_LINE_ALREADY_HELD` | 400 |
| `FIXED_ASSET_TYPE_REQUIRED` | 400 |
| `FIXED_ASSET_TYPE_NOT_ALLOWED` | 400 |
| `FIXED_ASSET_TYPE_NOT_ASSOCIATED_WITH_BOOK` | 400 |
| `DEPRECIATION_POLICY_NOT_FOUND` | 400 |
| `UNSUPPORTED_DEPRECIATION_CONVENTION` | 400 |
| `VALIDATION_FAILED` | 400 |
| `IDEMPOTENCY_KEY_CONFLICT` | 409 |
| `IDEMPOTENCY_PAYLOAD_MISMATCH` | 422 |

## Statuses

- `400` — Invalid request or business failure. Codes: REFERENCED_RECORD_NOT_FOUND, INVALID_FIELD_VALUE, FIELD_REQUIRED, FIELD_NOT_APPLICABLE, NOT_ELIGIBLE, FIXED_ASSET_LINE_ALREADY_HELD, FIXED_ASSET_TYPE_REQUIRED, FIXED_ASSET_TYPE_NOT_ALLOWED, FIXED_ASSET_TYPE_NOT_ASSOCIATED_WITH_BOOK, DEPRECIATION_POLICY_NOT_FOUND, UNSUPPORTED_DEPRECIATION_CONVENTION, VALIDATION_FAILED
- `401` — The request carries no valid access token.
- `403` — Not authorized
- `404` — Not found
- `409` — The Idempotency-Key is still being processed by another request.
- `422` — The Idempotency-Key was already used with a different request payload.
- `429` — Too many requests from this client address. The response has no body and no `Retry-After` header.
- `500` — Internal server error
