Skip to main content

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

HeaderRequiredDescription
AuthorizationYesBearer <workspace_token>
Content-TypeYesapplication/json

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace identifier
invoiceIdstringYesSupplier 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
}
FieldTypeDescription
imageUrlstring (URL) or nullSet 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