Skip to main content

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

ParameterTypeRequiredDescription
expenseIdstringYesThe 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 identifier
  • amount (number): Expense amount in USD
  • date (string): Expense date (ISO 8601 format)
  • description (string): Expense description
  • category (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 expense
  • createdBy (string): ID of the admin who created the expense
  • createdAt (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