Update Supplier (v1)
Method & Path
PATCH /api/v1/workspace/:workspaceId/suppliers/:supplierId
Actual backend path: PATCH /v1/workspace/:workspaceId/suppliers/:supplierId
Description
Update a supplier. At least one field must be provided.
Authentication
Required: Workspace JWT.
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer <workspace_token> |
Content-Type | Yes | application/json |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes | Workspace identifier |
supplierId | string | Yes | Supplier identifier |
Request Body
{
"fullName": "الاسم المحدث"
}
| Field | Type | Required | Description |
|---|---|---|---|
fullName | string | No | Full name (if provided, trimmed, min 1 character) |
Response 200 OK
{
"supplier": {
"id": "507f1f77bcf86cd799439011",
"workspaceId": "507f1f77bcf86cd799439012",
"fullName": "الاسم المحدث",
"createdAt": "2024-01-15T10:00:00.000Z",
"updatedAt": "2024-01-15T12:00:00.000Z"
}
}
Common Errors
- 400 Bad Request: Validation error or no fields provided
- 401 Unauthorized: Missing or invalid token
- 403 Forbidden: Workspace access denied
- 404 Not Found: Workspace or supplier not found
- 500 Internal Server Error: Server error