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.

POST /api/storage-units/move

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 sources
  • PICKING_PROCESS - Moving items to picking areas
  • PACKING_PROCESS - Moving items to packing areas
  • PARCEL_PROCESS - Reserving items for specific parcels
  • RETURN_PROCESS - Processing returned items
  • SCRAP_PROCESS - Moving items to scrap
  • SHIP_ORDER_PROCESS - Shipping items externally
  • STOCK_CORRECTION_PROCESS - Inventory adjustments
  • DELETE_ORDER_PROCESS - Canceling reservations
  • INTERNAL_MOVE_PROCESS - Internal warehouse movements

Storage Places

  • ACTIVE_STORAGE - Main storage area
  • RESERVED - Reserved for specific orders
  • PUFFER - Buffer storage area
  • PICKING - Picking area
  • PACKING - Packing area
  • SCRAP - Damaged or unusable items
  • EXTERNAL - 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.

POST /api/storage-units/get-storage-stocks

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 filters
  • by_filter - Use the provided filter criteria

Get Reserved Stock by Product

Retrieves stock reservations for specific products.

POST /api/storage-units/get-reserved-stock-by-product

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.

POST /api/storage-units/get-reserved-stock-by-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.