---
title: "Pobierz miesiąc KPiR"
description: "Zakres: `api:accounting:read`. Wpisy KPiR z jednego miesiąca."
---

> 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 › Księga przychodów i rozchodów

`GET /books/{id}.json`

Zakres: `api:accounting:read`. Wpisy KPiR z jednego miesiąca.

## Authentication

Requires one of the following:

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

## Path parameters

- `id` (`Ledger_get.path.id`; integer, required)
  - format `int64`

## Query parameters

- `fields` (`Ledger_get.query.fields`; string, optional) — Zawężenie pól: nazwy pól API rozdzielone przecinkami, np. `id,company_name`; `id` jest zwykle dodawane. Odpowiedź zawiera wtedy tylko te pola, więc nie odpowiada pełnemu schematowi. Pola wyliczane, a nie zapisywane, mogą kończyć się błędem `500`; operacja je wymienia.

## Code samples

### cURL

```bash
curl --request GET \
  --url https://api.sandbox-infakt.pl/v3/books/0.json \
  --header 'X-inFakt-ApiKey: <X-inFakt-ApiKey>'
```

### TypeScript

```typescript
const url = 'https://api.sandbox-infakt.pl/v3/books/0.json';
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/books/0.json"

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

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

print(response.text)
```

## Responses

### 200

Sukces

#### Example

```json
{
  "id": 1002,
  "period": "2026-09-01",
  "date": "2026-09-01",
  "period_name": "Wrzesień 2026",
  "company": {
    "name": "Przykładowa Firma Jan Kowalski",
    "taxid": "123-456-32-18",
    "full_address": "Lwowska 10/17, 31-202 Kraków"
  },
  "transfered": {
    "income_cargo_services": 0,
    "income_others": 0,
    "income_summary": 0,
    "expense_cargo_material": 0,
    "expense_incidental": 0,
    "expense_salary": 0,
    "expense_others": 0,
    "expense_sum": 0,
    "expense_research": 0
  },
  "lines": [
    {
      "ordinal": 1,
      "date": "2026-09-05",
      "number": "1/09/2026",
      "client_name": "Pierwsza Testowa Spółka sp z o.o.",
      "client_address": "Lwowska 10/17, 31-202 Kraków",
      "description": "Sprzedaż usług",
      "income_cargo_services": 1000000,
      "income_others": 0,
      "income_summary": 1000000,
      "expense_cargo_material": 0,
      "expense_incidental": 0,
      "expense_salary": 0,
      "expense_others": 0,
      "expense_sum": 0,
      "expense_research": 0
    },
    {
      "ordinal": 2,
      "date": "2026-09-30",
      "number": "9/A/2026",
      "client_name": null,
      "client_address": null,
      "description": "Amortyzacja",
      "income_cargo_services": 0,
      "income_others": 0,
      "income_summary": 0,
      "expense_cargo_material": 0,
      "expense_incidental": 0,
      "expense_salary": 0,
      "expense_others": 50000,
      "expense_sum": 50000,
      "expense_research": 0
    }
  ]
}
```

- `id` (`Ledger_get.response.200.id`; integer, required)
  - format `int64`
- `period` (`Ledger_get.response.200.period`; string, required)
  - format `date`
- `date` (`Ledger_get.response.200.date`; string, required) — To samo co `period`.
  - format `date`
- `period_name` (`Ledger_get.response.200.period_name`; string, required)
- `company` (`Ledger_get.response.200.company`; object, required)
  - `name` (`Ledger_get.response.200.company.name`; string, required)
  - `taxid` (`Ledger_get.response.200.company.taxid`; string, required)
  - `full_address` (`Ledger_get.response.200.company.full_address`; string, required)
