Skip to main content

Inventory Categories Management

5 API calls in this section.

List Inventory Categories

Warehousing / Inventory Categories Management
GET/warehousing/inventory-categories?tenant_id={{tenant_id}}&parent_id=&root_category=&is_active=&search=&page=1&limit=20

Retrieves 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)

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
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
query string

{{tenant_id}}

UUID of the tenant (required if not in auth)

parent_idOptional
query string

Filter by parent category ID (use 'null' for root categories). Takes precedence over root_category. (optional)

root_categoryOptional
query string

When 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_activeOptional
query string

Filter by active status: true or false (optional)

searchOptional
query string

Search in name and description (optional, across all languages)

pageOptional
query string

1

Page number for pagination (optional, default: 1)

limitOptional
query string

20

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

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

Success Response200
Response body
json
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 Management
POST/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

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
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}'
Request body
json
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
query string

{{tenant_id}}

UUID of the tenant (required if not in auth)

Request body fields

nameExample
object

Example field from the request body.

name.enExample
string

Example field from the request body.

name.arExample
string

Example field from the request body.

name.kuExample
string

Example field from the request body.

descriptionExample
object

Example field from the request body.

description.enExample
string

Example field from the request body.

parent_idExample
null

Example field from the request body.

is_activeExample
boolean

Example field from the request body.

sort_orderExample
number

Example field from the request body.

metadataExample
object

Example field from the request body.

metadata.iconExample
string

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

Success Response201
Response body
json
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 Management
GET/warehousing/inventory-categories/:id?tenant_id={{tenant_id}}

Retrieves a single warehouse inventory category by ID.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
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

idRequired
path string

category-uuid

UUID of the inventory category (required)

Query parameters

tenant_idOptional
query string

{{tenant_id}}

UUID of the tenant (required if not in auth)

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

Success Response200
Response body
json
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 Management
PUT/warehousing/inventory-categories/:id?tenant_id={{tenant_id}}

Updates an existing warehouse inventory category. Only provided fields will be updated.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
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}'
Request body
json
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

idRequired
path string

category-uuid

UUID of the inventory category to update (required)

Query parameters

tenant_idOptional
query string

{{tenant_id}}

UUID of the tenant (required if not in auth)

Request body fields

nameExample
object

Example field from the request body.

name.enExample
string

Example field from the request body.

descriptionExample
object

Example field from the request body.

description.enExample
string

Example field from the request body.

is_activeExample
boolean

Example field from the request body.

sort_orderExample
number

Example field from the request body.

metadataExample
object

Example field from the request body.

metadata.iconExample
string

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

Success Response200
Response body
json
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 Management
DELETE/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.

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
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

idRequired
path string

category-uuid

UUID of the inventory category to delete (required)

Query parameters

tenant_idOptional
query string

{{tenant_id}}

UUID of the tenant (required if not in auth)

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

Success Response200
Response body
json
1{2  "success": true,3  "message": "Warehouse item category deleted successfully",4  "id": "category-uuid"5}