Update Supplier Payment (v1)
Method & Path
PATCH /api/v1/workspace/:workspaceId/supplier-payments/:paymentId
Actual backend path: PATCH /v1/workspace/:workspaceId/supplier-payments/:paymentId
Description
Update a supplier payment. At least one field must be provided. Changing invoiceId or amount may trigger recalculation of linked invoice paid/remaining amounts.
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 |
paymentId | string | Yes | Supplier payment identifier |
Request Body
All fields optional; at least one required.
{
"invoiceId": null,
"amount": 2500,
"paymentDate": "2024-01-21",
"paymentMethod": "cash",
"description": "دفعة محدثة",
"notes": "ملاحظات",
"imageUrl": null
}
| Field | Type | Description |
|---|---|---|
imageUrl | string (URL) or null | Set to null to remove; omit to leave unchanged |
Response 200 OK
Returns the updated payment object.
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 payment not found
- 500 Internal Server Error: Server error