- `transfered` (`Ledger_get.response.200.transfered`; object, required) — Sumy przeniesione z poprzednich miesięcy.
  - `income_cargo_services` (`Ledger_get.response.200.transfered.income_cargo_services`; integer, required) — Kwota w groszach (1/100 PLN). `12300` oznacza 123,00 PLN.
    - format `int64`
  - `income_others` (`Ledger_get.response.200.transfered.income_others`; integer, required) — Kwota w groszach (1/100 PLN). `12300` oznacza 123,00 PLN.
    - format `int64`
  - `income_summary` (`Ledger_get.response.200.transfered.income_summary`; integer, required) — Kwota w groszach (1/100 PLN). `12300` oznacza 123,00 PLN.
    - format `int64`
  - `expense_cargo_material` (`Ledger_get.response.200.transfered.expense_cargo_material`; integer, required) — Kwota w groszach (1/100 PLN). `12300` oznacza 123,00 PLN.
    - format `int64`
  - `expense_incidental` (`Ledger_get.response.200.transfered.expense_incidental`; integer, required) — Kwota w groszach (1/100 PLN). `12300` oznacza 123,00 PLN.
    - format `int64`
  - `expense_salary` (`Ledger_get.response.200.transfered.expense_salary`; integer, required) — Kwota w groszach (1/100 PLN). `12300` oznacza 123,00 PLN.
    - format `int64`
  - `expense_others` (`Ledger_get.response.200.transfered.expense_others`; integer, required) — Kwota w groszach (1/100 PLN). `12300` oznacza 123,00 PLN.
    - format `int64`
  - `expense_sum` (`Ledger_get.response.200.transfered.expense_sum`; integer, required) — Kwota w groszach (1/100 PLN). `12300` oznacza 123,00 PLN.
    - format `int64`
  - `expense_research` (`Ledger_get.response.200.transfered.expense_research`; integer, required) — Kwota w groszach (1/100 PLN). `12300` oznacza 123,00 PLN.
    - format `int64`
- `lines` (`Ledger_get.response.200.lines`; array<object>, required)
  - `income_cargo_services` (`Ledger_get.response.200.lines.income_cargo_services`; integer, required) — Kwota w groszach (1/100 PLN). `12300` oznacza 123,00 PLN.
    - format `int64`
  - `income_others` (`Ledger_get.response.200.lines.income_others`; integer, required) — Kwota w groszach (1/100 PLN). `12300` oznacza 123,00 PLN.
    - format `int64`
  - `income_summary` (`Ledger_get.response.200.lines.income_summary`; integer, required) — Kwota w groszach (1/100 PLN). `12300` oznacza 123,00 PLN.
    - format `int64`
  - `expense_cargo_material` (`Ledger_get.response.200.lines.expense_cargo_material`; integer, required) — Kwota w groszach (1/100 PLN). `12300` oznacza 123,00 PLN.
    - format `int64`
  - `expense_incidental` (`Ledger_get.response.200.lines.expense_incidental`; integer, required) — Kwota w groszach (1/100 PLN). `12300` oznacza 123,00 PLN.
    - format `int64`
  - `expense_salary` (`Ledger_get.response.200.lines.expense_salary`; integer, required) — Kwota w groszach (1/100 PLN). `12300` oznacza 123,00 PLN.
    - format `int64`
  - `expense_others` (`Ledger_get.response.200.lines.expense_others`; integer, required) — Kwota w groszach (1/100 PLN). `12300` oznacza 123,00 PLN.
    - format `int64`
  - `expense_sum` (`Ledger_get.response.200.lines.expense_sum`; integer, required) — Kwota w groszach (1/100 PLN). `12300` oznacza 123,00 PLN.
    - format `int64`
  - `expense_research` (`Ledger_get.response.200.lines.expense_research`; integer, required) — Kwota w groszach (1/100 PLN). `12300` oznacza 123,00 PLN.
    - format `int64`
  - `ordinal` (`Ledger_get.response.200.lines.ordinal`; any of, required)
    - any of: `integer`, `null`
  - `date` (`Ledger_get.response.200.lines.date`; any of, required)
    - any of: `string`, `null`
  - `number` (`Ledger_get.response.200.lines.number`; any of, required)
    - any of: `string`, `null`
  - `client_name` (`Ledger_get.response.200.lines.client_name`; any of, required)
    - any of: `string`, `null`
  - `client_address` (`Ledger_get.response.200.lines.client_address`; any of, required)
    - any of: `string`, `null`
  - `description` (`Ledger_get.response.200.lines.description`; any of, required)
    - any of: `string`, `null`

