Accounting

Read a persisted business-case instance by its id for the authenticated company.

Loads the fully hydrated business-case aggregate that was previously persisted for the authenticated company: the template id, the company-VAT and fiscal-year context that were in force when the case was booked, the pre-translated display label, the recursive snippet / field tree with the persisted scripted values overlaid, and the comma-separated list of booking numbers already generated for it. Tenant and company are derived from the bearer-token session — they are never accepted from the URL; the supplied <code>businessCaseId</code> is matched against the caller's company so that an id owned by another company surfaces as <code>404</code>. The endpoint is a pure read — idempotent, no side effects. The caller must hold the <code>ACCOUNTING</code> permission on the company in scope.

get/core/v1/accounting/business-cases/{businessCaseId}

Request

  • Base URL: https://api.klara.ch
  • URL: https://api.klara.ch/core/v1/accounting/business-cases/{businessCaseId}
  • Auth: one of:
    • API key in header X-API-KEY
    • HTTP bearer

Path parameters

businessCaseIdinteger required
Example:5001

Numeric primary-key id of the persisted business-case instance to hydrate. Obtain it from a prior booking response (for example <code>POST /core/v1/accounting/bookings</code>) or from a journal listing.

Headers

Accept-Languagestring
Example:de-CH

IETF language tag used to translate the snippet labels and field captions. Examples: <code>de-CH</code>, <code>fr-CH</code>, <code>it-CH</code>, <code>en</code>.

Response

Hydrated business-case aggregate for the requested id.

businessCaseIdinteger

Identifier of the business case instance when persisted; null on a freshly hydrated template.

businessCaseTemplateIdinteger

Identifier of the business-case template this aggregate was hydrated from.

documentIdstring

Identifier of the underlying document the business case is attached to; null when the booking is not yet linked to a document.

displaystring

Pre-translated display label of the business-case template for the request's Accept-Language.

bookingNumbersstring

Comma-separated list of booking numbers already generated for this business case; empty on a fresh template.

effectiveCompanyVatDatestring date

Date used to resolve the company-VAT regime applicable to this business case (ISO yyyy-MM-dd).

documentDatestring date

Document date associated with the business case (ISO yyyy-MM-dd).

effectiveFiscalYearDatestring date

Date used to resolve the fiscal year applicable to this business case (ISO yyyy-MM-dd).

fiscalYearHasCreatedAutoboolean

True when the downstream service had to auto-create the fiscal year covering the resolved date.

withOPboolean

True when this business case is tracked as an open item (OP). May be null when not applicable.

fieldsobject

Recursive snippet-and-field tree driving the booking form, keyed by snippet code. The shape of each entry follows the downstream BusinessCaseField model (see analysis report §8.2).

entriesDefinitionobject[]

Per-field entries definitions used by the booking form to resolve enum-like fields. Each entry mirrors the downstream FieldEntriesDefinition model (see analysis report §8.2).

Example response

{
  "businessCaseTemplateId": 101,
  "documentId": "null",
  "display": "Bürobedarf",
  "effectiveCompanyVatDate": "2024-06-15",
  "documentDate": "2024-06-15",
  "effectiveFiscalYearDate": "2024-06-15",
  "fields": {
    "PAYMENT": {
      "snippetId": 42,
      "nestedFields": {}
    }
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.