Skip to main content

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

HeaderRequiredDescription
AuthorizationYesBearer <workspace_token>
Content-TypeYesapplication/json

Path Parameters

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