Finance

Get the order-numbering configuration for a document type.

Returns the numbering strategy configured for the given <code>order-type</code> of the company resolved from the bearer JWT. Use this before creating a document to decide how to supply the document number in <code>POST /core/v1/invoices</code>: <code>STANDARD</code> — server auto-assigns; <code>MANUAL</code> — set <code>invoiceCode</code> yourself; <code>CUSTOMISED</code> — set <code>invoiceCode</code> to a value matching the returned <code>format</code> pattern. If no configuration has been saved by the company administrator, a default <code>STANDARD</code> configuration is returned. The caller must hold the <code>FINANCE</code> permission on the target company. This operation is idempotent and read-only.

get/core/v1/order-numbering-configurations

Request

  • Base URL: https://api.klara.ch
  • URL: https://api.klara.ch/core/v1/order-numbering-configurations
  • Auth: one of:
    • API key in header X-API-KEY
    • HTTP bearer

Query parameters

order-type'OFFER' | 'CONFIRMATION' | 'DELIVERY_NOTE' | 'INVOICE' | 'CREDIT_NOTE' | 'FRIENDLY_REMINDER' | 'FIRST_REMINDER' | 'SECOND_REMINDER' | 'PAYSLIP' | 'RECURRING_INVOICE_TEMPLATE'

Order-management document type. Used as the discriminator on <code>OrderDocument.orderType</code>.

Example:INVOICE

Document type to retrieve the numbering configuration for. Allowed values: <code>OFFER</code>, <code>CONFIRMATION</code>, <code>DELIVERY_NOTE</code>, <code>INVOICE</code>, <code>CREDIT_NOTE</code>, <code>FRIENDLY_REMINDER</code>, <code>FIRST_REMINDER</code>, <code>SECOND_REMINDER</code>, <code>PAYSLIP</code>, <code>RECURRING_INVOICE_TEMPLATE</code>. Recommended — omitting it returns a generic default with a null <code>orderType</code> field.

Response

Numbering configuration for the requested document type.

orderType'OFFER' | 'CONFIRMATION' | 'DELIVERY_NOTE' | 'INVOICE' | 'CREDIT_NOTE' | 'FRIENDLY_REMINDER' | 'FIRST_REMINDER' | 'SECOND_REMINDER' | 'PAYSLIP' | 'RECURRING_INVOICE_TEMPLATE'

Order-document type this configuration applies to.

orderNumberingType'STANDARD' | 'MANUAL' | 'CUSTOMISED'

Strategy used to assign document numbers. <code>STANDARD</code>: server auto-increments from <code>startingNumber</code>; <code>MANUAL</code>: caller must supply a number in <code>POST /invoices</code>; <code>CUSTOMISED</code>: caller must supply a code matching <code>format</code>.

startingNumberinteger

The first number in the auto-increment sequence (relevant for STANDARD). Null when not configured.

incrementinteger

Step size between successive auto-incremented numbers (relevant for STANDARD). Null when not configured.

formatstring

Alphanumeric format pattern for CUSTOMISED numbering (e.g. <code>INV-{YYYY}-{SEQ}</code>). Null when not configured.

Example response

{
  "orderType": "INVOICE",
  "orderNumberingType": "STANDARD",
  "startingNumber": 1000,
  "increment": 1,
  "format": "INV-2026-{SEQ}"
}

Changes

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