---
title: "Выпустить документ плана сейчас"
method: POST
path: "/api/v1/docflow/sales/{id}/paper-plan/issue"
tags: ["Docflow flow"]
---

# Выпустить документ плана сейчас

`POST /api/v1/docflow/sales/{id}/paper-plan/issue`

## Request

- Base URL: `https://erp.akeda.ru`
- URL: `https://erp.akeda.ru/api/v1/docflow/sales/{id}/paper-plan/issue`
- 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`

Выпускает одну строку плана её плановой датой и отправляет её, если отправка включена. Повтор не выпускает второй документ — 409 docflow.sale_paper_plan.already_issued; закрытый период и шаблон на паузе — отказ 409.

## Path parameters

- `id` string, uuid, required

## Headers

- `X-Tenant` string, required

## Request body

- DocflowSalePaperIssueInput
  - `kind` 'invoice' | 'closing', required
  - `index` integer, required: Номер строки плана

## Response `200`

План документов продажи

- DocflowSalePaperPlan
  - `order_id` string, uuid, required
  - `version` integer, required
  - `template_id` string, uuid
  - `template_title` string
  - `template_state` string
  - `bound` boolean, required: Продажу привязал к шаблону человек
  - `closing_by_goods` boolean, required: Закрывающий выпускает отгрузка
  - `rows` DocflowSalePaperRow[], required
    - `kind` 'invoice' | 'closing', required: Счёт или закрывающий
    - `index` integer, required: Номер строки своего вида; у новой строки не передаётся; −1 — одиночный документ прежнего шаблона
    - `title` string: Название счёта
    - `mode` 'issue' | 'draft' | 'upd' | 'act' | 'business_act', required: Счёт: issue — выставить, draft — черновиком; закрывающий: upd, act или business_act
    - `date` string, date, required: Дата документа
    - `due_date` string, date: Оплатить до — не раньше даты счёта
    - `amount` string: Сумма счёта
    - `payment_term_id` string, uuid: Строка условий оплаты продажи
    - `delivery` CoreOrderTemplateDelivery: Independent delivery policy for newly issued template documents. Email uses the shared idempotent queue; EDI awaits manual signing and sending.
      - `channel` 'mail' | 'edo', required
      - `account_id` string, uuid: Mailbox visible to the template author; required for mail.
      - `connection_id` string, uuid: EDI connection; required for edo.
      - `to` string[]
      - `subject` string: Email subject; supports {kind}, {number}, {date} and {client}.
      - `body` string: Email plain text; supports {kind}, {number}, {date} and {client}.
      - `with_xml` boolean: Attach XML in the FTS format to the letter (UTD only). Off by default.
      - `since` string, date-time: Server managed first activation timestamp. Historical documents are excluded.
    - `delivery_alt` CoreOrderTemplateDelivery: Independent delivery policy for newly issued template documents. Email uses the shared idempotent queue; EDI awaits manual signing and sending.
      - `channel` 'mail' | 'edo', required
      - `account_id` string, uuid: Mailbox visible to the template author; required for mail.
      - `connection_id` string, uuid: EDI connection; required for edo.
      - `to` string[]
      - `subject` string: Email subject; supports {kind}, {number}, {date} and {client}.
      - `body` string: Email plain text; supports {kind}, {number}, {date} and {client}.
      - `with_xml` boolean: Attach XML in the FTS format to the letter (UTD only). Off by default.
      - `since` string, date-time: Server managed first activation timestamp. Historical documents are excluded.
    - `manual` boolean: Дата прошла — сам документ не выпускается
    - `removed` boolean
    - `from_template` boolean: Строка пришла из шаблона
    - `edited` boolean: Строку изменили в продаже
    - `state` 'planned' | 'issued' | 'missed' | 'stopped' | 'failed'
    - `reason` string: Код причины остановки или отказа
    - `document_id` string, uuid: Выпущенный документ
    - `document_number` string

## Other responses

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

## Changes

- **2026-12-04** `5fafde39edb6`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/akeda/apis/akeda-erp-client-api/changes/api/v1/docflow/sales/:id/paper-plan/issue/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)