### 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` (`Ledger_get.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` (`Ledger_get.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` (`Ledger_get.response.401.limit`; string, optional) — Kod limitu planu, np. `limit_exceeded`, `plan_upgrade_needed`, `cant_add_client`.
- `type` (`Ledger_get.response.401.type`; string, optional)
  - one of `"redirect"`, `"email_not_confirmed"`
- `url` (`Ledger_get.response.401.url`; string, optional)
- `action_url` (`Ledger_get.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` (`Ledger_get.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` (`Ledger_get.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` (`Ledger_get.response.402.limit`; string, optional) — Kod limitu planu, np. `limit_exceeded`, `plan_upgrade_needed`, `cant_add_client`.
- `type` (`Ledger_get.response.402.type`; string, optional)
  - one of `"redirect"`, `"email_not_confirmed"`
- `url` (`Ledger_get.response.402.url`; string, optional)
- `action_url` (`Ledger_get.response.402.action_url`; string, optional)

### 403

Brak uprawnień, limit planu dla tej akcji (`limit`) albo zawieszone konto.

#### Example

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

- `error` (`Ledger_get.response.403.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` (`Ledger_get.response.403.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` (`Ledger_get.response.403.limit`; string, optional) — Kod limitu planu, np. `limit_exceeded`, `plan_upgrade_needed`, `cant_add_client`.
- `type` (`Ledger_get.response.403.type`; string, optional)
  - one of `"redirect"`, `"email_not_confirmed"`
- `url` (`Ledger_get.response.403.url`; string, optional)
- `action_url` (`Ledger_get.response.403.action_url`; string, optional)

### 404

Nie znaleziono zasobu.

#### Example

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

- `error` (`Ledger_get.response.404.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` (`Ledger_get.response.404.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` (`Ledger_get.response.404.limit`; string, optional) — Kod limitu planu, np. `limit_exceeded`, `plan_upgrade_needed`, `cant_add_client`.
- `type` (`Ledger_get.response.404.type`; string, optional)
  - one of `"redirect"`, `"email_not_confirmed"`
- `url` (`Ledger_get.response.404.url`; string, optional)
- `action_url` (`Ledger_get.response.404.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` (`Ledger_get.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` (`Ledger_get.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` (`Ledger_get.response.406.limit`; string, optional) — Kod limitu planu, np. `limit_exceeded`, `plan_upgrade_needed`, `cant_add_client`.
- `type` (`Ledger_get.response.406.type`; string, optional)
  - one of `"redirect"`, `"email_not_confirmed"`
- `url` (`Ledger_get.response.406.url`; string, optional)
- `action_url` (`Ledger_get.response.406.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` (`Ledger_get.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` (`Ledger_get.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` (`Ledger_get.response.423.limit`; string, optional) — Kod limitu planu, np. `limit_exceeded`, `plan_upgrade_needed`, `cant_add_client`.
- `type` (`Ledger_get.response.423.type`; string, optional)
  - one of `"redirect"`, `"email_not_confirmed"`
- `url` (`Ledger_get.response.423.url`; string, optional)
- `action_url` (`Ledger_get.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` (`Ledger_get.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` (`Ledger_get.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` (`Ledger_get.response.429.limit`; string, optional) — Kod limitu planu, np. `limit_exceeded`, `plan_upgrade_needed`, `cant_add_client`.
- `type` (`Ledger_get.response.429.type`; string, optional)
  - one of `"redirect"`, `"email_not_confirmed"`
- `url` (`Ledger_get.response.429.url`; string, optional)
- `action_url` (`Ledger_get.response.429.action_url`; string, optional)


Source: https://docs.niebieskiorzel.pl/api/ledger-get/index.md
