---
title: "Подобрать физические единицы под требуемое количество"
method: GET
path: "/api/v1/stock/handling-units/suggestions"
tags: ["Stock handling units"]
---

# Подобрать физические единицы под требуемое количество

`GET /api/v1/stock/handling-units/suggestions`

## Request

- Base URL: `https://erp.akeda.ru`
- URL: `https://erp.akeda.ru/api/v1/stock/handling-units/suggestions`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-Api-Key`
  - OAuth 2 (authorization code, authorization URL `https://erp.akeda.ru/oauth2/authorize`, token URL `https://erp.akeda.ru/oauth2/token`, scopes: `akeda:delegate`)
  - HTTP bearer

Подбор идёт по вскрытым и запечатанным активным единицам в порядке выдачи; complete=false означает, что склада не хватило.

## Query parameters

- `business_id` string, uuid
- `company_id` string, uuid
- `warehouse_id` string, uuid, required
- `product_id` string, uuid, required
- `qty` string, required

## Headers

- `X-Tenant` string, required

## Response `200`

Раскладка подбора

- StockHandlingUnitSuggestionResult
  - `requested_qty` string, required
  - `allocated_qty` string, required
  - `complete` boolean, required: false означает, что доступных единиц не хватило на всё количество
  - `allocations` StockHandlingUnitSuggestion[], required
    - `handling_unit_id` string, uuid, required
    - `code` string, required
    - `batch_id` string, uuid, required
    - `qty` string, required
    - `available_before` string, required
    - `available_after` string, required
    - `state_before` 'pending' | 'sealed' | 'opened' | 'empty' | 'cancelled' | 'blocked' | 'retired' | 'location_conflict', required: Вычисленное состояние единицы; выводится из статуса, документа-основания и остатков регистра

## Other responses

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

---

[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/a99574d597cc?raw)
