---
title: "Pobierz następny numer faktury"
description: "Zakres: `api:invoices:read`. Numer, który otrzyma następna faktura danego rodzaju."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.niebieskiorzel.pl/llms.txt
> Use this file to discover all available pages before exploring further.

Path: inFakt API › Faktury VAT

`GET /invoices/next_number.json`

Zakres: `api:invoices:read`. Numer, który otrzyma następna faktura danego rodzaju.

## Authentication

Requires one of the following:

- `ApiKey`, apiKey, in header, header `X-inFakt-ApiKey`
- `Token`, apiKey, in header, header `X-Token`

## Query parameters

- `kind` (`Invoices_getNextNumber.query.kind`; string, required)
  - one of `"vat"`, `"proforma"`, `"margin"`, `"advance"`, `"correction"`, `"margin_correction"`, `"margin_advance"`, `"final"`, `"margin_final"`, `"fiscal_report"`, `"internal"`
- `date` (`Invoices_getNextNumber.query.date`; string, optional) — Domyślnie dzisiejsza data.
  - format `date`

## Code samples

### cURL

```bash
curl --request GET \
  --url 'https://api.sandbox-infakt.pl/v3/invoices/next_number.json?kind=vat' \
  --header 'X-inFakt-ApiKey: <X-inFakt-ApiKey>'
```

### TypeScript

```typescript
const url = 'https://api.sandbox-infakt.pl/v3/invoices/next_number.json?kind=vat';
const options = {method: 'GET', headers: {'X-inFakt-ApiKey': '<X-inFakt-ApiKey>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.sandbox-infakt.pl/v3/invoices/next_number.json?kind=vat"

headers = {"X-inFakt-ApiKey": "<X-inFakt-ApiKey>"}

response = requests.get(url, headers=headers)

print(response.text)
```

## Responses

### 200

Sukces

#### Example

```json
{
  "next_number": "2/10/2026",
  "invoice_date": "2026-10-01",
  "invoice_kind": "vat"
}
```

- `next_number` (`Invoices_getNextNumber.response.200.next_number`; string, required)
- `invoice_date` (`Invoices_getNextNumber.response.200.invoice_date`; string, required)
  - format `date`
- `invoice_kind` (`Invoices_getNextNumber.response.200.invoice_kind`; string, required)
  - one of `"vat"`, `"proforma"`, `"margin"`, `"advance"`, `"correction"`, `"margin_correction"`, `"margin_advance"`, `"final"`, `"margin_final"`, `"fiscal_report"`, `"internal"`

### 401

Brak klucza API, nieprawidłowy klucz albo klucz bez wymaganego zakresu uprawnień.

#### Example

```json
{
  "error": "Zasób którego szukasz nie został znaleziony."
}
```

- `error` (`Invoices_getNextNumber.response.401.error`; any of, optional) — Komunikat po polsku (po angielsku dla `429`). Niektóre akcje zamiast jednego tekstu zwracają listę komunikatów albo błędy walidacji według pól.
  - any of: `string`, `array<string>`, `object`
- `errors` (`Invoices_getNextNumber.response.401.errors`; any of, optional) — Błędy walidacji według nazw pól API; na niektórych endpointach zwykły komunikat.
  - any of: `object`, `string`
- `limit` (`Invoices_getNextNumber.response.401.limit`; string, optional) — Kod limitu planu, np. `limit_exceeded`, `plan_upgrade_needed`, `cant_add_client`.
- `type` (`Invoices_getNextNumber.response.401.type`; string, optional)
  - one of `"redirect"`, `"email_not_confirmed"`
- `url` (`Invoices_getNextNumber.response.401.url`; string, optional)
- `action_url` (`Invoices_getNextNumber.response.401.action_url`; string, optional)

### 402

API niedostępne w obecnym planie (`limit: plan_upgrade_needed`) albo osiągnięty limit dokumentów.

#### Example

```json
{
  "error": "Zasób którego szukasz nie został znaleziony."
}
```

- `error` (`Invoices_getNextNumber.response.402.error`; any of, optional) — Komunikat po polsku (po angielsku dla `429`). Niektóre akcje zamiast jednego tekstu zwracają listę komunikatów albo błędy walidacji według pól.
  - any of: `string`, `array<string>`, `object`
- `errors` (`Invoices_getNextNumber.response.402.errors`; any of, optional) — Błędy walidacji według nazw pól API; na niektórych endpointach zwykły komunikat.
  - any of: `object`, `string`
- `limit` (`Invoices_getNextNumber.response.402.limit`; string, optional) — Kod limitu planu, np. `limit_exceeded`, `plan_upgrade_needed`, `cant_add_client`.
- `type` (`Invoices_getNextNumber.response.402.type`; string, optional)
  - one of `"redirect"`, `"email_not_confirmed"`
- `url` (`Invoices_getNextNumber.response.402.url`; string, optional)
- `action_url` (`Invoices_getNextNumber.response.402.action_url`; string, optional)

