---
title: "Oznacz koszty jako opłacone"
description: "Zakres: `api:costs:write`. Koszty i skany dokumentów. Z `uuids` i włączonym automatycznym księgowaniem różnic kursowych\nkoszty w walucie obcej są pomijane i zgłaszane jako `failure`; oznaczaj je pojedynczo przez `uuid`."
---

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

`PUT /documents/costs/paid_many.json`

Zakres: `api:costs:write`. Koszty i skany dokumentów. Z `uuids` i włączonym automatycznym księgowaniem różnic kursowych
koszty w walucie obcej są pomijane i zgłaszane jako `failure`; oznaczaj je pojedynczo przez `uuid`.

## Authentication

Requires one of the following:

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

## Request body

_Required._

- `uuids` (`CostDocuments_markPaidMany.uuids`; string, optional) — Identyfikatory uuid oddzielone przecinkami.
- `uuid` (`CostDocuments_markPaidMany.uuid`; string, optional)
  - format `uuid`
- `allow_correction` (`CostDocuments_markPaidMany.allow_correction`; boolean, optional) — Potwierdza zmianę, gdy dotyczy zamkniętego okresu księgowego; w przeciwnym razie `422`. Przyjmowane też jako parametr zapytania.
- `paid_on` (`CostDocuments_markPaidMany.paid_on`; string, optional) — Domyślnie dzisiaj; z `calculate_exchange_difference` nie może być datą przyszłą.
  - format `date`
- `calculate_exchange_difference` (`CostDocuments_markPaidMany.calculate_exchange_difference`; boolean, optional) — Zaksięguj różnicę kursową kosztu w walucie obcej. Tylko z `uuid`; z `uuids` zwraca `422`.
  - default `false`
- `payment_currency` (`CostDocuments_markPaidMany.payment_currency`; string, optional) — Waluta płatności; wymagana z `calculate_exchange_difference`.
- `received_amount` (`CostDocuments_markPaidMany.received_amount`; integer, optional) — Kwota faktycznie zapłacona, w groszach; wymagana (większa od 0), gdy `payment_currency` to `PLN`.
  - format `int64`

## Example requests

### Opłacono

```json
{
  "uuids": "2f6e8a1c-3b4d-4e5f-9a6b-7c8d9e0f1a2b",
  "paid_on": "2026-10-10"
}
```

### Opłacono w PLN z różnicą kursową

```json
{
  "uuid": "5a6b7c8d-9e0f-4a1b-8c2d-3e4f5a6b7c8d",
  "paid_on": "2026-10-10",
  "calculate_exchange_difference": true,
  "payment_currency": "PLN",
  "received_amount": 43150
}
```

### Różnica kursowa z uuid

```json
{
  "uuids": "2f6e8a1c-3b4d-4e5f-9a6b-7c8d9e0f1a2b,5a6b7c8d-9e0f-4a1b-8c2d-3e4f5a6b7c8d",
  "calculate_exchange_difference": true,
  "payment_currency": "PLN",
  "received_amount": 43150
}
```

### Zamknięty okres, brak allow_correction

```json
{
  "uuid": "2f6e8a1c-3b4d-4e5f-9a6b-7c8d9e0f1a2b"
}
```

## Code samples

### cURL

```bash
curl --request PUT \
  --url https://api.sandbox-infakt.pl/v3/documents/costs/paid_many.json \
  --header 'Content-Type: application/json' \
  --header 'X-inFakt-ApiKey: <X-inFakt-ApiKey>' \
  --data '
{
  "uuids": "2f6e8a1c-3b4d-4e5f-9a6b-7c8d9e0f1a2b",
  "paid_on": "2026-10-10"
}
'
```

### TypeScript

```typescript
const url = 'https://api.sandbox-infakt.pl/v3/documents/costs/paid_many.json';
const options = {
  method: 'PUT',
  headers: {'Content-Type': 'application/json', 'X-inFakt-ApiKey': '<X-inFakt-ApiKey>'},
  body: JSON.stringify({uuids: '2f6e8a1c-3b4d-4e5f-9a6b-7c8d9e0f1a2b', paid_on: '2026-10-10'})
};

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

payload = {
    "uuids": "2f6e8a1c-3b4d-4e5f-9a6b-7c8d9e0f1a2b",
    "paid_on": "2026-10-10"
}
headers = {
    "Content-Type": "application/json",
    "X-inFakt-ApiKey": "<X-inFakt-ApiKey>"
}

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

print(response.text)
```

## Responses

### 200

Sukces

#### Example

```json
{
  "success": true,
  "entities": [
    {
      "uuid": "2f6e8a1c-3b4d-4e5f-9a6b-7c8d9e0f1a2b",
      "number": "FV/123/10/2026",
      "status": "success"
    }
  ]
}
```

- `success` (`CostDocuments_markPaidMany.response.200.success`; boolean, required) — `true`, gdy operacja powiodła się dla wszystkich dokumentów.
- `entities` (`CostDocuments_markPaidMany.response.200.entities`; array<object>, required)
  - `uuid` (`CostDocuments_markPaidMany.response.200.entities.uuid`; string, required) — Uuid dokumentu; dla nieznalezionego uuid wartość taka, jak wysłano.
  - `number` (`CostDocuments_markPaidMany.response.200.entities.number`; string, required) — `""` dla nieznalezionego uuid.
  - `status` (`CostDocuments_markPaidMany.response.200.entities.status`; string, required)
    - one of `"success"`, `"failure"`

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

### 422

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

#### Example

```json
{
  "errors": {
    "calculate_exchange_difference": [
      "Nie można rozliczyć różnic kursowych dla tej akcji."
    ]
  }
}
```

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


Source: https://docs.niebieskiorzel.pl/api/cost-documents-mark-paid-many/index.md
