Update Supplier Invoice (v1)
Method & Path
PATCH /api/v1/workspace/:workspaceId/supplier-invoices/:invoiceId
Actual backend path: PATCH /v1/workspace/:workspaceId/supplier-invoices/:invoiceId
Description
Update a supplier invoice. At least one field must be provided. Paid/remaining amounts and status are typically updated by the backend when payments are linked.
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 |
invoiceId | string | Yes | Supplier invoice identifier |
Request Body
All fields optional; at least one required.
{
"invoiceNumber": "INV-001-R",
"totalAmount": 5500,
"issueDate": "2024-01-16",
"dueDate": null,
"description": "وصف محدث",
"notes": "ملاحظات محدثة",
"imageUrl": null
}
| Field | Type | Description |
|---|---|---|
imageUrl | string (URL) or null | Set to null to remove the image; omit to leave unchanged |
Response 200 OK
Returns the updated invoice object.
Common Errors
- 400 Bad Request: Validation error or no fields provided
- 409 Conflict: New invoice number already exists in workspace
- 401 Unauthorized: Missing or invalid token
- 403 Forbidden: Workspace access denied
- 404 Not Found: Workspace or invoice not found
- 500 Internal Server Error: Server error