Skip to main content

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

HeaderRequiredDescription
AuthorizationYesBearer <workspace_token>

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace identifier

Query Parameters

ParameterTypeRequiredDescription
searchstringNoFilter by supplier full name (substring)
withSummarystringNotrue 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