---
title: "Привязать операцию внешнего склада"
method: POST
path: "/api/v1/stock/wms/operations/{id}/link"
tags: ["Stock warehouses"]
---

# Привязать операцию внешнего склада

`POST /api/v1/stock/wms/operations/{id}/link`

## Request

- Base URL: `https://erp.akeda.ru`
- URL: `https://erp.akeda.ru/api/v1/stock/wms/operations/{id}/link`
- 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`
  - HTTP bearer

target_kind=document — наш документ склада (отправка в пути или закупка для приёмки оператора — решение по приёмке у оператора), order — заказ покупателя: наше задание по заказу привязывается к заданию оператора, факт проводится штатно. Приёмка, которую оператор уже ведёт по другой заявке, — 409 с conflict: true; force: true — привязать с расхождением.

## Path parameters

- `id` string, uuid, required

## Headers

- `X-Tenant` string, required

## Request body

- StockWMSOperationLinkInput
  - `target_kind` 'document' | 'order', required
  - `target_id` string, uuid, required
  - `force` boolean: Привязать приёмку, хотя оператор ведёт другую по той же заявке

## Response `200`

Карточка операции

- StockWMSOperationCard
  - [`StockWMSOperation`](https://skmtc.dev/akeda/apis/akeda-erp-client-api/revisions/084f7bbc939c/schema?at=%2Fcomponents%2Fschemas%2FStockWMSOperation)
  - object
    - `lines` StockWMSOperationLine[], required
      - `product_id` string, uuid, nullable
      - `product_name` string
      - `article` string
      - `lot` string
      - `expiry` string, nullable
      - `qty` string
      - `unit` string
      - `operator_product_id` string
      - `item_ids` string[]
      - `place_code` string
    - `document_lines` StockWMSOperationLine[], required
      - `product_id` string, uuid, nullable
      - `product_name` string
      - `article` string
      - `lot` string
      - `expiry` string, nullable
      - `qty` string
      - `unit` string
      - `operator_product_id` string
      - `item_ids` string[]
      - `place_code` string
    - `candidates` StockWMSOperationCandidate[], required
      - `target_kind` 'document' | 'order'
      - `target_id` string, uuid
      - `number` string
      - `title` string
      - `date` string
      - `score` integer
      - `reason` string
      - `exact` boolean

## Other responses

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

## Changes

- **2026-12-04** `62756b6cbb14`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/akeda/apis/akeda-erp-client-api/changes/api/v1/stock/wms/operations/:id/link/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)
