---
title: "Wyślij faktury do KSeF"
description: "Zakres: `api:invoices:write`. Kolejkuje faktury do wysyłki do KSeF. Zwraca `207`, gdy co najmniej jedna faktura została odrzucona\n(`status: rejected`, `request_uuid: null`), i `404`, gdy żaden z uuid nie jest fakturą konta."
---

> 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

`POST /ksef2/documents/send.json`

Zakres: `api:invoices:write`. Kolejkuje faktury do wysyłki do KSeF. Zwraca `207`, gdy co najmniej jedna faktura została odrzucona
(`status: rejected`, `request_uuid: null`), i `404`, gdy żaden z uuid nie jest fakturą konta.

## Authentication

Requires one of the following:

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

## Query parameters

- `allow_correction` (`Ksef_sendInvoices.query.allow_correction`; boolean, optional) — Potwierdź akcję, która skoryguje złożone deklaracje (zamknięty okres księgowy). Bez tego takie żądania zwracają `422` z `errors.allow_correction` albo `errors.locked_accounting`, gdy plan nie pozwala na korekty (wtedy ta flaga jest ignorowana). Można też podać w treści żądania.

## Request body

_Required._

- `uuids` (`Ksef_sendInvoices.uuids`; any of, required) — Identyfikatory uuid faktur oddzielone przecinkami albo tablica.
  - any of: `string`, `array<unknown>`

## Example requests

### Wszystkie w kolejce

```json
{
  "uuids": [
    "9bdc76fd-7a02-42ec-a4a3-42bc867b9a9f"
  ]
}
```

### Jeden odrzucony

```json
{
  "uuids": "9bdc76fd-7a02-42ec-a4a3-42bc867b9a9f,00000000-0000-0000-0000-000000000000"
}
```

### Brak pasującej faktury

```json
{
  "uuids": "00000000-0000-0000-0000-000000000000"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url https://api.sandbox-infakt.pl/v3/ksef2/documents/send.json \
  --header 'Content-Type: application/json' \
  --header 'X-inFakt-ApiKey: <X-inFakt-ApiKey>' \
  --data '
{
  "uuids": [
    "9bdc76fd-7a02-42ec-a4a3-42bc867b9a9f"
  ]
}
'
```

### TypeScript

