Skip to main content

Suppliers Management

4 API calls in this section.

List Suppliers

Warehousing / Suppliers Management
GET/warehousing/suppliers?tenant_id={{tenant_id}}&name=&supplier_type=&page=1&limit=20

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

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

{{tenant_id}}

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

nameOptional
query string

Filter suppliers by name (optional)

supplier_typeOptional
query string

Filter by supplier type (e.g., 'manufacturer', 'distributor') (optional)

pageOptional
query string

1

Page number for pagination (optional, default: 1)

limitOptional
query string

20

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

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

Success Response200OK
Response body
json
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}
Error - Tenant Not Found404Not Found
Response body
json
1{2  "success": false,3  "message": "Tenant not found"4}
Error - Insufficient Permissions403Forbidden
Response body
json
1{2  "success": false,3  "message": "Insufficient permissions"4}

Create Supplier

Warehousing / Suppliers Management
POST/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

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
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}'
Request body
json
1{2  "name": "New Supplier Inc.",3  "tenant_user_id": "{{tenant_user_id}}",4  "supplier_type": "manufacturer"5}

Query parameters

tenant_idOptional
query string

{{tenant_id}}

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

Request body fields

nameExample
string

Example field from the request body.

tenant_user_idExample
string

Example field from the request body.

supplier_typeExample
string

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

Success Response201Created
Response body
json
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}
Error - Missing Required Field400Bad Request
Response body
json
1{2  "success": false,3  "message": "Field required supplier_type"4}
Error - Tenant User Not Found404Not Found
Response body
json
1{2  "success": false,3  "message": "Tenant user not found"4}
Error - Insufficient Permissions403Forbidden
Response body
json
1{2  "success": false,3  "message": "Insufficient permissions"4}

Get Supplier

Warehousing / Suppliers Management
GET/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

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

{{supplier_id}}

UUID of the supplier to retrieve (required)

Query parameters

tenant_idOptional
query string

{{tenant_id}}

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

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

Success Response200OK
Response body
json
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}
Error - Supplier Not Found404Not Found
Response body
json
1{2  "success": false,3  "message": "Supplier not found"4}
Error - Insufficient Permissions403Forbidden
Response body
json
1{2  "success": false,3  "message": "Insufficient permissions"4}

Update Supplier

Warehousing / Suppliers Management
PUT/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

Send a bearer token in the Authorization header for an authenticated OnDi user session.
Request
curl
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}'
Request body
json
1{2  "name": "Updated Supplier Name",3  "tenant_user_id": "{{tenant_user_id}}",4  "supplier_type": "distributor"5}

Path parameters

idRequired
path string

{{supplier_id}}

UUID of the supplier to update (required)

Query parameters

tenant_idOptional
query string

{{tenant_id}}

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

Request body fields

nameExample
string

Example field from the request body.

tenant_user_idExample
string

Example field from the request body.

supplier_typeExample
string

Example field from the request body.

Headers

AuthorizationOptional
header string

Bearer {{access_token}}

Content-TypeOptional
header string

application/json

Responses

Success Response200OK
Response body
json
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}
Error - Supplier Not Found404Not Found
Response body
json
1{2  "success": false,3  "message": "Supplier not found"4}
Error - Tenant User Not Found404Not Found
Response body
json
1{2  "success": false,3  "message": "Tenant user not found"4}
Error - Insufficient Permissions403Forbidden
Response body
json
1{2  "success": false,3  "message": "Insufficient permissions"4}