StabisoDocs

REST API

Register an asset, depreciate it, dispose of it

A fixed asset is bought once and written off over its useful life. This page registers an asset in the asset register without a purchase bill, adds it to the Swiss tax depreciation book, runs the month's depreciation, reads the book-tax difference and the deferred tax that follows from it, posts the deferred tax, and finally disposes of the asset. It is meant for the accountant who runs the month-end for a Swiss entity.

Before you start

  • The page uses $ERP_KEY, the first key of the demo organization (a human key with every scope). The system issued it, so it belongs to no person and can never approve a request, but nothing on this page needs an approval: it registers, depreciates and disposes, which need the draft scope (and post for the entries to be posted at once); reading needs read. See getting started for the kinds of key and scopes and conventions for idempotency and errors.
  • The entity is CH01 (Demo AG, CHF). January to August 2026 are closed, September is open. The laptop FA-001 (cost 2,400, three years) is registered and was depreciated in August. The tax book TAX-CH (ESTV rates, regime ch.estv) exists and carries deferred tax at 19.6%.
  • Posting entries that depreciation, deferred tax and disposal create go through the approval policy; a human key with the post scope posts at once (an agent's entry could wait for a person to approve it).

1. Find the period

Depreciation and the other month-end runs work on a period, named by its id. The periods that contain a date are listed by on.

curl "$ERP_URL/v1/entities/CH01/periods?on=2026-09-30" \
  -H "Authorization: Bearer $ERP_KEY"
[
  {
    "id": "<uuid>",
    "fiscal_year": 2026,
    "number": 9,
    "kind": "regular",
    "start_date": "2026-09-01",
    "end_date": "2026-09-30",
    "status": "open"
  }
]

2. See the depreciation books

Every entity has the accounting book BOOK, which is the only one that posts depreciation to the ledger, and any number of tax books, which keep a schedule per asset and post nothing. A tax book can carry deferred tax; deferred_tax_cadence says how often the close needs a run.

curl "$ERP_URL/v1/entities/CH01/depreciation-books" \
  -H "Authorization: Bearer $ERP_KEY"
[
  {"code": "BOOK", "name": "Accounting book", "kind": "book", "posts_to_gl": true, "deferred_tax": false},
  {
    "code": "TAX-CH",
    "kind": "tax",
    "standard": "ch.estv",
    "posts_to_gl": false,
    "deferred_tax": true,
    "tax_rate_percent": "19.6",
    "deferred_tax_cadence": "year_end",
    "dtl_account": "2650",
    "dta_account": "1480",
    "dt_expense_account": "8910"
  }
]

3. Register an asset

A printer is bought on 1 September for 1,800, useful life four years. The asset does not need a purchase bill: with post_acquisition the register books the cost itself (debit the asset cost account, credit credit_account; here accrued liabilities 2300, until the invoice is paid). The credit account is never a control account (bank, receivables, payables: their own areas book them), a tax account, revenue or expense (422). If the asset came in through a purchase bill, name the bill in source_document instead and the bill's posting is the acquisition. The cost, accumulated depreciation and expense accounts default to the entity's asset roles (1500, 1509 and 6800 here). An asset class has accounts of its own in the Swiss KMU chart (1510 and 1519 furniture, 1520 and 1529 IT hardware, 1530 and 1539 vehicles): such an asset names its cost_account and accumulated_account together (1520 and 1529 for a laptop; one without the other is refused with 422), and its purchase bill is booked to the same cost account. There is no asset-class table yet (B-64).

books adds the asset to a tax book in the same call. An asset_class of the book's regime fills method, rate and convention from the ESTV leaflet: ch.estv.office_machines is a declining balance of 40%. Idempotency-Key is required.

curl -X POST "$ERP_URL/v1/assets" \
  -H "Authorization: Bearer $ERP_KEY" \
  -H "Idempotency-Key: fa-printer" \
  -H "Content-Type: application/json" \
  -d '{
    "entity": "CH01",
    "code": "FA-002",
    "name": "Office printer",
    "acquisition_date": "2026-09-01",
    "cost": "1800.00",
    "useful_life_years": "4",
    "post_acquisition": true,
    "credit_account": "2300",
    "books": [{"book": "TAX-CH", "asset_class": "ch.estv.office_machines"}]
  }'
{
  "id": "<uuid>",
  "code": "FA-002",
  "schedule": {
    "method": "straight_line",
    "convention": "pro_rata_months",
    "depreciable_base": "1800.00",
    "periods": [
      {"fiscal_year": 2026, "depreciation": "150.00", "closing_book_value": "1650.00"},
      {"fiscal_year": 2027, "depreciation": "450.00", "closing_book_value": "1200.00"},
      "..."
    ]
  },
  "tax_schedule": null
}

