Register, change, dispose of or void a fixed asset, or propose a year's depreciation of one.
Changed onaction picks the act. save: a new asset (no asset_id) or a change to one not yet booked, with description, invested_on, cost, life_years, fiscal_rate and the three account codes; a booked asset is refused. dispose: records the disposal on disposed_on for proceeds and books nothing. void: a wrongly registered asset, with a reason; a booked asset is refused. propose_depreciation: a proposal (nothing booked) of fiscal_year's depreciation of asset_id, at the amount Magistry's engine computes from the stored asset — a caller never states it — at the end of that fiscal year; a year whose period is closed answers 409 period_closed. The result's id is the asset (save, dispose, void) or the proposal (propose_depreciation). A write: needs finance:write and an app Magistry has reviewed for finance, the book capability on the entity (Postgres asks the granting person's role and the app's grant), the platform switch api_finance_manage (until it is on this answers 403 finance_feature_off and writes nothing) and the annual accounts switch, which the database asserts (403 finance_feature_off, feature annual_accounts). Deciding a depreciation proposal (posting, withdrawing or reversing it) is a person's act in Books → Annual → Assets and is not offered. Costs 3 rate credits. Requires an Idempotency-Key header (or idempotency_key, 8 to 255 characters, the same one if both are sent): without one this answers 400 idempotency_required and writes nothing. A retry with the same key and the same arguments answers the first result without writing again; the same key with other arguments is 409 idempotency_conflict, while the first request is still running 409 idempotency_in_flight, and once a first request that never finished is past its window 409 idempotency_outcome_unknown (read the books, then a new key).
Request
- Base URLhttps://app.magistry.io
- Auth
- HTTP bearer
- or OAuth 2Authorization codehttps://app.magistry.io/api/oauth/authorizeToken URLhttps://app.magistry.io/api/oauth/tokenScopesfinance:write
Headers
Required, here or as idempotency_key in the body. A unique string you choose for this request; send the SAME key when retrying and the first answer is returned instead of writing twice (idempotent-replayed: true). The same key with other arguments is 409 idempotency_conflict. If the header and idempotency_key are both sent they must be equal.
Request body
The entity, one of those this app was granted (GET /api/v1/finance/entities lists them).
The act.
The asset. Required for dispose, void and propose_depreciation; omitted on save to register a new one.
save: what the asset is.
save: the kind of asset (default tangible).
save: the day it was acquired.
save: the acquisition cost. A decimal string in the entity's currency, at most two decimals.
save: the residual value at the end of its life (default 0). A decimal string in the entity's currency, at most two decimals.
save: the commercial useful life in years.
save: the fiscal depreciation rate per year as a fraction, e.g. 0.2.
save: whether the small-scale investment allowance (KIA) is claimed on it.
save: whether the asset is excluded from the KIA.
save: the balance-sheet account the asset sits on. An account code of this entity's chart (GET /api/v1/finance/accounts).
save: the accumulated depreciation account. An account code of this entity's chart (GET /api/v1/finance/accounts).
save: the depreciation expense account. An account code of this entity's chart (GET /api/v1/finance/accounts).
dispose: the day of disposal.
dispose: what the disposal brought in (0 when nothing). A decimal string in the entity's currency, at most two decimals.
void: why the asset was registered wrongly.
propose_depreciation: the fiscal year.
Same as the Idempotency-Key header; give one of the two.
Response
Result
Changes
- warning
added the new
method_not_allowedenum value to theerrorresponse property for the response status - warning
added the new
method_not_allowedenum value to theerrorresponse property for the response status - warning
added the new
method_not_allowedenum value to theerrorresponse property for the response status
11 more changes in this revision
- warning