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

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

`GET /core/v1/invoices/next-invoice-number`

## Request

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

Returns the next available invoice number for the company resolved from the bearer JWT. The caller must hold the <code>FINANCE</code> permission on the target company. <strong>This operation is NOT idempotent</strong> — each successful call advances the persisted next-invoice-number counter on luzfin_finance, so the returned value is reserved and will not be returned again. Do not retry on success.

## Response `200`

Next available invoice number returned.

- NextInvoiceNumberResponse: Response wrapper for the next available invoice number for the authenticated company.
  - `nextInvoiceNumber` integer: The next available invoice number reserved for the authenticated company. Each successful call advances the persisted counter; the value is therefore unique per 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.
- `404`: Resource not found<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)
