Organizational transfer
Stock transfers between organizations
INFO
Каждый ответ приходит в общем конверте — code, message, messages, status_code, time — а полезная нагрузка лежит в data. Таблицы ниже описывают содержимое data.
POST /organizational-transfer/create
Create a new organizational transfer (cross-organization stock movement) in DRAFT or NEW state.
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
code | string | Нет | Optional custom transfer code / reference number |
source_organization_id | string | Да | Sending organization ObjectId |
destination_organization_id | string | Да | Receiving organization ObjectId |
state | string | Да | Initial state — draft (held) or new (ready to process). Допустимые значения: draft, new |
invoice_created | boolean | Нет | Whether a supplier invoice was created for this transfer. По умолчанию: false |
with_price | boolean | Нет | Whether product prices are included in the transfer. По умолчанию: false |
date | string (date-time) | Да | Transfer document date (ISO 8601) |
shipping_date | string (date-time) | Да | Expected shipment date (ISO 8601) |
sender_warehouse_id | string | Да | Source warehouse ObjectId |
sender_employee_id | string | Да | Employee responsible for sending ObjectId |
reason_id | string | Да | Transfer reason ObjectId |
price_id | string | Нет | Price-list ObjectId (optional) |
note | string | Нет | Optional free-text note (max 500 characters) |
currency | object | Нет | Currency snapshot at transfer time (optional) |
currency._id | string | Нет | Currency ObjectId |
currency.name | string | Да | |
currency.value | number | Да | Exchange rate value |
currency.symbol | string | Нет | |
requests | object[] | Да | One or more transfer request lines (each may reference a transfer-request document) |
requests[].request_id | string | Нет | Linked transfer-request ObjectId (optional) |
requests[].products | object[] | Да | Products included in this request line |
requests[].products[].product_id | string | Да | Product ObjectId |
requests[].products[].amount | number | Да | Quantity to transfer (must be positive) |
requests[].products[].price | number | Нет | Unit price (optional; required when with_price=true) |
requests[].products[].box_count | number | Нет | Number of boxes (integer ≥ 0). По умолчанию: 0 |
requests[].products[].box_item | number | Нет | Items per box |
requests[].products[].marks | string[] | Нет | Mark/serial codes for marked goods. По умолчанию: [] |
requests[].products[].expiration_date | string (date-time) | Нет | Expiration date (ISO 8601) for perishable goods |
requests[].products[].extra_costs | object[] | Нет | Per-product additional costs. По умолчанию: [] |
additional_costs | object[] | Нет | Transfer-level additional costs. По умолчанию: [] |
additional_costs[].extra_cost_id | string | Нет | |
additional_costs[].amount | number | Нет | |
attachments | object[] | Нет | Attached files (documents, scans). По умолчанию: [] |
attachments[].name | string | Нет | |
attachments[].url | string | Нет |
{
"code": "string",
"source_organization_id": "string",
"destination_organization_id": "string",
"state": "draft",
"invoice_created": false,
"with_price": false,
"date": "2025-05-01T12:00:00Z",
"shipping_date": "2025-05-01T12:00:00Z",
"sender_warehouse_id": "string",
"sender_employee_id": "string",
"reason_id": "string",
"price_id": "string",
"note": "string",
"currency": {
"_id": "string",
"name": "string",
"value": 0,
"symbol": "string"
},
"requests": [
{
"request_id": "string",
"products": []
}
],
"additional_costs": [
{
"extra_cost_id": "string",
"amount": 0
}
],
"attachments": [
{
"name": "string",
"url": "string"
}
]
}Ответ
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": "string",
"time": "2025-05-01T12:00:00Z"
}GET /organizational-transfer/get-by-id/{id}
Fetch a single organizational transfer by ObjectId (aggregated detail view with products and requests).
Параметры пути
| Параметр | Тип | Обязательно | Описание |
|---|---|---|---|
id | string | Да | Organizational transfer ObjectId |
Тело запроса
Тело запроса не требуется.
Ответ
| Поле | Тип | Описание |
|---|---|---|
_id | string | Transfer ObjectId |
number | string | Auto-generated transfer document number |
code | string | Custom reference code |
state | string | Допустимые значения: draft, new, accepted, in_progress, done, canceled |
type | string | Transfer type (o2o for organizational transfers) |
source_organization_id | string | |
destination_organization_id | string | |
sender_warehouse_id | string | |
receiver_warehouse_id | string | Set after receive; null until received |
sender_employee_id | string | |
reason_id | string | |
price_id | string | |
date | string (date-time) | |
shipping_date | string (date-time) | |
invoice_created | boolean | |
with_price | boolean | |
note | string | |
total_amount | number | Total quantity across all products |
total_cost | number | |
total_price | number | |
total_extra_cost | number | |
requests | object[] | Transfer request lines with their product details |
requests[].request_id | string | |
requests[].products | object[] | |
requests[].products[].product_id | string | |
requests[].products[].amount | number | |
requests[].products[].price | number | |
requests[].products[].box_count | number | |
requests[].products[].marks | string[] | |
requests[].products[].expiration_date | string (date-time) | |
requests[].products[].sender_stock_before | number | Sender warehouse stock before outflow |
requests[].products[].sender_stock_after | number | Derived: sender_stock_before − amount |
requests[].products[].receiver_stock_before | number | Receiver warehouse stock before inflow (set after receive) |
requests[].products[].receiver_stock_after | number | Derived: receiver_stock_before + amount (set after receive) |
additional_costs | object[] | |
attachments | object[] | |
created_at | string (date-time) | |
updated_at | string (date-time) |
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"_id": "string",
"number": "string",
"code": "string",
"state": "draft",
"type": "string",
"source_organization_id": "string",
"destination_organization_id": "string",
"sender_warehouse_id": "string",
"receiver_warehouse_id": "string",
"sender_employee_id": "string",
"reason_id": "string",
"price_id": "string",
"date": "2025-05-01T12:00:00Z",
"shipping_date": "2025-05-01T12:00:00Z",
"invoice_created": false,
"with_price": false,
"note": "string",
"total_amount": 0,
"total_cost": 0,
"total_price": 0,
"total_extra_cost": 0,
"requests": [
{
"request_id": "string",
"products": []
}
],
"additional_costs": [
{}
],
"attachments": [
{}
],
"created_at": "2025-05-01T12:00:00Z",
"updated_at": "2025-05-01T12:00:00Z"
},
"time": "2025-05-01T12:00:00Z"
}POST /organizational-transfer/get-paging
Paginated list of organizational transfers, filterable by organization, warehouse, state, and reason.
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
page | number | Да | По умолчанию: 1 |
limit | number | Да | По умолчанию: 20 |
source_organization_id | string | Нет | Filter by sending organization ObjectId |
destination_organization_id | string | Нет | Filter by receiving organization ObjectId |
sender_warehouse_id | string | Нет | Filter by sender warehouse ObjectId |
receiver_warehouse_id | string | Нет | Filter by receiver warehouse ObjectId |
states | string[] | Нет | Filter by one or more transfer states |
reason_id | string | Нет | Filter by transfer reason ObjectId |
{
"page": 1,
"limit": 20,
"source_organization_id": "string",
"destination_organization_id": "string",
"sender_warehouse_id": "string",
"receiver_warehouse_id": "string",
"states": [
"draft"
],
"reason_id": "string"
}Ответ
| Поле | Тип | Описание |
|---|---|---|
total | number | |
list | any[] |
{
"code": 0,
"message": "Success",
"status_code": 200,
"data": {
"total": 0,
"list": []
},
"time": "2025-05-01T12:00:00Z"
}PUT /organizational-transfer/update/{id}
Update an existing organizational transfer. Only allowed in DRAFT or NEW state.
Параметры пути
| Параметр | Тип | Обязательно | Описание |
|---|---|---|---|
id | string | Да | Organizational transfer ObjectId |
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
code | string | Нет | Optional custom transfer code / reference number |
source_organization_id | string | Да | Sending organization ObjectId |
destination_organization_id | string | Да | Receiving organization ObjectId |
state | string | Да | Initial state — draft (held) or new (ready to process). Допустимые значения: draft, new |
invoice_created | boolean | Нет | Whether a supplier invoice was created for this transfer. По умолчанию: false |
with_price | boolean | Нет | Whether product prices are included in the transfer. По умолчанию: false |
date | string (date-time) | Да | Transfer document date (ISO 8601) |
shipping_date | string (date-time) | Да | Expected shipment date (ISO 8601) |
sender_warehouse_id | string | Да | Source warehouse ObjectId |
sender_employee_id | string | Да | Employee responsible for sending ObjectId |
reason_id | string | Да | Transfer reason ObjectId |
price_id | string | Нет | Price-list ObjectId (optional) |
note | string | Нет | Optional free-text note (max 500 characters) |
currency | object | Нет | Currency snapshot at transfer time (optional) |
currency._id | string | Нет | Currency ObjectId |
currency.name | string | Да | |
currency.value | number | Да | Exchange rate value |
currency.symbol | string | Нет | |
requests | object[] | Да | One or more transfer request lines (each may reference a transfer-request document) |
requests[].request_id | string | Нет | Linked transfer-request ObjectId (optional) |
requests[].products | object[] | Да | Products included in this request line |
requests[].products[].product_id | string | Да | Product ObjectId |
requests[].products[].amount | number | Да | Quantity to transfer (must be positive) |
requests[].products[].price | number | Нет | Unit price (optional; required when with_price=true) |
requests[].products[].box_count | number | Нет | Number of boxes (integer ≥ 0). По умолчанию: 0 |
requests[].products[].box_item | number | Нет | Items per box |
requests[].products[].marks | string[] | Нет | Mark/serial codes for marked goods. По умолчанию: [] |
requests[].products[].expiration_date | string (date-time) | Нет | Expiration date (ISO 8601) for perishable goods |
requests[].products[].extra_costs | object[] | Нет | Per-product additional costs. По умолчанию: [] |
additional_costs | object[] | Нет | Transfer-level additional costs. По умолчанию: [] |
additional_costs[].extra_cost_id | string | Нет | |
additional_costs[].amount | number | Нет | |
attachments | object[] | Нет | Attached files (documents, scans). По умолчанию: [] |
attachments[].name | string | Нет | |
attachments[].url | string | Нет |
{
"code": "string",
"source_organization_id": "string",
"destination_organization_id": "string",
"state": "draft",
"invoice_created": false,
"with_price": false,
"date": "2025-05-01T12:00:00Z",
"shipping_date": "2025-05-01T12:00:00Z",
"sender_warehouse_id": "string",
"sender_employee_id": "string",
"reason_id": "string",
"price_id": "string",
"note": "string",
"currency": {
"_id": "string",
"name": "string",
"value": 0,
"symbol": "string"
},
"requests": [
{
"request_id": "string",
"products": []
}
],
"additional_costs": [
{
"extra_cost_id": "string",
"amount": 0
}
],
"attachments": [
{
"name": "string",
"url": "string"
}
]
}Ответ
Структура ответа совпадает с POST /organizational-transfer/create.
PUT /organizational-transfer/set-status/{id}
Transition the transfer through the state machine. Valid transitions: NEW→DRAFT|CANCELED|ACCEPTED; DRAFT→NEW; ACCEPTED→IN_PROGRESS|CANCELED; IN_PROGRESS→CANCELED; DONE→CANCELED. Use receive for the ACCEPTED/IN_PROGRESS→DONE transition.
Параметры пути
| Параметр | Тип | Обязательно | Описание |
|---|---|---|---|
id | string | Да | Organizational transfer ObjectId |
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
state | string | Да | Target state. Valid transitions: NEW→DRAFT|CANCELED|ACCEPTED; DRAFT→NEW; ACCEPTED→IN_PROGRESS|CANCELED; IN_PROGRESS→CANCELED; DONE→CANCELED. Use the receive endpoint to transition to DONE.. Допустимые значения: draft, new, accepted, in_progress, canceled |
{
"state": "draft"
}Ответ
Структура ответа совпадает с POST /organizational-transfer/create.
PUT /organizational-transfer/receive/{id}
Receive an accepted organizational transfer: transitions ACCEPTED or IN_PROGRESS → DONE and applies stock movement into the receiver warehouse.
Параметры пути
| Параметр | Тип | Обязательно | Описание |
|---|---|---|---|
id | string | Да | Organizational transfer ObjectId |
Тело запроса
| Поле | Тип | Обязательно | Описание |
|---|---|---|---|
receiver_warehouse_id | string | Да | Destination warehouse ObjectId where stock will be received |
{
"receiver_warehouse_id": "string"
}Ответ
Структура ответа совпадает с POST /organizational-transfer/create.
Эта страница сгенерирована из спецификации OpenAPI.