Inventory Transactions Management
3 API calls in this section.
Endpoints for managing inventory transactions that track all stock movements and adjustments within warehouses. These APIs provide a comprehensive audit trail of inventory changes, including what was moved, from where, to where, by whom, and when.
List Inventory Transactions
/warehousing/inventory-transactionsRetrieves 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.
User must have 'view:tenant' or 'manage:operations:tenant' permission
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)
Query parameters
| Parameter | Type | Description |
|---|---|---|
tenant_id | string | UUID of the tenant (required if not in auth) (required if not in auth): UUID of the tenant Example: |
warehouse_idOptional | string | UUID of the warehouse (optional) UUID of the warehouse to filter transactions |
item_idOptional | string | Filter by inventory item (optional) |
stock_idOptional | string | Filter by stock record (optional) |
searchOptional | string | Search in transaction type and reference type (optional) |
transaction_typeOptional | string | Filter by transaction type (optional) Filter by transaction type ( |
reference_typeOptional | string | Filter by reference type (optional) Filter by reference type (order, shipment, audit, return, transfer) |
timestamp_range_startOptional | string | Filter by transactions after this date (ISO format) (optional) |
timestamp_range_endOptional | string | Filter by transactions before this date (ISO format) (optional) |
pageOptional | string | Page number for pagination (optional, default: 1) Page number for pagination (default: 1) Example: |
limitOptional | string | Number of items per page (optional, default: 20) Number of items per page (default: 20) Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/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 ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json"Response examples
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": "[email protected]"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}Create Inventory Transaction
/warehousing/inventory-transactionsRecords 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.
User must have 'manage:operations:tenant' permission
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
adjustis accepted and normalized tostock_adjustmentQuantity must be positive
For "move" transactions, both
from_bin_idandto_bin_idare requiredFor "pick" transactions,
from_bin_idis required and quantity must not exceed available stockFor "count" transactions, the stock quantity is set to the counted quantity and
last_counted_atis updatedFrom bin must match the stock's current bin location
Reference type is required if
reference_idis providedStock record is automatically updated based on the transaction type
Query parameters
| Parameter | Type | Description |
|---|---|---|
tenant_id | string | UUID of the tenant (required if not in auth) (required if not in auth): UUID of the tenant Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
Body parameters
| Parameter | Type | Description |
|---|---|---|
warehouse_id | string | — |
item_id | string | — |
stock_id | string | — |
transaction_type | string | — |
quantity | number | — |
from_bin_id | string | — |
to_bin_id | string | — |
reference_id | string | — |
reference_type | string | — |
notes | string | — |
performed_by | string | — |
timestamp | string | — |
1curl --globoff --request POST "https://staging-api.ondi.io/functions/v1/warehousing/inventory-transactions?tenant_id=${TENANT_ID}" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json" \4 --data-raw '{5 "warehouse_id": "{{warehouse_id}}",6 "item_id": "{{item_id}}",7 "stock_id": "{{stock_id}}",8 "transaction_type": "move",9 "quantity": 10,10 "from_bin_id": "{{from_bin_id}}",11 "to_bin_id": "{{to_bin_id}}",12 "reference_id": "{{reference_id}}",13 "reference_type": "order",14 "notes": "Stock moved to fulfill order",15 "performed_by": "{{user_id}}",16 "timestamp": "2023-06-15T10:30:00Z"17}'Replace {{placeholders}} with your own values before sending.
Other request examples (1)
1{2 "warehouse_id": "uuid", // required3 "item_id": "uuid", // required4 "stock_id": "uuid", // required5 "transaction_type": "string", // required (receive, pick, move, stock_adjustment, return, count)6 "quantity": number, // required, must be positive7 "from_bin_id": "uuid", // optional, required for move and pick8 "to_bin_id": "uuid", // optional, required for move9 "reference_id": "uuid", // optional, related entity10 "reference_type": "string", // optional, type of reference (order, shipment, audit, return, transfer)11 "notes": "string", // optional12 "performed_by": "uuid", // optional, defaults to authenticated user13 "timestamp": "string" // optional, defaults to current time14}Response examples
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}Get Inventory Transaction
/warehousing/inventory-transactions/:idRetrieves details of a specific inventory transaction, including related entities such as the warehouse, item, stock, bins, and user who performed the action.
User must have 'view:tenant' or 'manage:operations:tenant' permission
Response
Returns detailed information about the specified inventory transaction
Includes related entities: warehouse, item, stock, bins, and user
Path parameters
| Parameter | Type | Description |
|---|---|---|
idRequired | string | UUID of the inventory transaction (required) Example: |
Query parameters
| Parameter | Type | Description |
|---|---|---|
tenant_id | string | UUID of the tenant (required if not in auth) (required if not in auth): UUID of the tenant Example: |
Headers
| Parameter | Type | Description |
|---|---|---|
Authorization | string | Example: |
Content-Type | string | Example: |
1curl --globoff --request GET "https://staging-api.ondi.io/functions/v1/warehousing/inventory-transactions/${ID}?tenant_id=${TENANT_ID}" \2 --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3 --header "Content-Type: application/json"Response examples
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": "[email protected]"51 }52 }53}