Skip to main content

List Supplier Payments (v1)

Method & Path

GET /api/v1/workspace/:workspaceId/suppliers/:supplierId/payments

Actual backend path: GET /v1/workspace/:workspaceId/suppliers/:supplierId/payments

Description

List all payments for a supplier (دفعات).

Authentication

Required: Workspace JWT.

Headers

HeaderRequiredDescription
AuthorizationYesBearer <workspace_token>

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace identifier
supplierIdstringYesSupplier identifier

Response 200 OK

{
"payments": [
{
"id": "507f1f77bcf86cd799439031",
"workspaceId": "507f1f77bcf86cd799439012",
"supplierId": "507f1f77bcf86cd799439011",
"invoiceId": "507f1f77bcf86cd799439021",
"amount": 2000,
"paymentDate": "2024-01-20T00:00:00.000Z",
"paymentMethod": "bank-transfer",
"description": "دفعة أولى",
"notes": "ملاحظات",
"createdAt": "2024-01-20T10:00:00.000Z",
"updatedAt": "2024-01-20T10:00:00.000Z"
}
]
}

paymentMethod can be: cash, check, bank-transfer, card, other.

Common Errors

  • 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