```typescript
const url = 'https://api.sandbox-infakt.pl/v3/ksef2/documents/send.json';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', 'X-inFakt-ApiKey': '<X-inFakt-ApiKey>'},
  body: JSON.stringify({uuids: ['9bdc76fd-7a02-42ec-a4a3-42bc867b9a9f']})
};

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/documents/send.json"

payload = { "uuids": ["9bdc76fd-7a02-42ec-a4a3-42bc867b9a9f"] }
headers = {
    "Content-Type": "application/json",
    "X-inFakt-ApiKey": "<X-inFakt-ApiKey>"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

Sukces

#### Example

```json
{
  "entities": [
    {
      "request_uuid": "7d6c5b4a-3e2f-4a1b-9c8d-0e1f2a3b4c5d",
      "invoice_uuid": "9bdc76fd-7a02-42ec-a4a3-42bc867b9a9f",
      "invoice_kind": "vat",
      "ksef_number": null,
      "status": "pending",
      "status_description": "Faktura oczekuje na wysłanie do KSeF.",
      "timestamps": {
        "request_created_at": "2026-10-02 12:00:00 +0200",
        "request_finished_at": "2026-10-02 12:00:00 +0200"
      }
    }
  ]
}
```

- `entities` (`Ksef_sendInvoices.response.200.entities`; array<object>, required)
  - `request_uuid` (`Ksef_sendInvoices.response.200.entities.request_uuid`; any of, required) — `null` dla faktur odrzuconych przed wysyłką.
    - any of: `string`, `null`
  - `invoice_uuid` (`Ksef_sendInvoices.response.200.entities.invoice_uuid`; any of, required)
    - any of: `Uuid`, `null`
  - `invoice_kind` (`Ksef_sendInvoices.response.200.entities.invoice_kind`; any of, required)
    - any of: `InvoiceKind`, `null`
  - `ksef_number` (`Ksef_sendInvoices.response.200.entities.ksef_number`; any of, required) — Numer KSeF nadany po przyjęciu.
    - any of: `string`, `null`
  - `status` (`Ksef_sendInvoices.response.200.entities.status`; string, required) — `rejected` tylko w odpowiedziach zbiorczych, dla dokumentów, których w ogóle nie wysłano.
    - one of `"pending"`, `"sent"`, `"success"`, `"error"`, `"cancelled"`, `"rejected"`
  - `status_description` (`Ksef_sendInvoices.response.200.entities.status_description`; any of, required)
    - any of: `string`, `null`
  - `timestamps` (`Ksef_sendInvoices.response.200.entities.timestamps`; object, required)
    - `request_created_at` (`Ksef_sendInvoices.response.200.entities.timestamps.request_created_at`; string, required)
    - `request_finished_at` (`Ksef_sendInvoices.response.200.entities.timestamps.request_finished_at`; any of, required)
      - any of: `string`, `null`

### 207

Część faktur została odrzucona; szczegóły w `entities`.

#### Example

```json
{
  "entities": [
    {
      "request_uuid": "7d6c5b4a-3e2f-4a1b-9c8d-0e1f2a3b4c5d",
      "invoice_uuid": "9bdc76fd-7a02-42ec-a4a3-42bc867b9a9f",
      "invoice_kind": "vat",
      "ksef_number": null,
      "status": "pending",
      "status_description": "Faktura oczekuje na wysłanie do KSeF.",
      "timestamps": {
        "request_created_at": "2026-10-02 12:00:00 +0200",
        "request_finished_at": "2026-10-02 12:00:00 +0200"
      }
    },
    {
      "request_uuid": null,
      "invoice_uuid": "00000000-0000-0000-0000-000000000000",
      "invoice_kind": null,
      "ksef_number": null,
      "status": "rejected",
      "status_description": "Faktura nie może zostać wysłana do KSeF.",
      "timestamps": {
        "request_created_at": "2026-10-02 12:00:00 +0200",
        "request_finished_at": null
      }
    }
  ]
}
```

- `entities` (`Ksef_sendInvoices.response.207.entities`; array<object>, required)
  - `request_uuid` (`Ksef_sendInvoices.response.207.entities.request_uuid`; any of, required) — `null` dla faktur odrzuconych przed wysyłką.
    - any of: `string`, `null`
  - `invoice_uuid` (`Ksef_sendInvoices.response.207.entities.invoice_uuid`; any of, required)
    - any of: `Uuid`, `null`
  - `invoice_kind` (`Ksef_sendInvoices.response.207.entities.invoice_kind`; any of, required)
    - any of: `InvoiceKind`, `null`
  - `ksef_number` (`Ksef_sendInvoices.response.207.entities.ksef_number`; any of, required) — Numer KSeF nadany po przyjęciu.
    - any of: `string`, `null`
  - `status` (`Ksef_sendInvoices.response.207.entities.status`; string, required) — `rejected` tylko w odpowiedziach zbiorczych, dla dokumentów, których w ogóle nie wysłano.
    - one of `"pending"`, `"sent"`, `"success"`, `"error"`, `"cancelled"`, `"rejected"`
  - `status_description` (`Ksef_sendInvoices.response.207.entities.status_description`; any of, required)
    - any of: `string`, `null`
  - `timestamps` (`Ksef_sendInvoices.response.207.entities.timestamps`; object, required)
    - `request_created_at` (`Ksef_sendInvoices.response.207.entities.timestamps.request_created_at`; string, required)
    - `request_finished_at` (`Ksef_sendInvoices.response.207.entities.timestamps.request_finished_at`; 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` (`Ksef_sendInvoices.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_sendInvoices.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_sendInvoices.response.401.limit`; string, optional) — Kod limitu planu, np. `limit_exceeded`, `plan_upgrade_needed`, `cant_add_client`.
- `type` (`Ksef_sendInvoices.response.401.type`; string, optional)
  - one of `"redirect"`, `"email_not_confirmed"`
- `url` (`Ksef_sendInvoices.response.401.url`; string, optional)
- `action_url` (`Ksef_sendInvoices.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_sendInvoices.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_sendInvoices.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_sendInvoices.response.402.limit`; string, optional) — Kod limitu planu, np. `limit_exceeded`, `plan_upgrade_needed`, `cant_add_client`.
- `type` (`Ksef_sendInvoices.response.402.type`; string, optional)
  - one of `"redirect"`, `"email_not_confirmed"`
- `url` (`Ksef_sendInvoices.response.402.url`; string, optional)
- `action_url` (`Ksef_sendInvoices.response.402.action_url`; string, optional)

### 404

Nie znaleziono zasobu.

#### Example

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

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


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