The response is the accounting schedule by fiscal year, computed from the method, life and convention and stored with the asset. In service from 1 September, the asset is depreciated for four of the twelve months of 2026: 1,800 / 4 years x 4/12 = 150.00. The fifth year holds the rest. The response does not carry the approval decision of the acquisition entry; with a person's key it is posted.

4. Read the asset and its books

curl "$ERP_URL/v1/assets/FA-002" \
  -H "Authorization: Bearer $ERP_KEY"
{
  "code": "FA-002",
  "entity": "CH01",
  "status": "active",
  "in_service_date": "2026-09-01",
  "cost": "1800.00",
  "method": "straight_line",
  "cost_account": "1500",
  "accumulated_account": "1509",
  "expense_account": "6800",
  "source_bill": null,
  "books": ["BOOK", "TAX-CH"]
}

The books of an asset with their position at a date: accumulated depreciation, carrying amount, and for a tax book the temporary difference against the accounting book and the deferred tax that goes with it. Nothing has been depreciated yet, so the accounting book is at cost; the tax book (a full 720 for 2026, spread over the four periods Sept to Dec: 180 so far) is ahead of it.

curl "$ERP_URL/v1/assets/FA-002/books?as_of=2026-09-30" \
  -H "Authorization: Bearer $ERP_KEY"
[
  {"book": "BOOK", "accumulated": "0.00", "carrying_amount": "1800.00", "posts_to_gl": true},
  {
    "book": "TAX-CH",
    "asset_class": "ch.estv.office_machines",
    "method": "declining_balance",
    "accumulated": "180.00",
    "carrying_amount": "1620.00",
    "temporary_difference": "180.00",
    "tax_rate_percent": "19.6",
    "deferred_tax_amount": "35.28",
    "posts_to_gl": false
  }
]

The schedule of one book by fiscal year is the same content on its own. For a tax book each year shows the accounting book's closing value (book_value) and the difference to the tax book. A declining balance (CH ESTV) never ends on its own, so the tax schedule ends with the accounting book: in its last year the asset is taken as scrapped and what is left is written off. A UK pool keeps it, as does a CH class with land (only the building is depreciated); those list 30 years.

curl "$ERP_URL/v1/assets/FA-002/books/TAX-CH/schedule?as_of=2026-09-30" \
  -H "Authorization: Bearer $ERP_KEY"
{
  "book": "TAX-CH",
  "schedule": [
    {
      "fiscal_year": 2026,
      "depreciation": "720.00",
      "closing_book_value": "1080.00",
      "book_value": "1650.00",
      "difference": "570.00"
    },
    "..."
  ]
}

5. Run the depreciation of the month

Deferred tax is measured on the depreciation that is in the ledger, so the depreciation of a period runs first. Asking for deferred tax now is refused:

curl -X POST "$ERP_URL/v1/periods/$PERIOD_ID/deferred-tax" \
  -H "Authorization: Bearer $ERP_KEY"
{"error": {"code": "depreciation_before_deferred_tax"}}

The depreciation run posts one entry dated the last day of the period: debit depreciation expense, credit accumulated depreciation, per asset, from the asset's schedule. It covers every active asset in service. The year's amount is spread evenly over the regular periods the asset is in service in that year (by days on a week-based calendar), and never more than what is left to depreciate. An adjustment period gets none. The run is stored for the period: it runs once.

curl -X POST "$ERP_URL/v1/periods/$PERIOD_ID/depreciation" \
  -H "Authorization: Bearer $ERP_KEY"
{
  "kind": "depreciation",
  "period": "2026-09",
  "items": [
    {"asset": "FA-001", "amount": "66.67"},
    {"asset": "FA-002", "amount": "37.50"}
  ],
  "total": "104.17",
  "submit": {"status": "posted", "policy": {"decision": "allow", "rule_id": "humans_allowed"}}
}

The register shows cost, accumulated depreciation and net book value per asset. The laptop has two months of depreciation (August and September), the printer one.

curl "$ERP_URL/v1/entities/CH01/assets?as_of=2026-09-30" \
  -H "Authorization: Bearer $ERP_KEY"
[
  {
    "code": "FA-001",
    "status": "active",
    "cost": "2400.00",
    "accumulated": "133.34",
    "net_book_value": "2266.66",
    "source_bill": "<any>"
  },
  {
    "code": "FA-002",
    "status": "active",
    "cost": "1800.00",
    "accumulated": "37.50",
    "net_book_value": "1762.50",
    "source_bill": null
  }
]

