Inventory Stock Management
4 API calls in this section.
List Inventory Stock
/warehousing/inventory-stock?tenant_id={{tenant_id}}&warehouse_id={{warehouse_id}}&item_id=&bin_id=&status=&search=&lot_number=&min_quantity=&max_quantity=&page=1&limit=20Retrieves inventory stock levels with comprehensive filtering options for a specific warehouse. Provides detailed information about item quantities in specific bin locations, including status, lot numbers, and expiration dates. Authentication: - Requires valid authentication token - User must have 'view:tenant' or 'manage:operations:tenant' permission Query Parameters: - tenant_id (required): UUID of the tenant - warehouse_id (required): UUID of the warehouse whose stock should be listed - item_id (optional): Filter by inventory item - bin_id (optional): Filter by bin location - status (optional): Filter by stock status (available, reserved, damaged, expired) - search (optional): Search in lot number and serial number - lot_number (optional): Filter by lot number - min_quantity (optional): Filter by minimum quantity - max_quantity (optional): Filter by maximum quantity - page (optional): Page number for pagination (default: 1) - limit (optional): Number of items per page (default: 20) Response: - Returns a paginated list of inventory stock records scoped to the specified warehouse - Includes details of the items, bins, and warehouses - Includes pagination information (total count, current page, limit)
1curl --request GET "$ONDI_BASE_URL/warehousing/inventory-stock?tenant_id={{tenant_id}}&warehouse_id={{warehouse_id}}&item_id=&bin_id=&status=&search=&lot_number=&min_quantity=&max_quantity=&page=1&limit=20" \2 --header "Authorization: Bearer {{access_token}}" \3 --header "Content-Type: application/json"Query parameters
tenant_idOptional{{tenant_id}}
UUID of the tenant (required)
warehouse_idOptional{{warehouse_id}}
UUID of the warehouse (required)
item_idOptionalFilter by inventory item (optional)
bin_idOptionalFilter by bin location (optional)
statusOptionalFilter by stock status (optional)
searchOptionalSearch in lot number and serial number (optional)
lot_numberOptionalFilter by lot number (optional)
min_quantityOptionalFilter by minimum quantity (optional)
max_quantityOptionalFilter by maximum quantity (optional)
pageOptional1
Page number for pagination (optional, default: 1)
limitOptional20
Number of items per page (optional, default: 20)
Headers
AuthorizationOptionalBearer {{access_token}}
Content-TypeOptionalapplication/json
Responses
1{2 "success": true,3 "message": "Inventory stock retrieved successfully",4 "stock": [5 {6 "id": "stock-uuid-1",7 "tenant_id": "tenant-uuid",8 "warehouse_id": "warehouse-uuid",9 "item_id": "item-uuid",10 "bin_id": "bin-uuid",11 "quantity": 100,12 "unit_of_measure": "ea",13 "status": "available",14 "lot_number": "LOT123",15 "serial_number": null,16 "expiration_date": "2024-12-31T00:00:00Z",17 "received_date": "2023-06-15T00:00:00Z",18 "last_counted_at": "2023-06-15T10:30:00Z",19 "created_at": "2023-06-15T09:45:00Z",20 "updated_at": "2023-06-15T09:45:00Z",21 "item": {22 "id": "item-uuid",23 "name": "Test Product",24 "sku": "ITEM-001",25 "barcode": "123456789",26 "category": "Electronics",27 "item_type": "finished_good"28 },29 "bin": {30 "id": "bin-uuid",31 "name": "Bin A1",32 "code": "B-001",33 "location_type": "bin"34 },35 "warehouse": {36 "id": "warehouse-uuid",37 "name": "Main Warehouse",38 "code": "WH001"39 }40 }41 ],42 "statusCounts": {43 "available": 1,44 "reserved": 0,45 "damaged": 0,46 "expired": 047 },48 "stats": {49 "available": 1,50 "reserved": 0,51 "damaged": 0,52 "expired": 053 },54 "page": 1,55 "limit": 20,56 "total": 157}1{2 "success": false,3 "message": "Tenant not found"4}1{2 "success": false,3 "message": "Insufficient permissions"4}1{2 "success": false,3 "message": "Internal server error"4}Create/Update Inventory Stock
/warehousing/inventory-stock?tenant_id={{tenant_id}}Creates or updates inventory stock for an item in a specific bin location. If a stock record already exists for the specified warehouse-item-bin combination, it updates the quantity; otherwise, it creates a new stock record. Also creates a transaction record to track the change. Authentication: - Requires valid authentication token - User must have 'manage:operations:tenant' permission Query Parameters: - tenant_id (required): UUID of the tenant Business Rules: - Warehouse must exist and belong to the specified tenant - Item must exist and belong to the tenant - Bin must exist, belong to the specified warehouse, and be of location_type "bin" - Quantity must be a non-negative number - Status must be one of: available, reserved, damaged, expired - If stock record already exists, it will be updated; otherwise, a new record is created - An inventory transaction record is automatically created to track the stock change
1curl --request POST "$ONDI_BASE_URL/warehousing/inventory-stock?tenant_id={{tenant_id}}" \2 --header "Authorization: Bearer {{access_token}}" \3 --header "Content-Type: application/json" \4 --header "Content-Type: application/json" \5 --data '{6 "warehouse_id": "{{warehouse_id}}",7 "item_id": "{{item_id}}",8 "bin_id": "{{bin_id}}",9 "quantity": 100,10 "unit_of_measure": "ea",11 "status": "available",12 "lot_number": "LOT123",13 "serial_number": null,14 "expiration_date": "2024-12-31T00:00:00Z",15 "received_date": "2023-06-15T00:00:00Z",16 "last_counted_at": "2023-06-15T10:30:00Z",17 "notes": "Initial stock for product launch"18}'1{2 "warehouse_id": "{{warehouse_id}}",3 "item_id": "{{item_id}}",4 "bin_id": "{{bin_id}}",5 "quantity": 100,6 "unit_of_measure": "ea",7 "status": "available",8 "lot_number": "LOT123",9 "serial_number": null,10 "expiration_date": "2024-12-31T00:00:00Z",11 "received_date": "2023-06-15T00:00:00Z",12 "last_counted_at": "2023-06-15T10:30:00Z",13 "notes": "Initial stock for product launch"14}Query parameters
tenant_idOptional{{tenant_id}}
UUID of the tenant (required)
Request body fields
warehouse_idExampleExample field from the request body.
item_idExampleExample field from the request body.
bin_idExampleExample field from the request body.
quantityExampleExample field from the request body.
unit_of_measureExampleExample field from the request body.
statusExampleExample field from the request body.
lot_numberExampleExample field from the request body.
serial_numberExampleExample field from the request body.
expiration_dateExampleExample field from the request body.
received_dateExampleExample field from the request body.
last_counted_atExampleExample field from the request body.
notesExampleExample field from the request body.
Headers
AuthorizationOptionalBearer {{access_token}}
Content-TypeOptionalapplication/json
Responses
1{2 "success": true,3 "message": "Inventory stock created successfully",4 "stock": {5 "id": "stock-uuid",6 "tenant_id": "tenant-uuid",7 "warehouse_id": "warehouse-uuid",8 "item_id": "item-uuid",9 "bin_id": "bin-uuid",10 "quantity": 100,11 "unit_of_measure": "ea",12 "status": "available",13 "lot_number": "LOT123",14 "serial_number": null,15 "expiration_date": "2024-12-31T00:00:00Z",16 "received_date": "2023-06-15T00:00:00Z",17 "last_counted_at": "2023-06-15T10:30:00Z",18 "created_at": "2023-06-15T09:45:00Z",19 "updated_at": "2023-06-15T09:45:00Z",20 "item": {21 "id": "item-uuid",22 "name": "Test Product",23 "sku": "ITEM-001"24 },25 "bin": {26 "id": "bin-uuid",27 "name": "Bin A1",28 "code": "B-001"29 },30 "warehouse": {31 "id": "warehouse-uuid",32 "name": "Main Warehouse",33 "code": "WH001"34 }35 },36 "operation": "created"37}1{2 "success": true,3 "message": "Inventory stock updated successfully",4 "stock": {5 "id": "stock-uuid",6 "tenant_id": "tenant-uuid",7 "warehouse_id": "warehouse-uuid",8 "item_id": "item-uuid",9 "bin_id": "bin-uuid",10 "quantity": 100,11 "unit_of_measure": "ea",12 "status": "available",13 "lot_number": "LOT123",14 "serial_number": null,15 "expiration_date": "2024-12-31T00:00:00Z",16 "received_date": "2023-06-15T00:00:00Z",17 "last_counted_at": "2023-06-15T10:30:00Z",18 "created_at": "2023-06-10T14:30:00Z",19 "updated_at": "2023-06-15T09:45:00Z",20 "item": {21 "id": "item-uuid",22 "name": "Test Product",23 "sku": "ITEM-001"24 },25 "bin": {26 "id": "bin-uuid",27 "name": "Bin A1",28 "code": "B-001"29 },30 "warehouse": {31 "id": "warehouse-uuid",32 "name": "Main Warehouse",33 "code": "WH001"34 }35 },36 "operation": "updated"37}1{2 "success": false,3 "message": "Field required: warehouse_id"4}1{2 "success": false,3 "message": "Quantity must be non-negative"4}1{2 "success": false,3 "message": "Invalid status. Must be one of: available, reserved, damaged, expired"4}1{2 "success": false,3 "message": "Location not a bin"4}1{2 "success": false,3 "message": "Warehouse not found"4}1{2 "success": false,3 "message": "Item not found"4}1{2 "success": false,3 "message": "Bin not found"4}1{2 "success": false,3 "message": "Insufficient permissions"4}Get Inventory Stock
/warehousing/inventory-stock/:id?tenant_id={{tenant_id}}Retrieves details of a specific inventory stock record, including its transaction history. Provides comprehensive information about the item, bin location, and warehouse. Authentication: - Requires valid authentication token - User must have 'view:tenant' or 'manage:operations:tenant' permission Path Parameters: - id: UUID of the inventory stock record (required) Query Parameters: - tenant_id: UUID of the tenant (required if not in auth) Response: - Returns detailed information about the specified inventory stock record - Includes related item, bin, and warehouse details - Includes transaction history for the stock (limited to most recent 20 transactions)
1curl --request GET "$ONDI_BASE_URL/warehousing/inventory-stock/:id?tenant_id={{tenant_id}}" \2 --header "Authorization: Bearer {{access_token}}" \3 --header "Content-Type: application/json"Path parameters
idRequiredstock-uuid
UUID of the inventory stock record (required)
Query parameters
tenant_idOptional{{tenant_id}}
UUID of the tenant (required if not in auth)
Headers
AuthorizationOptionalBearer {{access_token}}
Content-TypeOptionalapplication/json
Responses
1{2 "success": true,3 "message": "Inventory stock retrieved successfully",4 "stock": {5 "id": "stock-uuid",6 "tenant_id": "tenant-uuid",7 "warehouse_id": "warehouse-uuid",8 "item_id": "item-uuid",9 "bin_id": "bin-uuid",10 "quantity": 100,11 "unit_of_measure": "ea",12 "status": "available",13 "lot_number": "LOT123",14 "serial_number": null,15 "expiration_date": "2024-12-31T00:00:00Z",16 "received_date": "2023-06-15T00:00:00Z",17 "last_counted_at": "2023-06-15T10:30:00Z",18 "created_at": "2023-06-15T09:45:00Z",19 "updated_at": "2023-06-15T09:45:00Z",20 "item": {21 "id": "item-uuid",22 "name": "Test Product",23 "sku": "ITEM-001",24 "barcode": "123456789",25 "category": "Electronics",26 "item_type": "finished_good"27 },28 "bin": {29 "id": "bin-uuid",30 "name": "Bin A1",31 "code": "B-001",32 "location_type": "bin"33 },34 "warehouse": {35 "id": "warehouse-uuid",36 "name": "Main Warehouse",37 "code": "WH001"38 }39 },40 "transactions": [41 {42 "id": "transaction-uuid-1",43 "tenant_id": "tenant-uuid",44 "warehouse_id": "warehouse-uuid",45 "item_id": "item-uuid",46 "stock_id": "stock-uuid",47 "transaction_type": "initial_stock",48 "quantity": 100,49 "from_bin_id": null,50 "to_bin_id": "bin-uuid",51 "reference_type": "stock_action",52 "reference_id": null,53 "notes": "Initial stock via API",54 "performed_by": "user-uuid",55 "timestamp": "2023-06-15T09:45:00Z"56 }57 ]58}1{2 "success": false,3 "message": "Stock not found"4}1{2 "success": false,3 "message": "Stock ID required"4}1{2 "success": false,3 "message": "Tenant not found"4}1{2 "success": false,3 "message": "Insufficient permissions"4}Update Inventory Stock
/warehousing/inventory-stock/:id?tenant_id={{tenant_id}}Updates an existing inventory stock record. Only provided fields will be updated (partial update). Validates that the stock record exists and belongs to the tenant before performing the update. Creates an audit transaction record for tracking changes. Authentication: - Requires valid authentication token - User must have 'manage:operations:tenant' permission Path Parameters: - id: UUID of the inventory stock record to update (required) Query Parameters: - tenant_id: UUID of the tenant (required if not in auth) Business Rules: - Stock record must exist and belong to the specified tenant - Only provided fields are updated (partial update supported) - Quantity must be a non-negative number if provided - Status must be one of: available, reserved, damaged, expired if provided - An inventory transaction record is automatically created for audit trail - Response includes list of fields that were actually changed
1curl --request PUT "$ONDI_BASE_URL/warehousing/inventory-stock/:id?tenant_id={{tenant_id}}" \2 --header "Authorization: Bearer {{access_token}}" \3 --header "Content-Type: application/json" \4 --header "Content-Type: application/json" \5 --data '{6 "quantity": 150,7 "unit_of_measure": "ea",8 "status": "available",9 "lot_number": "LOT456",10 "serial_number": "SN789",11 "expiration_date": "2025-01-31T00:00:00Z",12 "received_date": "2023-07-01T00:00:00Z",13 "last_counted_at": "2023-07-15T14:30:00Z",14 "notes": "Stock updated after cycle count"15}'1{2 "quantity": 150,3 "unit_of_measure": "ea",4 "status": "available",5 "lot_number": "LOT456",6 "serial_number": "SN789",7 "expiration_date": "2025-01-31T00:00:00Z",8 "received_date": "2023-07-01T00:00:00Z",9 "last_counted_at": "2023-07-15T14:30:00Z",10 "notes": "Stock updated after cycle count"11}Path parameters
idRequiredstock-uuid
UUID of the inventory stock record to update (required)
Query parameters
tenant_idOptional{{tenant_id}}
UUID of the tenant (required if not in auth)
Request body fields
quantityExampleExample field from the request body.
unit_of_measureExampleExample field from the request body.
statusExampleExample field from the request body.
lot_numberExampleExample field from the request body.
serial_numberExampleExample field from the request body.
expiration_dateExampleExample field from the request body.
received_dateExampleExample field from the request body.
last_counted_atExampleExample field from the request body.
notesExampleExample field from the request body.
Headers
AuthorizationOptionalBearer {{access_token}}
Content-TypeOptionalapplication/json
Responses
1{2 "success": true,3 "message": "Inventory stock updated successfully",4 "stock": {5 "id": "stock-uuid",6 "tenant_id": "tenant-uuid",7 "warehouse_id": "warehouse-uuid",8 "item_id": "item-uuid",9 "bin_id": "bin-uuid",10 "quantity": 150,11 "unit_of_measure": "ea",12 "status": "available",13 "lot_number": "LOT456",14 "serial_number": "SN789",15 "expiration_date": "2025-01-31T00:00:00Z",16 "received_date": "2023-07-01T00:00:00Z",17 "last_counted_at": "2023-07-15T14:30:00Z",18 "created_at": "2023-06-15T09:45:00Z",19 "updated_at": "2023-07-15T14:30:00Z",20 "item": {21 "id": "item-uuid",22 "name": "Test Product",23 "sku": "ITEM-001",24 "barcode": "123456789",25 "category": "Electronics",26 "subcategory": "Phones"27 },28 "bin": {29 "id": "bin-uuid",30 "name": "Bin A1",31 "code": "B-001",32 "location_type": "bin"33 },34 "warehouse": {35 "id": "warehouse-uuid",36 "name": "Main Warehouse",37 "code": "WH001"38 }39 },40 "changes": [41 "quantity",42 "lot_number",43 "serial_number",44 "expiration_date",45 "received_date",46 "last_counted_at"47 ]48}1{2 "success": false,3 "message": "Stock not found"4}1{2 "success": false,3 "message": "Stock ID required"4}1{2 "success": false,3 "message": "Quantity must be a non-negative number"4}1{2 "success": false,3 "message": "Invalid status. Must be one of: available, reserved, damaged, expired"4}1{2 "success": false,3 "message": "Tenant not found"4}1{2 "success": false,3 "message": "Insufficient permissions"4}1{2 "success": false,3 "message": "Invalid request body"4}