List Suppliers (v1)
Method & Path
GET /api/v1/workspace/:workspaceId/suppliers
Actual backend path: GET /v1/workspace/:workspaceId/suppliers
Description
List suppliers for a workspace. Use withSummary=true to include aggregated totals (totalAccount, totalPaid, remaining) per supplier. Optional search filters by full name.
Authentication
Required: Workspace JWT.
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <workspace_token> |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes | Workspace identifier |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
search | string | No | Filter by supplier full name (substring) |
withSummary | string | No | true to include totalAccount, totalPaid, remaining per supplier |
Response 200 OK
With withSummary=true:
{
"suppliers": [
{
"id": "507f1f77bcf86cd799439011",
"workspaceId": "507f1f77bcf86cd799439012",
"fullName": "اسم التام للمورد",
"totalAccount": 10000,
"totalPaid": 6000,
"remaining": 4000,
"createdAt": "2024-01-15T10:00:00.000Z",
"updatedAt": "2024-01-15T10:00:00.000Z"
}
]
}
Without withSummary (or withSummary=false), each item omits totalAccount, totalPaid, and remaining.
Common Errors
- 401 Unauthorized: Missing or invalid token
- 403 Forbidden: Workspace access denied or subscription check failed
- 404 Not Found: Workspace not found
- 500 Internal Server Error: Server error