### 406

Ścieżka nie kończy się na `.json`.

#### Example

```json
{
  "error": "Zasób którego szukasz nie został znaleziony."
}
```

- `error` (`Invoices_getNextNumber.response.406.error`; any of, optional) — Komunikat po polsku (po angielsku dla `429`). Niektóre akcje zamiast jednego tekstu zwracają listę komunikatów albo błędy walidacji według pól.
  - any of: `string`, `array<string>`, `object`
- `errors` (`Invoices_getNextNumber.response.406.errors`; any of, optional) — Błędy walidacji według nazw pól API; na niektórych endpointach zwykły komunikat.
  - any of: `object`, `string`
- `limit` (`Invoices_getNextNumber.response.406.limit`; string, optional) — Kod limitu planu, np. `limit_exceeded`, `plan_upgrade_needed`, `cant_add_client`.
- `type` (`Invoices_getNextNumber.response.406.type`; string, optional)
  - one of `"redirect"`, `"email_not_confirmed"`
- `url` (`Invoices_getNextNumber.response.406.url`; string, optional)
- `action_url` (`Invoices_getNextNumber.response.406.action_url`; string, optional)

### 422

Walidacja nie powiodła się; szczegóły w `errors`.

#### Example

```json
{
  "error": "Zasób którego szukasz nie został znaleziony."
}
```

- `error` (`Invoices_getNextNumber.response.422.error`; any of, optional) — Komunikat po polsku (po angielsku dla `429`). Niektóre akcje zamiast jednego tekstu zwracają listę komunikatów albo błędy walidacji według pól.
  - any of: `string`, `array<string>`, `object`
- `errors` (`Invoices_getNextNumber.response.422.errors`; any of, optional) — Błędy walidacji według nazw pól API; na niektórych endpointach zwykły komunikat.
  - any of: `object`, `string`
- `limit` (`Invoices_getNextNumber.response.422.limit`; string, optional) — Kod limitu planu, np. `limit_exceeded`, `plan_upgrade_needed`, `cant_add_client`.
- `type` (`Invoices_getNextNumber.response.422.type`; string, optional)
  - one of `"redirect"`, `"email_not_confirmed"`
- `url` (`Invoices_getNextNumber.response.422.url`; string, optional)
- `action_url` (`Invoices_getNextNumber.response.422.action_url`; string, optional)

### 423

Niepotwierdzony adres e-mail albo wymagana weryfikacja tożsamości.

#### Example

```json
{
  "error": "Zasób którego szukasz nie został znaleziony."
}
```

- `error` (`Invoices_getNextNumber.response.423.error`; any of, optional) — Komunikat po polsku (po angielsku dla `429`). Niektóre akcje zamiast jednego tekstu zwracają listę komunikatów albo błędy walidacji według pól.
  - any of: `string`, `array<string>`, `object`
- `errors` (`Invoices_getNextNumber.response.423.errors`; any of, optional) — Błędy walidacji według nazw pól API; na niektórych endpointach zwykły komunikat.
  - any of: `object`, `string`
- `limit` (`Invoices_getNextNumber.response.423.limit`; string, optional) — Kod limitu planu, np. `limit_exceeded`, `plan_upgrade_needed`, `cant_add_client`.
- `type` (`Invoices_getNextNumber.response.423.type`; string, optional)
  - one of `"redirect"`, `"email_not_confirmed"`
- `url` (`Invoices_getNextNumber.response.423.url`; string, optional)
- `action_url` (`Invoices_getNextNumber.response.423.action_url`; string, optional)

### 429

Przekroczony limit zapytań. Komunikat jest po angielsku, np. `API rate limit exceeded. Try again in 60 seconds.`

#### Example

```json
{
  "error": "Zasób którego szukasz nie został znaleziony."
}
```

- `error` (`Invoices_getNextNumber.response.429.error`; any of, optional) — Komunikat po polsku (po angielsku dla `429`). Niektóre akcje zamiast jednego tekstu zwracają listę komunikatów albo błędy walidacji według pól.
  - any of: `string`, `array<string>`, `object`
- `errors` (`Invoices_getNextNumber.response.429.errors`; any of, optional) — Błędy walidacji według nazw pól API; na niektórych endpointach zwykły komunikat.
  - any of: `object`, `string`
- `limit` (`Invoices_getNextNumber.response.429.limit`; string, optional) — Kod limitu planu, np. `limit_exceeded`, `plan_upgrade_needed`, `cant_add_client`.
- `type` (`Invoices_getNextNumber.response.429.type`; string, optional)
  - one of `"redirect"`, `"email_not_confirmed"`
- `url` (`Invoices_getNextNumber.response.429.url`; string, optional)
- `action_url` (`Invoices_getNextNumber.response.429.action_url`; string, optional)


Source: https://docs.niebieskiorzel.pl/api/invoices-get-next-number/index.md
