---
title: "Предпросмотр пакетной отправки документов продаж"
method: POST
path: "/api/v1/docflow/flow/batch-send/preview"
tags: ["Docflow flow"]
---

# Предпросмотр пакетной отправки документов продаж

`POST /api/v1/docflow/flow/batch-send/preview`

## Request

- Base URL: `https://erp.akeda.ru`
- URL: `https://erp.akeda.ru/api/v1/docflow/flow/batch-send/preview`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-Api-Key`
  - OAuth 2
    - Authorization code: `https://erp.akeda.ru/oauth2/authorize`
    - Token URL: `https://erp.akeda.ru/oauth2/token` scopes: `akeda:delegate`

Бумаги выбранных продаж (закрывающие — акт и УПД, счета или все) и куда каждая уйдёт. Канал по порядку: настройка доставки шаблона клиента; ЭДО, если контрагент принял приглашение у подключения юрлица; почта из карточки контрагента; иначе no_address. Путь ЭДО при подключении в ошибке или «только чтение» — edo_unavailable с причиной, а не молча. Уже ушедшая этим каналом бумага — sent. Ничего не меняет; до 200 продаж.

## Headers

- `X-Tenant` string, required

## Request body

- object
  - `order_ids` UUID[], required: Продажи
  - `papers` 'closing' | 'invoice' | 'all': Вид бумаг: closing — акт и УПД, invoice — счета, all — все (по умолчанию)
  - `with_xml` boolean: Проверить, соберётся ли к письму XML в формате ФНС

## Response `200`

Бумаги пачки

- object
  - `items` object[], required
    - `order_id` string, uuid, required
    - `order_number` string: Номер продажи
    - `document_id` string, uuid, required
    - `document_kind` string, required: Вид бумаги: act, upd, invoice
    - `document_number` string: Номер бумаги
    - `document_date` string: Дата бумаги
    - `contact_id` string, uuid
    - `contact_name` string: Контрагент
    - `channel` 'mail' | 'edo': Канал
    - `source` 'template' | 'edo' | 'contact': Откуда канал: шаблон клиента, ЭДО, карточка контрагента
    - `account_id` string, uuid
    - `connection_id` string, uuid
    - `to` string[], required: Адреса письма
    - `address_options` string[]: Разные адреса действующих шаблонов клиента: выбирает человек
    - `subject` string: Тема из шаблона клиента
    - `body` string: Текст из шаблона клиента
    - `state` 'ready' | 'sent' | 'no_address' | 'edo_unavailable', required: Уйдёт ли бумага
    - `reason` string: Почему не уйдёт: edo_read_only, edo_disconnected
    - `template_xml` boolean: Шаблон клиента велит прикладывать XML
    - `xml` 'ready' | 'no_format' | 'no_signer' | 'not_ready': Соберётся ли XML в формате ФНС
    - `xml_detail` string: Код первой проверки, из-за которой XML не соберётся

## Other responses

- `400`: Некорректный запрос или нарушение бизнес-правила
- `401`: Сессия, ключ или кабинет не подтверждены
- `403`: Текущая роль не имеет требуемого права
- `503`: Внешний банк, справочник или контур подключений временно недоступен

## Changes

- **2026-12-04** `62756b6cbb14`: 4 info
  - added the new optional request property `with_xml`
  - added the optional property `items/items/template_xml` to the response with the `200` status
  - added the optional property `items/items/xml` to the response with the `200` status
  - added the optional property `items/items/xml_detail` to the response with the `200` status
- **2026-12-02** `747a311b8bf0`: 1 info
  - added the optional property `items/items/address_options` to the response with the `200` status
- **2026-12-02** `e73b26c9ddb5`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/akeda/apis/akeda-erp-client-api/changes/api/v1/docflow/flow/batch-send/preview/post.md)

---

[API](https://skmtc.dev/akeda/apis/akeda-erp-client-api.md) - [All operations](https://skmtc.dev/akeda/apis/akeda-erp-client-api/llms.txt) - [OpenAPI document](https://skmtc.dev/akeda/apis/akeda-erp-client-api/revisions/084f7bbc939c?raw)
