---
title: "Pobierz listę faktur kosztowych z KSeF"
description: "Zakres: `api:invoices:read`. Faktury kosztowe wystawione na konto w KSeF."
---

> 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 › KSeF

`GET /ksef2/import/costs.json`

Zakres: `api:invoices:read`. Faktury kosztowe wystawione na konto w KSeF.

## Authentication

Requires one of the following:

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

## Query parameters

- `q[invoice_date_gteq]` (`Ksef_listPurchaseInvoices.query.q[invoice_date_gteq]`; string, optional)
  - format `date`
- `q[invoice_date_lteq]` (`Ksef_listPurchaseInvoices.query.q[invoice_date_lteq]`; string, optional)
  - format `date`
- `offset` (`Ksef_listPurchaseInvoices.query.offset`; integer, optional)
  - format `int32`; default `0`
- `limit` (`Ksef_listPurchaseInvoices.query.limit`; integer, optional)
  - format `int32`; default `20`
- `order` (`Ksef_listPurchaseInvoices.query.order`; string, optional) — `Asc` albo `Desc`.
  - one of `"Asc"`, `"Desc"`; default `"Desc"`

## Code samples

### cURL

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

### TypeScript

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

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

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

print(response.text)
```

## Responses

### 200

Sukces

#### Example

```json
{
  "entities": [
    {
      "ksef_number": "1234563218-20261001-0A1B2C3D4E5F-6A",
      "invoice_number": "FV/123/10/2026",
      "invoice_kind": "Vat",
      "invoice_date": "2026-10-01",
      "client_name": "Przykładowa Firma Jan Kowalski",
      "client_tax_code": "1234563218",
      "seller_name": "Dostawca Sp. z o.o.",
      "seller_tax_code": "5260250274",
      "gross_price": 12300,
      "net_price": 10000,
      "tax_price": 2300,
      "currency": "PLN",
      "schema_version": "1-0E",
      "created_at": "2026-10-01T10:15:30+02:00"
    }
  ]
}
```

- `entities` (`Ksef_listPurchaseInvoices.response.200.entities`; array<object>, required)
  - `ksef_number` (`Ksef_listPurchaseInvoices.response.200.entities.ksef_number`; string, required)
  - `invoice_number` (`Ksef_listPurchaseInvoices.response.200.entities.invoice_number`; any of, required)
    - any of: `string`, `null`
  - `invoice_kind` (`Ksef_listPurchaseInvoices.response.200.entities.invoice_kind`; any of, required)
    - any of: `string`, `null`
  - `invoice_date` (`Ksef_listPurchaseInvoices.response.200.entities.invoice_date`; any of, required)
    - any of: `string`, `null`
  - `client_name` (`Ksef_listPurchaseInvoices.response.200.entities.client_name`; any of, required)
    - any of: `string`, `null`
  - `client_tax_code` (`Ksef_listPurchaseInvoices.response.200.entities.client_tax_code`; any of, required)
    - any of: `string`, `null`
  - `seller_name` (`Ksef_listPurchaseInvoices.response.200.entities.seller_name`; any of, required)
    - any of: `string`, `null`
  - `seller_tax_code` (`Ksef_listPurchaseInvoices.response.200.entities.seller_tax_code`; any of, required)
    - any of: `string`, `null`
  - `gross_price` (`Ksef_listPurchaseInvoices.response.200.entities.gross_price`; any of, required)
    - any of: `Money`, `null`
  - `net_price` (`Ksef_listPurchaseInvoices.response.200.entities.net_price`; any of, required)
    - any of: `Money`, `null`
  - `tax_price` (`Ksef_listPurchaseInvoices.response.200.entities.tax_price`; any of, required)
    - any of: `Money`, `null`
  - `currency` (`Ksef_listPurchaseInvoices.response.200.entities.currency`; any of, required)
    - any of: `string`, `null`
  - `schema_version` (`Ksef_listPurchaseInvoices.response.200.entities.schema_version`; any of, required) — Wersja schemy FA, np. `1-0E`.
    - any of: `string`, `null`
  - `created_at` (`Ksef_listPurchaseInvoices.response.200.entities.created_at`; any of, required) — Czas przyjęcia faktury przez KSeF.
    - 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` (`Ksef_listPurchaseInvoices.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` (`Ksef_listPurchaseInvoices.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` (`Ksef_listPurchaseInvoices.response.401.limit`; string, optional) — Kod limitu planu, np. `limit_exceeded`, `plan_upgrade_needed`, `cant_add_client`.
- `type` (`Ksef_listPurchaseInvoices.response.401.type`; string, optional)
  - one of `"redirect"`, `"email_not_confirmed"`
- `url` (`Ksef_listPurchaseInvoices.response.401.url`; string, optional)
- `action_url` (`Ksef_listPurchaseInvoices.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` (`Ksef_listPurchaseInvoices.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` (`Ksef_listPurchaseInvoices.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` (`Ksef_listPurchaseInvoices.response.402.limit`; string, optional) — Kod limitu planu, np. `limit_exceeded`, `plan_upgrade_needed`, `cant_add_client`.
- `type` (`Ksef_listPurchaseInvoices.response.402.type`; string, optional)
  - one of `"redirect"`, `"email_not_confirmed"`
- `url` (`Ksef_listPurchaseInvoices.response.402.url`; string, optional)
- `action_url` (`Ksef_listPurchaseInvoices.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` (`Ksef_listPurchaseInvoices.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` (`Ksef_listPurchaseInvoices.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` (`Ksef_listPurchaseInvoices.response.406.limit`; string, optional) — Kod limitu planu, np. `limit_exceeded`, `plan_upgrade_needed`, `cant_add_client`.
- `type` (`Ksef_listPurchaseInvoices.response.406.type`; string, optional)
  - one of `"redirect"`, `"email_not_confirmed"`
- `url` (`Ksef_listPurchaseInvoices.response.406.url`; string, optional)
- `action_url` (`Ksef_listPurchaseInvoices.response.406.action_url`; string, optional)

### 422

Odrzucone przez usługę integracji z KSeF, np. brak aktywnej integracji.

#### Example

```json
{
  "result": "error",
  "data": null,
  "_meta": {
    "code": 0,
    "reason": "string",
    "message": "string",
    "errors": {}
  }
}
```

- `result` (`Ksef_listPurchaseInvoices.response.422.result`; string, required)
  - one of `"error"`
- `data` (`Ksef_listPurchaseInvoices.response.422.data`; null, required)
- `_meta` (`Ksef_listPurchaseInvoices.response.422._meta`; object, required)
  - `code` (`Ksef_listPurchaseInvoices.response.422._meta.code`; integer, required)
    - format `int32`
  - `reason` (`Ksef_listPurchaseInvoices.response.422._meta.reason`; string, required)
  - `message` (`Ksef_listPurchaseInvoices.response.422._meta.message`; string, required)
  - `errors` (`Ksef_listPurchaseInvoices.response.422._meta.errors`; any of, required)
    - any of: `object`, `null`

### 423

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

#### Example

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

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


Source: https://docs.niebieskiorzel.pl/api/ksef-list-purchase-invoices/index.md
