Storage Units
Manage storage units including movements, stock retrieval, and reservations.
Overview
Storage Units are the core entities representing physical inventory items in specific locations within warehouses. This module handles complex stock movements, reservations, and stock queries across different storage places.
Move Storage Unit
Executes complex stock movements through an automated decision tree system. Supports multiple process types including batch, picking, packing, and parcel operations.
Request Body
{
"ms_trace": [
{
"ms_signature": "storage-move-req-789",
"warning_count": 0
}
],
"data": [
{
"product_id": 123,
"warehouse_id": 456,
"location_id_to_remove": 10,
"location_id_to_put": 20,
"quantity": 100,
"serial_number": "SN123456789",
"lot": {
"lot_id": 5,
"lot_number": "LOT-2024-001",
"expiration_date": "2024-12-31",
"manufacturing_year": 2024
},
"process_details": {
"type": "BATCH_PROCESS",
"origin": "EXTERNAL",
"destination": "ACTIVE_STORAGE",
"parcel_method": null,
"parcel_id": null,
"workflow_id": null,
"picker_id": null,
"packing_point_id": null,
"process_reason": null,
"allow_to_ship_not_filled_parcels": null,
"is_partial_reservation_allowed": null,
"exact_lot_numbers": []
}
}
]
}
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| data[].product_id | integer | Required | ID of the product being moved |
| data[].warehouse_id | integer | Required | ID of the warehouse |
| data[].location_id_to_remove | integer | Conditional | Source location ID (required based on process type) |
| data[].location_id_to_put | integer | Conditional | Destination location ID (required based on process type) |
| data[].quantity | integer | Required | Quantity to move |
| data[].serial_number | string | Optional | Serial number of the item |
| data[].lot | object | Optional | Lot information for the product |
| data[].process_details | object | Required | Details about the movement process |
Process Types
BATCH_PROCESS- Incoming inventory from external sourcesPICKING_PROCESS- Moving items to picking areasPACKING_PROCESS- Moving items to packing areasPARCEL_PROCESS- Reserving items for specific parcelsRETURN_PROCESS- Processing returned itemsSCRAP_PROCESS- Moving items to scrapSHIP_ORDER_PROCESS- Shipping items externallySTOCK_CORRECTION_PROCESS- Inventory adjustmentsDELETE_ORDER_PROCESS- Canceling reservationsINTERNAL_MOVE_PROCESS- Internal warehouse movements
Storage Places
ACTIVE_STORAGE- Main storage areaRESERVED- Reserved for specific ordersPUFFER- Buffer storage areaPICKING- Picking areaPACKING- Packing areaSCRAP- Damaged or unusable itemsEXTERNAL- External to the warehouse system
Parcel Process Example
{
"process_details": {
"type": "PARCEL_PROCESS",
"origin": "ACTIVE_STORAGE",
"destination": "RESERVED",
"parcel_method": "EXACT_LOT_NUMBERS_METHOD",
"parcel_id": 12345,
"allow_to_ship_not_filled_parcels": true,
"is_partial_reservation_allowed": false,
"exact_lot_numbers": [
{
"lot_number": "LOT-2024-001",
"quantity": 50,
"product_id": 123
}
]
}
}
Get Storage Stocks
Retrieves stock information based on filters and warehouse criteria.
Request Body
{
"ms_trace": [
{
"ms_signature": "stock-get-req-101",
"warning_count": 0
}
],
"data": {
"warehouse_id": 456,
"partner_id": 123,
"get_mode": "by_filter",
"page": 1,
"per_page": 50,
"filter": {
"columns": ["product_id", "quantity", "location_id"],
"filters": [
{
"field": "quantity",
"operator": ">",
"value": 0
}
],
"with": ["location", "lot"]
}
}
}
Get Modes
all- Retrieve all stock without filtersby_filter- Use the provided filter criteria
Get Reserved Stock by Product
Retrieves stock reservations for specific products.
Request Body
{
"ms_trace": [
{
"ms_signature": "reserved-product-req-202",
"warning_count": 0
}
],
"data": {
"product_ids": [123, 456, 789],
"warehouse_id": 456,
"partner_id": 123
}
}
Get Reserved Stock by Parcel
Retrieves all stock reservations for a specific parcel.
Request Body
{
"ms_trace": [
{
"ms_signature": "reserved-parcel-req-303",
"warning_count": 0
}
],
"data": {
"parcel_id": 12345,
"warehouse_id": 456,
"include_picking": true,
"include_packing": true
}
}
Decision Tree System
The movement operations use a sophisticated decision tree system that automatically determines the correct process flow based on:
- Process type and storage places
- Warehouse integrity checks
- Lot number verification
- Quantity validation
- Waiting reservations
- Parcel processing rules
The system ensures data consistency and business rule compliance through automated validation steps.
Error Responses
Business Logic Errors
Additional error responses may be returned for business rule violations such as invalid process types, insufficient stock, or missing required fields. Exact error formats not verified from controller code.