Accounting

Replace the document attachments and document date of an existing booking.

This operation remains available until <b>2027-08-14</b> and is removed after that date. Use <code>PUT /core/v1/bookings/{id}/documents</code> instead.<br/><br/>Replaces the set of supporting-document identifiers and the document date stored on an existing accounting booking. The operation is a full replacement — pass an empty <code>documentIds</code> array to clear all existing attachments, or omit <code>documentDate</code> / set it to <code>null</code> to clear it. By default the operation fails when the booking's existing <code>bookingDate</code> falls outside the active Klara Accounting subscription window; set <code>ignore-unsubscripted-dates</code> to <code>true</code> to bypass this guard. Tenant and company are derived from the bearer token — the booking <code>{id}</code> must belong to the caller's company. The caller must hold the <code>ACCOUNTING</code> permission on that company. The endpoint is idempotent: re-sending the same body produces the same state. Returns HTTP 200 with no body on success.

put/core/latest/bookings/{id}/documents

Request

  • Base URL: https://api.klara.ch
  • URL: https://api.klara.ch/core/latest/bookings/{id}/documents
  • Auth: one of:
    • API key in header X-API-KEY
    • HTTP bearer

Path parameters

idinteger required
Example:12345

Internal id of the booking whose documents should be replaced. Obtain from the <code>id</code> field returned by <code>POST /core/latest/bookings</code>.

Query parameters

ignore-unsubscripted-datesboolean

When <code>true</code>, accept the update even if the booking's <code>bookingDate</code> falls outside the active Klara Accounting subscription period. Defaults to <code>false</code>.

Request body

documentDatestring date

Date printed on the underlying paper document (e.g. supplier invoice date). When omitted or null, the booking's existing documentDate is cleared.

documentIdsstring[]

Identifiers of supporting documents attached to the booking. Replaces the current set on the booking; pass an empty array to clear. Obtain each id by first uploading a file with POST /core/latest/companies/{company-id}/documents and then copying the returned documentId into this array.

Example request

{
  "documentDate": "2024-06-15",
  "documentIds": [
    "98765"
  ]
}

Response

Document attachments and date applied to the booking (or accepted as a no-op when the booking does not exist on the downstream side).

Changes

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