6. Read the book-tax differences

The carrying amount (cost less the depreciation in the ledger) differs from the tax base (cost less the tax book's depreciation to date) because the ESTV allows faster depreciation than the accounting book takes. A positive difference is taxable: it reverses later and is a deferred tax liability. The report gives the difference per asset and for the book that carries deferred tax the liability, the amount already posted and the movement the next run would post.

curl "$ERP_URL/v1/entities/CH01/book-tax-differences?fiscal_year=2026&period=9" \
  -H "Authorization: Bearer $ERP_KEY"
{
  "entity": "CH01",
  "currency": "CHF",
  "period": {"fiscal_year": 2026, "number": 9, "status": "open"},
  "lines": [
    {
      "asset": "FA-001",
      "book": "TAX-CH",
      "carrying_amount": "2266.66",
      "tax_base": "2016.00",
      "temporary_difference": "250.66",
      "deferred_tax": "49.13"
    },
    {
      "asset": "FA-002",
      "book": "TAX-CH",
      "carrying_amount": "1762.50",
      "tax_base": "1620.00",
      "temporary_difference": "142.50",
      "deferred_tax": "27.93"
    }
  ],
  "totals": [
    {
      "book": "TAX-CH",
      "tax_rate_percent": "19.6",
      "temporary_difference": "393.16",
      "deferred_tax": "77.06",
      "deferred_tax_liability": "77.06",
      "posted_liability": "0.00",
      "movement": "77.06"
    }
  ]
}

7. Post the deferred tax

The deferred-tax run posts the movement since the last run: debit deferred tax expense (8910) and credit the deferred tax liability (2650), here 77.06. It is a separate run per period.

deferred_tax_cadence decides when the close needs it: with year_end (the default) the close checklist shows deferred tax as not due until the last regular period of the fiscal year, with period it fails every period until the run is done. The run itself is allowed in any period, so a September run is fine under either cadence; it posts only what changed since the previous run.

curl -X POST "$ERP_URL/v1/periods/$PERIOD_ID/deferred-tax" \
  -H "Authorization: Bearer $ERP_KEY"
{
  "kind": "deferred_tax",
  "period": "2026-09",
  "total": "77.06",
  "items": [
    {"asset": "FA-001", "temporary_difference": "250.66", "deferred_tax": "49.13"},
    {"asset": "FA-002", "temporary_difference": "142.50", "deferred_tax": "27.93"}
  ],
  "submit": {"status": "posted"}
}

8. Dispose of the asset

The printer is sold on 30 September for 1,500. The disposal posts one entry dated the disposal date: credit the cost, debit the accumulated depreciation to date, debit the account the proceeds arrive in, and the difference as a gain (credit) or a loss (debit) on the disposal accounts of the entity (roles asset_disposal_gain and asset_disposal_loss; 8514 and 8504 in the Swiss KMU chart, where they are ausserordentlicher Ertrag and Aufwand; 7510 and 7520 in the generic chart). It does not depreciate: depreciation has to be run up to the disposal date first, as in step 5. Proceeds need the account they are debited to:

curl -X POST "$ERP_URL/v1/assets/FA-002/dispose" \
  -H "Authorization: Bearer $ERP_KEY" \
  -H "Idempotency-Key: fa-printer-dispose-no-account" \
  -H "Content-Type: application/json" \
  -d '{"disposal_date": "2026-09-30", "proceeds": "1500.00"}'
{"error": {"code": "proceeds_account_missing"}}
curl -X POST "$ERP_URL/v1/assets/FA-002/dispose" \
  -H "Authorization: Bearer $ERP_KEY" \
  -H "Idempotency-Key: fa-printer-dispose" \
  -H "Content-Type: application/json" \
  -d '{"disposal_date": "2026-09-30", "proceeds": "1500.00", "proceeds_account": "1000"}'
{
  "entry_id": "<uuid>",
  "status": "posted",
  "policy": {"decision": "allow", "rule_id": "humans_allowed"}
}

The answer is the usual result of submitting an entry. The asset becomes disposed once the entry is posted; had the policy asked for a second person, it would stay active until then, and a rejection would leave it active.

curl "$ERP_URL/v1/journal-entries/$DISPOSAL_ID" \
  -H "Authorization: Bearer $ERP_KEY"
{
  "source": "fa",
  "source_ref": "FA-002",
  "entry_date": "2026-09-30",
  "lines": [
    {"line_no": 1, "description": "Derecognise cost", "debit": "0.00", "credit": "1800.00"},
    {"line_no": 2, "description": "Derecognise accumulated depreciation", "debit": "37.50", "credit": "0.00"},
    {"line_no": 3, "description": "Disposal proceeds", "debit": "1500.00", "credit": "0.00"},
    {"line_no": 4, "description": "Loss on disposal", "debit": "262.50", "credit": "0.00"}
  ]
}

The net book value was 1,762.50, the proceeds 1,500.00, so the loss is 262.50.

curl "$ERP_URL/v1/assets/FA-002" \
  -H "Authorization: Bearer $ERP_KEY"
{"code": "FA-002", "status": "disposed", "disposal_date": "2026-09-30"}

The printer is gone from the tax base, so the deferred tax measured now is lower than what step 7 posted. The report shows what the next run would post: a movement of -27.93 (the liability for the printer is released).

curl "$ERP_URL/v1/entities/CH01/book-tax-differences?fiscal_year=2026&period=9" \
  -H "Authorization: Bearer $ERP_KEY"
{
  "totals": [
    {
      "book": "TAX-CH",
      "temporary_difference": "250.66",
      "deferred_tax_liability": "49.13",
      "posted_liability": "77.06",
      "movement": "-27.93"
    }
  ]
}

9. Change the asset's value

Four changes keep an asset on the books at another value, as SAP FI-AA's partial retirement (ABAON), unplanned depreciation (ABAA), its write-up and revaluation do. Each posts one entry with source fa, goes through the approval policy like a disposal (a rejection puts the asset back as it was), appears in the asset's history and recalculates the depreciation of the later months. A change counts from the end of its period: its entry first books the depreciation the schedule still has up to then (depreciation_to_period_end). It is refused when depreciation is booked for a later period, or the asset changed on a later day. Only a person records an impairment, its reversal, a revaluation or a part retired without an invoice (policy action change_asset_value): an agent's key is refused with policy_denied.

Impairment (IAS 36; HGB § 253 (3); OR 960a (3)). The laptop was dropped; it can still recover 1,500. Its book value of 2,266.66 is written down by 766.66: debit the impairment account (role asset_impairment_loss, 6890 in the Swiss chart), credit its accumulated depreciation. A reason is required. Give recoverable_amount, or the write-down as amount.

curl -X POST "$ERP_URL/v1/assets/FA-001/impairment" \
  -H "Authorization: Bearer $ERP_KEY" \
  -H "Idempotency-Key: fa-laptop-impairment" \
  -H "Content-Type: application/json" \
  -d '{"impairment_date": "2026-09-30", "recoverable_amount": "1500.00", "reason": "Dropped; screen replaced, worth less"}'
{
  "kind": "impairment",
  "depreciation_to_period_end": "0.00",
  "carrying_before": "2266.66",
  "carrying_after": "1500.00",
  "profit_or_loss": "-766.66",
  "submit": {"status": "posted"}
}

Impairment reversal (IAS 36.114 to 121; HGB § 253 (5); OR 960a). Once the reasons for a write-down no longer apply, POST /v1/assets/{asset}/impairment-reversal writes the asset up again: debit its accumulated depreciation, credit the impairment account. Give recoverable_amount or the write-up as amount, and a reason. The write-up is at most what the asset would carry, net of depreciation, had it not been impaired (IAS 36.117); a larger amount is refused with impairment_reversal_too_large and the most in details.most. A revaluation up is income only to the same extent; the rest goes to the revaluation surplus. Companies keeping their books under US GAAP or Canadian ASPE are refused (impairment_reversal_not_allowed): those standards do not allow it. A Swiss tax book follows the commercial impairment and its reversal.

Sale to a customer. POST /v1/assets/{asset}/sale makes an ordinary sales invoice to the customer, goods at the VAT rate given (standard by default; the customer's country decides the treatment, as on any invoice), so the VAT is on the VAT return and the receivable on the customer. The invoice line credits the clearing account of asset sales (role asset_sale_clearing, 1190 in the Swiss chart). The asset's own entry takes the net proceeds, in the company's currency at the invoice's rate, out of that account again and books the gain or loss against them. Without percent or cost the whole asset is sold (a disposal); with one of them that part is retired. When the invoice waits for a second person, the asset's entry waits with it: approving the invoice posts it, rejecting the invoice rejects it and puts the asset back. A quarter of the laptop is sold for 400 plus VAT:

curl -X POST "$ERP_URL/v1/entities/CH01/parties" \
  -H "Authorization: Bearer $ERP_KEY" \
  -H "Idempotency-Key: fa-buyer" \
  -H "Content-Type: application/json" \
  -d '{"kind": "customer", "code": "C-BUYER", "name": "Second-hand IT AG", "country": "CH", "currency": "CHF"}'
curl -X POST "$ERP_URL/v1/assets/FA-001/sale" \
  -H "Authorization: Bearer $ERP_KEY" \
  -H "Idempotency-Key: fa-laptop-sale" \
  -H "Content-Type: application/json" \
  -d '{"sale_date": "2026-09-30", "customer": "C-BUYER", "net_amount": "400.00", "percent": "25"}'
{
  "invoice_status": "posted",
  "currency": "CHF",
  "net_amount": "400.00",
  "tax_amount": "32.40",
  "total": "432.40",
  "proceeds": "400.00",
  "disposal": null,
  "change": {
    "kind": "partial_retirement",
    "cost_before": "2400.00",
    "cost_after": "1800.00",
    "carrying_after": "1125.00",
    "profit_or_loss": "25.00"
  }
}

A quarter of the cost (600.00) and of the accumulated depreciation (225.00) leaves; the part's book value of 375.00 sold for 400.00 is a gain of 25.00. The rest, 1,125.00, is depreciated over the remaining 34 months. POST /v1/assets/{asset}/partial-retirement retires a part without an invoice: scrapped, or sold for cash received on a bank account (proceeds_account).

Revaluation (IAS 16.31 to 42, FRS 102). POST /v1/assets/{asset}/revaluation carries the asset at its fair value: the accumulated depreciation is eliminated against the cost, a rise goes to the revaluation surplus (role revaluation_surplus; income where it reverses an earlier loss of the asset), a fall is set against the surplus first and the rest is a loss. Only the IFRS and FRS 102 books allow it. Swiss law keeps an asset at cost less depreciation, so CH01 is refused:

curl -X POST "$ERP_URL/v1/assets/FA-001/revaluation" \
  -H "Authorization: Bearer $ERP_KEY" \
  -H "Idempotency-Key: fa-laptop-revaluation" \
  -H "Content-Type: application/json" \
  -d '{"revaluation_date": "2026-09-30", "fair_value": "2000.00", "reason": "Dealer offer"}'
{"error": {"code": "revaluation_not_allowed", "law": "OR 960a"}}

The German HGB (§ 253 (1)), the Italian civil code, the Spanish PGC, US GAAP and Canadian ASPE are refused the same way; a French free revaluation (PCG art. 214-27) is not built.

What can go wrong

The code of an asset is unique in its entity.

curl -X POST "$ERP_URL/v1/assets" \
  -H "Authorization: Bearer $ERP_KEY" \
  -H "Idempotency-Key: fa-printer-again" \
  -H "Content-Type: application/json" \
  -d '{
    "entity": "CH01",
    "code": "FA-002",
    "name": "Office printer",
    "acquisition_date": "2026-09-01",
    "cost": "1800.00",
    "useful_life_years": "4"
  }'
{"error": {"code": "asset_exists"}}

Depreciation runs once per period.

curl -X POST "$ERP_URL/v1/periods/$PERIOD_ID/depreciation" \
  -H "Authorization: Bearer $ERP_KEY"
{"error": {"code": "depreciation_ran"}}

A disposed asset cannot be disposed of again.

curl -X POST "$ERP_URL/v1/assets/FA-002/dispose" \
  -H "Authorization: Bearer $ERP_KEY" \
  -H "Idempotency-Key: fa-printer-dispose-again" \
  -H "Content-Type: application/json" \
  -d '{"disposal_date": "2026-09-30"}'
{"error": {"code": "asset_status"}}

Nothing is posted into a closed period. The laptop cannot be disposed of in August:

curl -X POST "$ERP_URL/v1/assets/FA-001/dispose" \
  -H "Authorization: Bearer $ERP_KEY" \
  -H "Idempotency-Key: fa-laptop-dispose-august" \
  -H "Content-Type: application/json" \
  -d '{"disposal_date": "2026-08-31"}'
{"error": {"code": "period_closed"}}

A tax book takes the asset classes of its own regime. A US class is refused for TAX-CH:

curl -X POST "$ERP_URL/v1/assets/FA-001/books" \
  -H "Authorization: Bearer $ERP_KEY" \
  -H "Idempotency-Key: fa-laptop-us-class" \
  -H "Content-Type: application/json" \
  -d '{"book": "TAX-CH", "asset_class": "us.macrs.gds.5y"}'
{"error": {"code": "asset_class_other_regime"}}

Reference

Stabiso, the Enterprise System of Record · generated from the code and its guides · release 6f03a5e846b3