---
title: "Zleć generowanie dokumentów w PDF"
description: "Zakres: `api:invoices:write`. Kolejkuje jeden ZIP z PDF-ami maksymalnie 100 dokumentów przychodowych. Zwraca `404`, gdy nie znaleziono\nżadnego z uuid, i `422` ze zwykłym komunikatem w `errors`, gdy brakuje `uuids` albo wyczerpano limit dokumentów\nw planie."
---

> 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 › Zadania asynchroniczne

`POST /async/incomes/pdf_many.json`

Zakres: `api:invoices:write`. Kolejkuje jeden ZIP z PDF-ami maksymalnie 100 dokumentów przychodowych. Zwraca `404`, gdy nie znaleziono
żadnego z uuid, i `422` ze zwykłym komunikatem w `errors`, gdy brakuje `uuids` albo wyczerpano limit dokumentów
w planie.

## 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` (`AsyncTasks_requestPdfBundle.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` (`AsyncTasks_requestPdfBundle.uuids`; any of, required) — Uuid dokumentów oddzielone przecinkami albo jako tablica; przetwarzanych jest najwyżej pierwszych 100. Przyjmowane są faktury przychodowe (poza `internal` i `fiscal_report`), dowody wewnętrzne, utargi dzienne i faktury OSS; pozostałe uuid trafiają do `rejected_uuids`.
  - any of: `string`, `array<unknown>`
- `document_type` (`AsyncTasks_requestPdfBundle.document_type`; string, optional)
  - one of `"original"`, `"copy"`, `"original_copy"`, `"original_duplicate"`, `"copy_duplicate"`, `"duplicate"`, `"regular"`, `"double_regular"`; default `"regular"`
- `locale` (`AsyncTasks_requestPdfBundle.locale`; string, optional)
  - one of `"pl"`, `"en"`, `"pe"`

## Example requests

### Zlecono generowanie

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

### Wykorzystany limit dokumentów

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

## Code samples

### cURL

```bash
curl --request POST \
  --url https://api.sandbox-infakt.pl/v3/async/incomes/pdf_many.json \
  --header 'Content-Type: application/json' \
  --header 'X-inFakt-ApiKey: <X-inFakt-ApiKey>' \
  --data '
{
  "uuids": "9bdc76fd-7a02-42ec-a4a3-42bc867b9a9f,00000000-0000-0000-0000-000000000000",
  "document_type": "original"
}
'
```

### TypeScript

```typescript
const url = 'https://api.sandbox-infakt.pl/v3/async/incomes/pdf_many.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,00000000-0000-0000-0000-000000000000',
    document_type: 'original'
  })
};

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/async/incomes/pdf_many.json"

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

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

print(response.text)
```

## Responses

### 201

Utworzono

#### Example

```json
{
  "download_token": "example-download-token",
  "accepted_uuids": [
    "9bdc76fd-7a02-42ec-a4a3-42bc867b9a9f"
  ],
  "rejected_uuids": [
    "00000000-0000-0000-0000-000000000000"
  ]
}
```

- `download_token` (`AsyncTasks_requestPdfBundle.response.201.download_token`; string, required) — Użyj w endpointach sprawdzania i pobierania.
- `accepted_uuids` (`AsyncTasks_requestPdfBundle.response.201.accepted_uuids`; array<string>, required)
  - format `uuid`
- `rejected_uuids` (`AsyncTasks_requestPdfBundle.response.201.rejected_uuids`; array<string>, required)

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

### 404

Nie znaleziono zasobu.

#### Example

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

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

### 422

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

#### Example

```json
{
  "errors": "Limit dokumentów w abonamencie został wyczerpany."
}
```

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


Source: https://docs.niebieskiorzel.pl/api/async-tasks-request-pdf-bundle/index.md
