Skip to main content

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

HeaderRequiredDescription
AuthorizationYesBearer <workspace_token>
Content-TypeYesapplication/json

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace identifier
supplierIdstringYesSupplier identifier

Request Body

{
"fullName": "الاسم المحدث"
}
FieldTypeRequiredDescription
fullNamestringNoFull 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