Get Expense (v1)
Method & Path
GET /api/v1/admin/expenses/:expenseId
Description
Retrieve detailed information about a specific expense by its ID.
Authentication
Required: Admin authentication with dashboard.view permission.
Headers
Authorization: Bearer <admin_token>
Content-Type: application/json
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
expenseId | string | Yes | The unique identifier of the expense |
Response 200 OK
{
"id": "507f1f77bcf86cd799439011",
"amount": 1500.00,
"date": "2025-01-15T10:30:00.000Z",
"description": "Monthly office rent",
"category": "rent",
"receiptImage": {
"url": "https://storage.googleapis.com/bucket/admin-expenses/expense-id/receipt-1234567890-abc123.webp",
"path": "admin-expenses/expense-id/receipt-1234567890-abc123.webp",
"width": 1000,
"height": 1000,
"sizeBytes": 50000,
"contentType": "image/webp"
},
"notes": "Paid via bank transfer",
"createdBy": "507f1f77bcf86cd799439014",
"createdAt": "2025-01-15T10:30:00.000Z",
"updatedAt": "2025-01-15T10:30:00.000Z"
}
Response Fields
id(string): Unique expense identifieramount(number): Expense amount in USDdate(string): Expense date (ISO 8601 format)description(string): Expense descriptioncategory(string): Expense category (services,salaries,rent,utilities,marketing,other)receiptImage(object | null): Receipt image information (see Receipt Image Schema in List Expenses)notes(string | undefined): Additional notes about the expensecreatedBy(string): ID of the admin who created the expensecreatedAt(string): Creation timestamp (ISO 8601 format)updatedAt(string): Last update timestamp (ISO 8601 format)
Common Errors
400 Bad Request: Invalid expense ID format
401 Unauthorized: Missing or invalid authentication token
403 Forbidden: Admin does not have dashboard.view permission
404 Not Found: Expense not found
500 Internal Server Error: Server error occurred while processing the request