Skip to main content

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 Transactions Management
GET/warehousing/inventory-transactions

Retrieves 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

ParameterTypeDescription
tenant_idstring

UUID of the tenant (required if not in auth) (required if not in auth): UUID of the tenant

Example: {{tenant_id}}

warehouse_idOptionalstring

UUID of the warehouse (optional) UUID of the warehouse to filter transactions

item_idOptionalstring

Filter by inventory item (optional)

stock_idOptionalstring

Filter by stock record (optional)

searchOptionalstring

Search in transaction type and reference type (optional)

transaction_typeOptionalstring

Filter by 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_typeOptionalstring

Filter by reference type (optional) Filter by reference type (order, shipment, audit, return, transfer)

timestamp_range_startOptionalstring

Filter by transactions after this date (ISO format) (optional)

timestamp_range_endOptionalstring

Filter by transactions before this date (ISO format) (optional)

pageOptionalstring

Page number for pagination (optional, default: 1) Page number for pagination (default: 1)

Example: 1

limitOptionalstring

Number of items per page (optional, default: 20) Number of items per page (default: 20)

Example: 20

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Staging
Request
curl
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=&timestamp_range_start=&timestamp_range_end=&page=1&limit=20" \2  --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3  --header "Content-Type: application/json"

Response examples

200Success Response
Response body
json
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}

Create Inventory Transaction​

Warehousing / Inventory Transactions Management
POST/warehousing/inventory-transactions

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.

  • 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 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

Query parameters

ParameterTypeDescription
tenant_idstring

UUID of the tenant (required if not in auth) (required if not in auth): UUID of the tenant

Example: {{tenant_id}}

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Body parameters

ParameterTypeDescription
warehouse_idstring—
item_idstring—
stock_idstring—
transaction_typestring—
quantitynumber—
from_bin_idstring—
to_bin_idstring—
reference_idstring—
reference_typestring—
notesstring—
performed_bystring—
timestampstring—
Staging
Request
curl
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)
Request example 1
text
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

201Success Response
Response body
json
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 Management
GET/warehousing/inventory-transactions/:id

Retrieves 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

ParameterTypeDescription
idRequiredstring

UUID of the inventory transaction (required)

Example: transaction-uuid

Query parameters

ParameterTypeDescription
tenant_idstring

UUID of the tenant (required if not in auth) (required if not in auth): UUID of the tenant

Example: {{tenant_id}}

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Staging
Request
curl
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

200Success Response
Response body
json
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}