---
title: "Wyślij fakturę korygującą marża e-mailem"
description: "Zakres: `api:invoices:write`."
---

> 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 › Faktury korygujące marża

`POST /corrective_margin_invoices/{uuid}/deliver_via_email.json`

Zakres: `api:invoices:write`.

## Authentication

Requires one of the following:

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

## Path parameters

- `uuid` (`MarginCorrectiveInvoices_sendByEmail.path.uuid`; string, required)
  - format `uuid`

## Query parameters

- `allow_correction` (`MarginCorrectiveInvoices_sendByEmail.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._

- `recipient` (`MarginCorrectiveInvoices_sendByEmail.recipient`; string, optional) — Adresy rozdzielone przecinkami; domyślnie e-mail klienta.
- `print_type` (`MarginCorrectiveInvoices_sendByEmail.print_type`; string, optional)
  - one of `"original"`, `"copy"`, `"original_copy"`, `"original_duplicate"`, `"copy_duplicate"`, `"duplicate"`, `"regular"`, `"double_regular"`; default `"regular"`
- `locale` (`MarginCorrectiveInvoices_sendByEmail.locale`; string, optional)
  - one of `"pl"`, `"en"`, `"pe"`; default `"pl"`
- `send_copy` (`MarginCorrectiveInvoices_sendByEmail.send_copy`; boolean, optional) — Wyślij kopię do właściciela konta.
  - default `false`
- `content` (`MarginCorrectiveInvoices_sendByEmail.content`; string, optional) — Treść wiadomości.

## Example requests

### Wysłano

```json
{
  "recipient": "ksiegowosc@example.com"
}
```

## Code samples

### cURL

```bash
curl --request POST \
  --url https://api.sandbox-infakt.pl/v3/corrective_margin_invoices/0f1e2d3c-4b5a-4968-8778-6a5b4c3d2e1f/deliver_via_email.json \
  --header 'Content-Type: application/json' \
  --header 'X-inFakt-ApiKey: <X-inFakt-ApiKey>' \
  --data '
{
  "recipient": "ksiegowosc@example.com"
}
'
```

### TypeScript

```typescript
const url = 'https://api.sandbox-infakt.pl/v3/corrective_margin_invoices/0f1e2d3c-4b5a-4968-8778-6a5b4c3d2e1f/deliver_via_email.json';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json', 'X-inFakt-ApiKey': '<X-inFakt-ApiKey>'},
  body: JSON.stringify({recipient: 'ksiegowosc@example.com'})
};

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/corrective_margin_invoices/0f1e2d3c-4b5a-4968-8778-6a5b4c3d2e1f/deliver_via_email.json"

payload = { "recipient": "ksiegowosc@example.com" }
headers = {
    "Content-Type": "application/json",
    "X-inFakt-ApiKey": "<X-inFakt-ApiKey>"
}

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

print(response.text)
```

## Responses

### 202

Przyjęto do przetwarzania

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

### 404

Nie znaleziono zasobu.

#### Example

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

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


Source: https://docs.niebieskiorzel.pl/api/margin-corrective-invoices-send-by-email/index.md
