Inventory Transactions Management
3 API calls in this section.
List Inventory Transactions
/warehousing/inventory-transactions?tenant_id={{tenant_id}}&warehouse_id=&item_id=&stock_id=&search=&transaction_type=&reference_type=×tamp_range_start=×tamp_range_end=&page=1&limit=20Retrieves inventory transactions with comprehensive filtering options. Each transaction represents a stock movement or adjustment, providing detailed information about what items were affected, where they moved from/to, who performed the action, and when it occurred. Authentication: - Requires valid authentication token - User must have 'view:tenant' or 'manage:operations:tenant' permission Query Parameters: - tenant_id (required if not in auth): UUID of the tenant - warehouse_id (optional): UUID of the warehouse to filter transactions - item_id (optional): Filter by inventory item - stock_id (optional): Filter by stock record - search (optional): Search in transaction type and reference type - transaction_type (optional): Filter by transaction type (initial_stock, receive, pick, move, stock_adjustment, return, count). Legacy adjust is also accepted and normalized to stock_adjustment. - reference_type (optional): Filter by reference type (order, shipment, audit, return, transfer) - timestamp_range_start (optional): Filter by transactions after this date (ISO format) - timestamp_range_end (optional): Filter by transactions before this date (ISO format) - page (optional): Page number for pagination (default: 1) - limit (optional): Number of items per page (default: 20) Response: - Returns a paginated list of inventory transactions with details - Includes related entities: warehouse, item, stock, bins, and user - Provides available transaction types and reference types for filtering - Includes pagination information (total count, current page, limit)
1curl --request GET "$ONDI_BASE_URL/warehousing/inventory-transactions?tenant_id={{tenant_id}}&warehouse_id=&item_id=&stock_id=&search=&transaction_type=&reference_type=×tamp_range_start=×tamp_range_end=&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 if not in auth)
warehouse_idOptionalUUID of the warehouse (optional)
item_idOptionalFilter by inventory item (optional)
stock_idOptionalFilter by stock record (optional)
searchOptionalSearch in transaction type and reference type (optional)
transaction_typeOptionalFilter by transaction type (optional)
reference_typeOptionalFilter by reference type (optional)
timestamp_range_startOptionalFilter by transactions after this date (ISO format) (optional)
timestamp_range_endOptionalFilter by transactions before this date (ISO format) (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 transactions retrieved successfully",4 "inventory_transactions": [5 {6 "id": "transaction-uuid-1",7 "tenant_id": "tenant-uuid",8 "warehouse_id": "warehouse-uuid",9 "item_id": "item-uuid",10 "stock_id": "stock-uuid",11 "transaction_type": "move",12 "quantity": 10,13 "from_bin_id": "bin-uuid-1",14 "to_bin_id": "bin-uuid-2",15 "reference_id": "order-uuid",16 "reference_type": "order",17 "notes": "Stock moved to fulfill order",18 "performed_by": "user-uuid",19 "timestamp": "2023-06-15T10:30:00Z",20 "warehouse": {21 "id": "warehouse-uuid",22 "name": "Main Warehouse",23 "code": "WH001"24 },25 "item": {26 "id": "item-uuid",27 "sku": "ITEM-001",28 "name": "Test Product",29 "category": "Electronics"30 },31 "stock": {32 "id": "stock-uuid",33 "quantity": 40,34 "unit_of_measure": "ea",35 "status": "available"36 },37 "from_bin": {38 "id": "bin-uuid-1",39 "code": "A-01-01",40 "location_type": "bin"41 },42 "to_bin": {43 "id": "bin-uuid-2",44 "code": "B-01-01",45 "location_type": "bin"46 },47 "user": {48 "id": "user-uuid",49 "first_name": "John",50 "last_name": "Doe",51 "email": "john.doe@example.com"52 }53 }54 ],55 "stats": {56 "total": 1,57 "initial_stock": 0,58 "stock_adjustment": 0,59 "move": 160 },61 "page": 1,62 "limit": 20,63 "total": 164}1{2 "success": false,3 "message": "Warehouse ID required"4}1{2 "success": false,3 "message": "Warehouse not found"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": "Internal server error"4}Create Inventory Transaction
/warehousing/inventory-transactions?tenant_id={{tenant_id}}Records a new inventory transaction for tracking stock movements. The endpoint updates the related inventory stock records based on the transaction type. Automatically creates an audit trail of all inventory changes. Authentication: - Requires valid authentication token - User must have 'manage:operations:tenant' permission Query Parameters: - tenant_id (required if not in auth): UUID of the tenant Business Rules: - Warehouse must exist and belong to the specified tenant - Stock record must exist and belong to the specified warehouse - Item ID must match the stock's item ID - Transaction type must be one of the valid API types - Legacy adjust is accepted and normalized to stock_adjustment - Quantity must be positive - For "move" transactions, both from_bin_id and to_bin_id are required - For "pick" transactions, from_bin_id is required and quantity must not exceed available stock - For "count" transactions, the stock quantity is set to the counted quantity and last_counted_at is updated - From bin must match the stock's current bin location - Reference type is required if reference_id is provided - Stock record is automatically updated based on the transaction type
1curl --request POST "$ONDI_BASE_URL/warehousing/inventory-transactions?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 "stock_id": "{{stock_id}}",9 "transaction_type": "move",10 "quantity": 10,11 "from_bin_id": "{{from_bin_id}}",12 "to_bin_id": "{{to_bin_id}}",13 "reference_id": "{{reference_id}}",14 "reference_type": "order",15 "notes": "Stock moved to fulfill order",16 "performed_by": "{{user_id}}",17 "timestamp": "2023-06-15T10:30:00Z"18}'1{2 "warehouse_id": "{{warehouse_id}}",3 "item_id": "{{item_id}}",4 "stock_id": "{{stock_id}}",5 "transaction_type": "move",6 "quantity": 10,7 "from_bin_id": "{{from_bin_id}}",8 "to_bin_id": "{{to_bin_id}}",9 "reference_id": "{{reference_id}}",10 "reference_type": "order",11 "notes": "Stock moved to fulfill order",12 "performed_by": "{{user_id}}",13 "timestamp": "2023-06-15T10:30:00Z"14}Query parameters
tenant_idOptional{{tenant_id}}
UUID of the tenant (required if not in auth)
Request body fields
warehouse_idExampleExample field from the request body.
item_idExampleExample field from the request body.
stock_idExampleExample field from the request body.
transaction_typeExampleExample field from the request body.
quantityExampleExample field from the request body.
from_bin_idExampleExample field from the request body.
to_bin_idExampleExample field from the request body.
reference_idExampleExample field from the request body.
reference_typeExampleExample field from the request body.
notesExampleExample field from the request body.
performed_byExampleExample field from the request body.
timestampExampleExample field from the request body.
Headers
AuthorizationOptionalBearer {{access_token}}
Content-TypeOptionalapplication/json
Responses
1{2 "success": true,3 "message": "Inventory transaction created successfully",4 "inventory_transaction": {5 "id": "transaction-uuid",6 "tenant_id": "tenant-uuid",7 "warehouse_id": "warehouse-uuid",8 "item_id": "item-uuid",9 "stock_id": "stock-uuid",10 "transaction_type": "move",11 "quantity": 10,12 "from_bin_id": "bin-uuid-1",13 "to_bin_id": "bin-uuid-2",14 "reference_id": "order-uuid",15 "reference_type": "order",16 "notes": "Stock moved to fulfill order",17 "performed_by": "user-uuid",18 "timestamp": "2023-06-15T10:30:00Z"19 },20 "updated_stock": {21 "id": "stock-uuid",22 "tenant_id": "tenant-uuid",23 "warehouse_id": "warehouse-uuid",24 "item_id": "item-uuid",25 "bin_id": "bin-uuid-2",26 "quantity": 40,27 "status": "available",28 "updated_at": "2023-06-15T10:30:00Z"29 }30}1{2 "success": false,3 "message": "Field required: transaction_type"4}1{2 "success": false,3 "message": "Invalid transaction type"4}1{2 "success": false,3 "message": "Move requires from and to bins"4}1{2 "success": false,3 "message": "From bin must match stock bin"4}1{2 "success": false,3 "message": "Reference type required when reference ID provided"4}1{2 "success": false,3 "message": "Invalid reference type"4}1{2 "success": false,3 "message": "Insufficient stock"4}1{2 "success": false,3 "message": "Item ID mismatch"4}1{2 "success": false,3 "message": "Warehouse not found"4}1{2 "success": false,3 "message": "Stock not found"4}1{2 "success": false,3 "message": "To bin not found"4}1{2 "success": false,3 "message": "Performed by user not found"4}1{2 "success": false,3 "message": "Insufficient permissions"4}Get Inventory Transaction
/warehousing/inventory-transactions/:id?tenant_id={{tenant_id}}Retrieves details of a specific inventory transaction, including related entities such as the warehouse, item, stock, bins, and user who performed the action. Authentication: - Requires valid authentication token - User must have 'view:tenant' or 'manage:operations:tenant' permission Path Parameters: - id: UUID of the inventory transaction (required) Query Parameters: - tenant_id (required if not in auth): UUID of the tenant Response: - Returns detailed information about the specified inventory transaction - Includes related entities: warehouse, item, stock, bins, and user
1curl --request GET "$ONDI_BASE_URL/warehousing/inventory-transactions/:id?tenant_id={{tenant_id}}" \2 --header "Authorization: Bearer {{access_token}}" \3 --header "Content-Type: application/json"Path parameters
idRequiredtransaction-uuid
UUID of the inventory transaction (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": "Transaction retrieved successfully",4 "inventory_transaction": {5 "id": "transaction-uuid",6 "tenant_id": "tenant-uuid",7 "warehouse_id": "warehouse-uuid",8 "item_id": "item-uuid",9 "stock_id": "stock-uuid",10 "transaction_type": "move",11 "quantity": 10,12 "from_bin_id": "bin-uuid-1",13 "to_bin_id": "bin-uuid-2",14 "reference_id": "order-uuid",15 "reference_type": "order",16 "notes": "Stock moved to fulfill order",17 "performed_by": "user-uuid",18 "timestamp": "2023-06-15T10:30:00Z",19 "warehouse": {20 "id": "warehouse-uuid",21 "name": "Main Warehouse",22 "code": "WH001"23 },24 "item": {25 "id": "item-uuid",26 "sku": "ITEM-001",27 "name": "Test Product",28 "category": "Electronics"29 },30 "stock": {31 "id": "stock-uuid",32 "quantity": 40,33 "unit_of_measure": "ea",34 "status": "available"35 },36 "from_bin": {37 "id": "bin-uuid-1",38 "code": "A-01-01",39 "location_type": "bin"40 },41 "to_bin": {42 "id": "bin-uuid-2",43 "code": "B-01-01",44 "location_type": "bin"45 },46 "user": {47 "id": "user-uuid",48 "first_name": "John",49 "last_name": "Doe",50 "email": "john.doe@example.com"51 }52 }53}1{2 "success": false,3 "message": "Transaction ID required"4}1{2 "success": false,3 "message": "Transaction not found"4}1{2 "success": false,3 "message": "Tenant not found"4}1{2 "success": false,3 "message": "Insufficient permissions"4}