---
title: "Get the next available order number for the authenticated company."
method: GET
path: "/core/v1/orders/next-order-number"
tags: ["Finance"]
---

# Get the next available order number for the authenticated company.

`GET /core/v1/orders/next-order-number`

## Request

- Base URL: `https://api.klara.ch`
- URL: `https://api.klara.ch/core/v1/orders/next-order-number`
- Auth: one of:
  - API key in header `X-API-KEY`
  - HTTP bearer

Returns the next available business order number for the company resolved from the bearer JWT. Use the returned <code>nextOrderNumber</code> as the <code>orderNumber</code> field when subsequently creating an order. <strong>Not idempotent</strong>: each call reserves and advances the in-memory counter — call this immediately before creating the order and do not call speculatively. Gaps may appear in the sequence if the subsequent order creation fails. The caller must hold the <code>FINANCE</code> permission on the target company.

## Response `200`

Next available order number for the authenticated company.

- OrderNextNumberResult
  - `nextOrderNumber` integer: The next available business order number for the authenticated company. Reserved exclusively for this call — use it as the orderNumber when subsequently creating the order. Gaps may appear in the sequence if the order creation fails after this call.

## Other responses

- `401`: No Authorization header found or invalid token<br/><br/>Failures detected by a downstream service carry that service's own <code>code</code>, which this reference does not enumerate, so the <code>code</code> field may hold a value not documented here. Treat an unrecognised code as a generic failure of the status it arrives with, and do not branch on a code this reference does not list.
- `403`: The current user is not allowed to access this company data<br/><br/>Failures detected by a downstream service carry that service's own <code>code</code>, which this reference does not enumerate, so the <code>code</code> field may hold a value not documented here. Treat an unrecognised code as a generic failure of the status it arrives with, and do not branch on a code this reference does not list.
- `429`: API rate limit exceeded<br/><br/>Failures detected by a downstream service carry that service's own <code>code</code>, which this reference does not enumerate, so the <code>code</code> field may hold a value not documented here. Treat an unrecognised code as a generic failure of the status it arrives with, and do not branch on a code this reference does not list.
- `500`: Something went wrong on our side while processing the request. Please kindly contact our support.<br/><br/>Failures detected by a downstream service carry that service's own <code>code</code>, which this reference does not enumerate, so the <code>code</code> field may hold a value not documented here. Treat an unrecognised code as a generic failure of the status it arrives with, and do not branch on a code this reference does not list.

---

[API](https://skmtc.dev/klara/apis/klara-public-api.md) · [All operations](https://skmtc.dev/klara/apis/klara-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/klara/apis/klara-public-api/revisions/490b1a879fc2?raw)
