Inventory Categories Management
5 API calls in this section.
List Inventory Categories
/warehousing/inventory-categories?tenant_id={{tenant_id}}&parent_id=&root_category=&is_active=&search=&page=1&limit=20Retrieves warehouse inventory categories for a tenant with filtering and pagination. 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 - parent_id (optional): Filter by parent category (UUID). Use 'null' to return only root categories. If provided, it overrides root_category. - root_category (optional): When true, return only root categories (parent_id IS NULL); when false, only non-root categories (parent_id IS NOT NULL). - is_active (optional): Filter by active status (true or false) - search (optional): Case-insensitive search on multilingual name and description - page (optional): Page number for pagination (default: 1) - limit (optional): Number of items per page (default: 20) Response: - Returns a paginated list of categories - Each category includes: - id, tenant_id, parent_id, name (multi-language object), description (multi-language object), is_active, sort_order, metadata, created_at, updated_at - parent: if the parent category is present in the current list page, a nested object with the same shape as a category (otherwise null)
1curl --request GET "$ONDI_BASE_URL/warehousing/inventory-categories?tenant_id={{tenant_id}}&parent_id=&root_category=&is_active=&search=&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)
parent_idOptionalFilter by parent category ID (use 'null' for root categories). Takes precedence over root_category. (optional)
root_categoryOptionalWhen true, only root categories (parent_id IS NULL). When false, only non-root categories (parent_id IS NOT NULL). Ignored if parent_id is provided. (optional)
is_activeOptionalFilter by active status: true or false (optional)
searchOptionalSearch in name and description (optional, across all languages)
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": "Warehouse item categories retrieved successfully",4 "categories": [5 {6 "id": "cat-root-uuid",7 "tenant_id": "tenant-uuid",8 "parent_id": null,9 "name": {10 "en": "Electronics",11 "ar": "الكترونيات",12 "ku": "Elektronîk"13 },14 "description": {15 "en": "All electronic items"16 },17 "is_active": true,18 "sort_order": 0,19 "metadata": {},20 "created_at": "2025-01-01T00:00:00Z",21 "updated_at": "2025-01-01T00:00:00Z",22 "parent": null23 },24 {25 "id": "cat-child-uuid",26 "tenant_id": "tenant-uuid",27 "parent_id": "cat-root-uuid",28 "name": {29 "en": "Audio"30 },31 "description": {32 "en": "Headphones, speakers, and audio accessories"33 },34 "is_active": true,35 "sort_order": 10,36 "metadata": {},37 "created_at": "2025-01-01T00:00:00Z",38 "updated_at": "2025-01-01T00:00:00Z",39 "parent": {40 "id": "cat-root-uuid",41 "tenant_id": "tenant-uuid",42 "parent_id": null,43 "name": {44 "en": "Electronics",45 "ar": "الكترونيات",46 "ku": "Elektronîk"47 },48 "description": {49 "en": "All electronic items"50 },51 "is_active": true,52 "sort_order": 0,53 "metadata": {},54 "created_at": "2025-01-01T00:00:00Z",55 "updated_at": "2025-01-01T00:00:00Z"56 }57 }58 ],59 "page": 1,60 "limit": 20,61 "total": 262}Create Inventory Category
/warehousing/inventory-categories?tenant_id={{tenant_id}}Creates a new warehouse inventory category. 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: - name is required, must be a multi-language object, and must be unique per tenant (on the stored JSON value) - parent_id, if provided, must reference an existing category for the same tenant
1curl --request POST "$ONDI_BASE_URL/warehousing/inventory-categories?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 "name": {7 "en": "Electronics",8 "ar": "الكترونيات",9 "ku": "Elektronîk"10 },11 "description": {12 "en": "All electronic inventory items"13 },14 "parent_id": null,15 "is_active": true,16 "sort_order": 0,17 "metadata": {18 "icon": "bolt"19 }20}'1{2 "name": {3 "en": "Electronics",4 "ar": "الكترونيات",5 "ku": "Elektronîk"6 },7 "description": {8 "en": "All electronic inventory items"9 },10 "parent_id": null,11 "is_active": true,12 "sort_order": 0,13 "metadata": {14 "icon": "bolt"15 }16}Query parameters
tenant_idOptional{{tenant_id}}
UUID of the tenant (required if not in auth)
Request body fields
nameExampleExample field from the request body.
name.enExampleExample field from the request body.
name.arExampleExample field from the request body.
name.kuExampleExample field from the request body.
descriptionExampleExample field from the request body.
description.enExampleExample field from the request body.
parent_idExampleExample field from the request body.
is_activeExampleExample field from the request body.
sort_orderExampleExample field from the request body.
metadataExampleExample field from the request body.
metadata.iconExampleExample field from the request body.
Headers
AuthorizationOptionalBearer {{access_token}}
Content-TypeOptionalapplication/json
Responses
1{2 "success": true,3 "message": "Warehouse item category created successfully",4 "category": {5 "id": "new-category-uuid",6 "tenant_id": "tenant-uuid",7 "parent_id": null,8 "name": {9 "en": "Electronics"10 },11 "description": {12 "en": "All electronic inventory items"13 },14 "is_active": true,15 "sort_order": 0,16 "metadata": {17 "icon": "bolt"18 },19 "created_at": "2025-01-01T10:00:00Z",20 "updated_at": "2025-01-01T10:00:00Z"21 }22}Get Inventory Category
/warehousing/inventory-categories/:id?tenant_id={{tenant_id}}Retrieves a single warehouse inventory category by ID.
1curl --request GET "$ONDI_BASE_URL/warehousing/inventory-categories/:id?tenant_id={{tenant_id}}" \2 --header "Authorization: Bearer {{access_token}}" \3 --header "Content-Type: application/json"Path parameters
idRequiredcategory-uuid
UUID of the inventory category (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": "Warehouse item category retrieved successfully",4 "category": {5 "id": "category-uuid",6 "tenant_id": "tenant-uuid",7 "parent_id": "parent-category-uuid",8 "name": {9 "en": "Electronics"10 },11 "description": {12 "en": "All electronic inventory items"13 },14 "is_active": true,15 "sort_order": 0,16 "metadata": {},17 "created_at": "2025-01-01T00:00:00Z",18 "updated_at": "2025-01-01T00:00:00Z",19 "parent": {20 "id": "parent-category-uuid",21 "tenant_id": "tenant-uuid",22 "parent_id": null,23 "name": {24 "en": "Root Category"25 },26 "description": {27 "en": "Parent category description"28 },29 "is_active": true,30 "sort_order": 0,31 "metadata": {},32 "created_at": "2025-01-01T00:00:00Z",33 "updated_at": "2025-01-01T00:00:00Z"34 }35 }36}Update Inventory Category
/warehousing/inventory-categories/:id?tenant_id={{tenant_id}}Updates an existing warehouse inventory category. Only provided fields will be updated.
1curl --request PUT "$ONDI_BASE_URL/warehousing/inventory-categories/: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 "name": {7 "en": "Electronics & Gadgets"8 },9 "description": {10 "en": "Updated description for electronics inventory items"11 },12 "is_active": true,13 "sort_order": 5,14 "metadata": {15 "icon": "bolt"16 }17}'1{2 "name": {3 "en": "Electronics & Gadgets"4 },5 "description": {6 "en": "Updated description for electronics inventory items"7 },8 "is_active": true,9 "sort_order": 5,10 "metadata": {11 "icon": "bolt"12 }13}Path parameters
idRequiredcategory-uuid
UUID of the inventory category to update (required)
Query parameters
tenant_idOptional{{tenant_id}}
UUID of the tenant (required if not in auth)
Request body fields
nameExampleExample field from the request body.
name.enExampleExample field from the request body.
descriptionExampleExample field from the request body.
description.enExampleExample field from the request body.
is_activeExampleExample field from the request body.
sort_orderExampleExample field from the request body.
metadataExampleExample field from the request body.
metadata.iconExampleExample field from the request body.
Headers
AuthorizationOptionalBearer {{access_token}}
Content-TypeOptionalapplication/json
Responses
1{2 "success": true,3 "message": "Warehouse item category updated successfully",4 "category": {5 "id": "category-uuid",6 "tenant_id": "tenant-uuid",7 "parent_id": null,8 "name": {9 "en": "Electronics & Gadgets"10 },11 "description": {12 "en": "Updated description for electronics inventory items"13 },14 "is_active": true,15 "sort_order": 5,16 "metadata": {17 "icon": "bolt"18 },19 "created_at": "2025-01-01T00:00:00Z",20 "updated_at": "2025-01-02T10:00:00Z"21 }22}Delete Inventory Category
/warehousing/inventory-categories/:id?tenant_id={{tenant_id}}Deletes a warehouse inventory category. Note: This performs a hard delete. Make sure the category is not in use before calling this endpoint.
1curl --request DELETE "$ONDI_BASE_URL/warehousing/inventory-categories/:id?tenant_id={{tenant_id}}" \2 --header "Authorization: Bearer {{access_token}}" \3 --header "Content-Type: application/json"Path parameters
idRequiredcategory-uuid
UUID of the inventory category to delete (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": "Warehouse item category deleted successfully",4 "id": "category-uuid"5}