Appearance
Reports API
Base route: /api/reports
Auth required: ✅ JWT Bearer
Generates downloadable Excel (.xlsx) files for core entities. Files are generated on-demand using ClosedXML.
GET /api/reports/vendors
Downloads an Excel file containing all active vendors.
Permission: Vendor:Read
Response
- Content-Type:
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet - Filename:
vendors_YYYYMMDD.xlsx
Columns
| Column | Description |
|---|---|
| ID | Vendor ID |
| Name | Vendor name |
| Type | Vendor type |
| Address | Physical address |
| Phone | Contact number |
| Contact email | |
| Drug License 1 | Primary license |
| Drug License 2 | Secondary license |
| Outstanding Balance | Unpaid amount |
| Total Invoice Value | Sum of all invoices |
| Total Paid | Sum of all payments |
| Created At | Creation timestamp |
GET /api/reports/invoices
Downloads an Excel file containing all active invoices.
Permission: Invoice:Read
Response
- Filename:
invoices_YYYYMMDD.xlsx
Columns
| Column | Description |
|---|---|
| ID | Invoice ID |
| Invoice Number | Invoice reference |
| Vendor | Vendor name |
| Amount | Total invoice amount |
| Paid Amount | Amount paid so far |
| Pending Amount | Outstanding balance |
| Status | Computed status |
| Invoice Date | Issue date |
| Due Date | Payment due date |
| Description | Notes |
GET /api/reports/transactions
Downloads an Excel file containing all active transactions.
Permission: Transaction:Read
Response
- Filename:
transactions_YYYYMMDD.xlsx
Columns
| Column | Description |
|---|---|
| ID | Transaction ID |
| Invoice Number | Related invoice |
| Vendor | Related vendor name |
| Amount | Payment amount |
| Type | Cash / UPI / Net Banking |
| Transaction Date | Payment date |
| Description | Notes |
Usage in the Frontend
The frontend triggers downloads by navigating to the report URL:
typescript
window.open(`${baseUrl}/reports/vendors`, '_blank')The browser handles the file download dialog automatically.