Skip to main content

Suppliers Management

4 API calls in this section.

List Suppliers​

Warehousing / Suppliers Management
GET/warehousing/suppliers

Retrieves a paginated list of suppliers with optional filtering by name and supplier type.

  • User must have 'view:tenant', 'manage:operations:tenant' permission, or be a system admin

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)

Query parameters

ParameterTypeDescription
tenant_idstring

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

Example: {{tenant_id}}

nameOptionalstring

Filter suppliers by name (optional) Filter suppliers by name (partial match)

supplier_typeOptionalstring

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

pageOptionalstring

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

Example: 1

limitOptionalstring

Number of records per page (optional, default: 20) Number of records 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/suppliers?tenant_id=${TENANT_ID}&name=&supplier_type=&page=1&limit=20" \2  --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3  --header "Content-Type: application/json"

Response examples

200OK
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": "[email protected]"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": "[email protected]"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}

Create Supplier​

Warehousing / Suppliers Management
POST/warehousing/suppliers

Creates a new supplier with the specified name, tenant user, and supplier type.

  • User must have 'manage:operations:tenant' permission or be a system admin

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

Query parameters

ParameterTypeDescription
tenant_idstring

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

Example: {{tenant_id}}

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Body parameters

ParameterTypeDescription
namestring—
tenant_user_idstring—
supplier_typestring—
Staging
Request
curl
1curl --globoff --request POST "https://staging-api.ondi.io/functions/v1/warehousing/suppliers?tenant_id=${TENANT_ID}" \2  --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3  --header "Content-Type: application/json" \4  --data-raw '{5  "name": "New Supplier Inc.",6  "tenant_user_id": "{{tenant_user_id}}",7  "supplier_type": "manufacturer"8}'

Replace {{placeholders}} with your own values before sending.

Other request examples (1)
Request example 1
text
1{2  "name": "string", // required - Name of the supplier3  "tenant_user_id": "uuid", // required - UUID of the tenant user associated with this supplier4  "supplier_type": "string" // required - Type of supplier (e.g., "manufacturer", "distributor", "wholesaler")5}

Response examples

201Created
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": "[email protected]"16      }17    }18  }19}

Get Supplier​

Warehousing / Suppliers Management
GET/warehousing/suppliers/:id

Retrieves detailed information about a specific supplier, including associated tenant user details.

  • User must have 'view:tenant', 'manage:operations:tenant' permission, or be a system admin

Response

  • Returns complete supplier information

  • Includes related tenant user details

Path parameters

ParameterTypeDescription
idRequiredstring

UUID of the supplier to retrieve (required)

Example: {{supplier_id}}

Query parameters

ParameterTypeDescription
tenant_idstring

UUID of the tenant (required if not in auth context) (required if not in auth context): 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/suppliers/${ID}?tenant_id=${TENANT_ID}" \2  --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3  --header "Content-Type: application/json"

Response examples

200OK
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": "[email protected]"16      }17    }18  }19}

Update Supplier​

Warehousing / Suppliers Management
PUT/warehousing/suppliers/:id

Updates an existing supplier with new information provided in the request body.

  • User must have 'manage:operations:tenant' permission or be a system admin

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

Path parameters

ParameterTypeDescription
idRequiredstring

UUID of the supplier to update (required)

Example: {{supplier_id}}

Query parameters

ParameterTypeDescription
tenant_idstring

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

Example: {{tenant_id}}

Headers

ParameterTypeDescription
Authorizationstring

Example: Bearer {{access_token}}

Content-Typestring

Example: application/json

Body parameters

ParameterTypeDescription
namestring—
tenant_user_idstring—
supplier_typestring—
Staging
Request
curl
1curl --globoff --request PUT "https://staging-api.ondi.io/functions/v1/warehousing/suppliers/${ID}?tenant_id=${TENANT_ID}" \2  --header "Authorization: Bearer ${ONDI_ACCESS_TOKEN}" \3  --header "Content-Type: application/json" \4  --data-raw '{5  "name": "Updated Supplier Name",6  "tenant_user_id": "{{tenant_user_id}}",7  "supplier_type": "distributor"8}'

Replace {{placeholders}} with your own values before sending.

Other request examples (1)
Request example 1
text
1{2  "name": "string", // optional - New name for the supplier3  "tenant_user_id": "uuid", // optional - New tenant user UUID4  "supplier_type": "string" // optional - New supplier type5}

Response examples

200OK
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": "[email protected]"16      }17    }18  }19}