Suppliers Management
4 API calls in this section.
List Suppliers
/warehousing/suppliers?tenant_id={{tenant_id}}&name=&supplier_type=&page=1&limit=20Retrieves a paginated list of suppliers with optional filtering by name and supplier type. Authentication: - Requires valid authentication token - User must have 'view:tenant', 'manage:operations:tenant' permission, or be a system admin Query Parameters: - tenant_id (required if not in auth context): UUID of the tenant - name (optional): Filter suppliers by name (partial match) - supplier_type (optional): Filter by supplier type (exact match) - page (optional): Page number for pagination (default: 1) - limit (optional): Number of records per page (default: 20) Response: - Returns a paginated list of suppliers with their details - Includes related tenant user information - Provides filter options for supplier types - Includes pagination metadata (total count, current page, limit)
1curl --request GET "$ONDI_BASE_URL/warehousing/suppliers?tenant_id={{tenant_id}}&name=&supplier_type=&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 context)
nameOptionalFilter suppliers by name (optional)
supplier_typeOptionalFilter by supplier type (e.g., 'manufacturer', 'distributor') (optional)
pageOptional1
Page number for pagination (optional, default: 1)
limitOptional20
Number of records per page (optional, default: 20)
Headers
AuthorizationOptionalBearer {{access_token}}
Content-TypeOptionalapplication/json
Responses
1{2 "success": true,3 "message": "Suppliers retrieved successfully",4 "suppliers": [5 {6 "id": "supplier-uuid-1",7 "tenant_id": "tenant-uuid",8 "name": "ABC Manufacturing",9 "tenant_user_id": "tenant-user-uuid-1",10 "supplier_type": "manufacturer",11 "tenant_user": {12 "id": "tenant-user-uuid-1",13 "user_id": {14 "first_name": "John",15 "last_name": "Doe",16 "email": "john.doe@example.com"17 }18 }19 },20 {21 "id": "supplier-uuid-2",22 "tenant_id": "tenant-uuid",23 "name": "XYZ Distributors",24 "tenant_user_id": "tenant-user-uuid-2",25 "supplier_type": "distributor",26 "tenant_user": {27 "id": "tenant-user-uuid-2",28 "user_id": {29 "first_name": "Jane",30 "last_name": "Smith",31 "email": "jane.smith@example.com"32 }33 }34 }35 ],36 "stats": {37 "total": 2,38 "distributor": 1,39 "manufacturer": 1,40 "wholesaler": 041 },42 "filter_options": {43 "supplier_types": [44 "manufacturer",45 "distributor",46 "wholesaler"47 ]48 },49 "page": 1,50 "limit": 20,51 "total": 252}1{2 "success": false,3 "message": "Tenant not found"4}1{2 "success": false,3 "message": "Insufficient permissions"4}Create Supplier
/warehousing/suppliers?tenant_id={{tenant_id}}Creates a new supplier with the specified name, tenant user, and supplier type. Authentication: - Requires valid authentication token - User must have 'manage:operations:tenant' permission or be a system admin Query Parameters: - tenant_id (required if not in auth context): UUID of the tenant Business Rules: - All fields are required - Tenant user must exist and belong to the specified tenant - The operation creates a new supplier record in the system
1curl --request POST "$ONDI_BASE_URL/warehousing/suppliers?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": "New Supplier Inc.",7 "tenant_user_id": "{{tenant_user_id}}",8 "supplier_type": "manufacturer"9}'1{2 "name": "New Supplier Inc.",3 "tenant_user_id": "{{tenant_user_id}}",4 "supplier_type": "manufacturer"5}Query parameters
tenant_idOptional{{tenant_id}}
UUID of the tenant (required if not in auth context)
Request body fields
nameExampleExample field from the request body.
tenant_user_idExampleExample field from the request body.
supplier_typeExampleExample field from the request body.
Headers
AuthorizationOptionalBearer {{access_token}}
Content-TypeOptionalapplication/json
Responses
1{2 "success": true,3 "message": "Supplier created successfully",4 "supplier": {5 "id": "supplier-uuid-new",6 "tenant_id": "tenant-uuid",7 "name": "New Supplier Inc.",8 "tenant_user_id": "tenant-user-uuid",9 "supplier_type": "manufacturer",10 "tenant_user": {11 "id": "tenant-user-uuid",12 "user_id": {13 "first_name": "John",14 "last_name": "Doe",15 "email": "john.doe@example.com"16 }17 }18 }19}1{2 "success": false,3 "message": "Field required supplier_type"4}1{2 "success": false,3 "message": "Tenant user not found"4}1{2 "success": false,3 "message": "Insufficient permissions"4}Get Supplier
/warehousing/suppliers/:id?tenant_id={{tenant_id}}Retrieves detailed information about a specific supplier, including associated tenant user details. Authentication: - Requires valid authentication token - User must have 'view:tenant', 'manage:operations:tenant' permission, or be a system admin Path Parameters: - id (required): UUID of the supplier to retrieve Query Parameters: - tenant_id (required if not in auth context): UUID of the tenant Response: - Returns complete supplier information - Includes related tenant user details
1curl --request GET "$ONDI_BASE_URL/warehousing/suppliers/:id?tenant_id={{tenant_id}}" \2 --header "Authorization: Bearer {{access_token}}" \3 --header "Content-Type: application/json"Path parameters
idRequired{{supplier_id}}
UUID of the supplier to retrieve (required)
Query parameters
tenant_idOptional{{tenant_id}}
UUID of the tenant (required if not in auth context)
Headers
AuthorizationOptionalBearer {{access_token}}
Content-TypeOptionalapplication/json
Responses
1{2 "success": true,3 "message": "Supplier retrieved successfully",4 "supplier": {5 "id": "supplier-uuid-1",6 "tenant_id": "tenant-uuid",7 "name": "ABC Manufacturing",8 "tenant_user_id": "tenant-user-uuid-1",9 "supplier_type": "manufacturer",10 "tenant_user": {11 "id": "tenant-user-uuid-1",12 "user_id": {13 "first_name": "John",14 "last_name": "Doe",15 "email": "john.doe@example.com"16 }17 }18 }19}1{2 "success": false,3 "message": "Supplier not found"4}1{2 "success": false,3 "message": "Insufficient permissions"4}Update Supplier
/warehousing/suppliers/:id?tenant_id={{tenant_id}}Updates an existing supplier with new information provided in the request body. Authentication: - Requires valid authentication token - User must have 'manage:operations:tenant' permission or be a system admin Path Parameters: - id (required): UUID of the supplier to update Query Parameters: - tenant_id (required if not in auth context): UUID of the tenant Business Rules: - At least one field must be provided for update - If tenant_user_id is provided, it must be a valid tenant user belonging to the tenant - Only provided fields will be updated
1curl --request PUT "$ONDI_BASE_URL/warehousing/suppliers/: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": "Updated Supplier Name",7 "tenant_user_id": "{{tenant_user_id}}",8 "supplier_type": "distributor"9}'1{2 "name": "Updated Supplier Name",3 "tenant_user_id": "{{tenant_user_id}}",4 "supplier_type": "distributor"5}Path parameters
idRequired{{supplier_id}}
UUID of the supplier to update (required)
Query parameters
tenant_idOptional{{tenant_id}}
UUID of the tenant (required if not in auth context)
Request body fields
nameExampleExample field from the request body.
tenant_user_idExampleExample field from the request body.
supplier_typeExampleExample field from the request body.
Headers
AuthorizationOptionalBearer {{access_token}}
Content-TypeOptionalapplication/json
Responses
1{2 "success": true,3 "message": "Supplier updated successfully",4 "supplier": {5 "id": "supplier-uuid-1",6 "tenant_id": "tenant-uuid",7 "name": "Updated Supplier Name",8 "tenant_user_id": "tenant-user-uuid-2",9 "supplier_type": "distributor",10 "tenant_user": {11 "id": "tenant-user-uuid-2",12 "user_id": {13 "first_name": "Jane",14 "last_name": "Smith",15 "email": "jane.smith@example.com"16 }17 }18 }19}1{2 "success": false,3 "message": "Supplier not found"4}1{2 "success": false,3 "message": "Tenant user not found"4}1{2 "success": false,3 "message": "Insufficient permissions"4}