Organizational transfer
Stock transfers between organizations
INFO
Har bir javob umumiy konvertda qaytadi — code, message, messages, status_code, time — foydali yuk esa data ichida. Quyidagi jadvallar faqat data ichini tavsiflaydi.
POST /organizational-transfer/create
Create a new organizational transfer (cross-organization stock movement) in DRAFT or NEW state.
So‘rov tanasi
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
code | string | Yo‘q | Optional custom transfer code / reference number |
source_organization_id | string | Ha | Sending organization ObjectId |
destination_organization_id | string | Ha | Receiving organization ObjectId |
state | string | Ha | Initial state — draft (held) or new (ready to process). Mumkin qiymatlar: draft, new |
invoice_created | boolean | Yo‘q | Whether a supplier invoice was created for this transfer. Standart: false |
with_price | boolean | Yo‘q | Whether product prices are included in the transfer. Standart: false |
date | string (date-time) | Ha | Transfer document date (ISO 8601) |
shipping_date | string (date-time) | Ha | Expected shipment date (ISO 8601) |
sender_warehouse_id | string | Ha | Source warehouse ObjectId |
sender_employee_id | string | Ha | Employee responsible for sending ObjectId |
reason_id | string | Ha | Transfer reason ObjectId |
price_id | string | Yo‘q | Price-list ObjectId (optional) |
note | string | Yo‘q | Optional free-text note (max 500 characters) |
currency | object | Yo‘q | Currency snapshot at transfer time (optional) |
currency._id | string | Yo‘q | Currency ObjectId |
currency.name | string | Ha | |
currency.value | number | Ha | Exchange rate value |
currency.symbol | string | Yo‘q | |
requests | object[] | Ha | One or more transfer request lines (each may reference a transfer-request document) |
requests[].request_id | string | Yo‘q | Linked transfer-request ObjectId (optional) |
requests[].products | object[] | Ha | Products included in this request line |
requests[].products[].product_id | string | Ha | Product ObjectId |
requests[].products[].amount | number | Ha | Quantity to transfer (must be positive) |
requests[].products[].price | number | Yo‘q | Unit price (optional; required when with_price=true) |
requests[].products[].box_count | number | Yo‘q | Number of boxes (integer ≥ 0). Standart: 0 |
requests[].products[].box_item | number | Yo‘q | Items per box |
requests[].products[].marks | string[] | Yo‘q | Mark/serial codes for marked goods. Standart: [] |
requests[].products[].expiration_date | string (date-time) | Yo‘q | Expiration date (ISO 8601) for perishable goods |
requests[].products[].extra_costs | object[] | Yo‘q | Per-product additional costs. Standart: [] |
additional_costs | object[] | Yo‘q | Transfer-level additional costs. Standart: [] |
additional_costs[].extra_cost_id | string | Yo‘q | |
additional_costs[].amount | number | Yo‘q | |
attachments | object[] | Yo‘q | Attached files (documents, scans). Standart: [] |
attachments[].name | string | Yo‘q | |
attachments[].url | string | Yo‘q |
{
"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"
}
]
}Javob
{
"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).
Yo‘l parametrlari
| Parametr | Tur | Majburiy | Tavsif |
|---|---|---|---|
id | string | Ha | Organizational transfer ObjectId |
So‘rov tanasi
So‘rov tanasi talab qilinmaydi.
Javob
| Maydon | Tur | Tavsif |
|---|---|---|
_id | string | Transfer ObjectId |
number | string | Auto-generated transfer document number |
code | string | Custom reference code |
state | string | Mumkin qiymatlar: 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.
So‘rov tanasi
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
page | number | Ha | Standart: 1 |
limit | number | Ha | Standart: 20 |
source_organization_id | string | Yo‘q | Filter by sending organization ObjectId |
destination_organization_id | string | Yo‘q | Filter by receiving organization ObjectId |
sender_warehouse_id | string | Yo‘q | Filter by sender warehouse ObjectId |
receiver_warehouse_id | string | Yo‘q | Filter by receiver warehouse ObjectId |
states | string[] | Yo‘q | Filter by one or more transfer states |
reason_id | string | Yo‘q | 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"
}Javob
| Maydon | Tur | Tavsif |
|---|---|---|
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.
Yo‘l parametrlari
| Parametr | Tur | Majburiy | Tavsif |
|---|---|---|---|
id | string | Ha | Organizational transfer ObjectId |
So‘rov tanasi
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
code | string | Yo‘q | Optional custom transfer code / reference number |
source_organization_id | string | Ha | Sending organization ObjectId |
destination_organization_id | string | Ha | Receiving organization ObjectId |
state | string | Ha | Initial state — draft (held) or new (ready to process). Mumkin qiymatlar: draft, new |
invoice_created | boolean | Yo‘q | Whether a supplier invoice was created for this transfer. Standart: false |
with_price | boolean | Yo‘q | Whether product prices are included in the transfer. Standart: false |
date | string (date-time) | Ha | Transfer document date (ISO 8601) |
shipping_date | string (date-time) | Ha | Expected shipment date (ISO 8601) |
sender_warehouse_id | string | Ha | Source warehouse ObjectId |
sender_employee_id | string | Ha | Employee responsible for sending ObjectId |
reason_id | string | Ha | Transfer reason ObjectId |
price_id | string | Yo‘q | Price-list ObjectId (optional) |
note | string | Yo‘q | Optional free-text note (max 500 characters) |
currency | object | Yo‘q | Currency snapshot at transfer time (optional) |
currency._id | string | Yo‘q | Currency ObjectId |
currency.name | string | Ha | |
currency.value | number | Ha | Exchange rate value |
currency.symbol | string | Yo‘q | |
requests | object[] | Ha | One or more transfer request lines (each may reference a transfer-request document) |
requests[].request_id | string | Yo‘q | Linked transfer-request ObjectId (optional) |
requests[].products | object[] | Ha | Products included in this request line |
requests[].products[].product_id | string | Ha | Product ObjectId |
requests[].products[].amount | number | Ha | Quantity to transfer (must be positive) |
requests[].products[].price | number | Yo‘q | Unit price (optional; required when with_price=true) |
requests[].products[].box_count | number | Yo‘q | Number of boxes (integer ≥ 0). Standart: 0 |
requests[].products[].box_item | number | Yo‘q | Items per box |
requests[].products[].marks | string[] | Yo‘q | Mark/serial codes for marked goods. Standart: [] |
requests[].products[].expiration_date | string (date-time) | Yo‘q | Expiration date (ISO 8601) for perishable goods |
requests[].products[].extra_costs | object[] | Yo‘q | Per-product additional costs. Standart: [] |
additional_costs | object[] | Yo‘q | Transfer-level additional costs. Standart: [] |
additional_costs[].extra_cost_id | string | Yo‘q | |
additional_costs[].amount | number | Yo‘q | |
attachments | object[] | Yo‘q | Attached files (documents, scans). Standart: [] |
attachments[].name | string | Yo‘q | |
attachments[].url | string | Yo‘q |
{
"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"
}
]
}Javob
Javob tuzilishi quyidagi bilan bir xil: 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.
Yo‘l parametrlari
| Parametr | Tur | Majburiy | Tavsif |
|---|---|---|---|
id | string | Ha | Organizational transfer ObjectId |
So‘rov tanasi
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
state | string | Ha | 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.. Mumkin qiymatlar: draft, new, accepted, in_progress, canceled |
{
"state": "draft"
}Javob
Javob tuzilishi quyidagi bilan bir xil: 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.
Yo‘l parametrlari
| Parametr | Tur | Majburiy | Tavsif |
|---|---|---|---|
id | string | Ha | Organizational transfer ObjectId |
So‘rov tanasi
| Maydon | Tur | Majburiy | Tavsif |
|---|---|---|---|
receiver_warehouse_id | string | Ha | Destination warehouse ObjectId where stock will be received |
{
"receiver_warehouse_id": "string"
}Javob
Javob tuzilishi quyidagi bilan bir xil: POST /organizational-transfer/create.
Bu sahifa OpenAPI spetsifikatsiyasidan yaratilgan.