Overview
Administrators can monitor the full transaction lifecycle, filter by payment status, and view detailed purchase information for financial reporting and customer support.All revenue calculations include only completed purchases, excluding pending, failed, or refunded transactions
Purchase Status Types
The platform tracks five distinct transaction states:Completed
Successful payments that resulted in course enrollment
Created
Payment initiated but not yet processed
Pending
Payment processing in progress
Failed
Payment attempt unsuccessful
Refunded
Completed payment that was reversed
Filter System
Status Filtering
Administrators can filter the purchase list by status using the tab interface:- All
- Completed
- Created
- Pending
- Failed
- Refunded
Displays all purchases regardless of status
Dynamic Filtering
Filters are applied server-side for optimal performance:Purchase Information Display
Each transaction entry shows detailed information:Table Columns
| Column | Description | Visibility |
|---|---|---|
| Course | Title of the purchased course | Always visible |
| User ID | Unique identifier of the purchaser | Hidden on mobile |
| Amount | Transaction amount in Indian Rupees | Always visible |
| Status | Current payment state with color coding | Always visible |
| Date | Transaction creation timestamp | Hidden on tablet |
Data Fields
Revenue Calculation
The page header displays aggregate revenue statistics:Revenue totals are calculated client-side from the filtered purchase list and update dynamically based on the selected status filter
Revenue Display Logic
Revenue is shown when:- Filter is set to “All” (shows completed purchase revenue)
- Filter is set to “Completed” (shows total from filtered list)
- Created, Pending, Failed, or Refunded filters (as these don’t contribute to revenue)
API Integration
GET /api/admin/purchases
Fetches purchases with optional status filtering: Request:Status Color Coding
Each status has distinct visual styling:Color Scheme
Dark Mode Variants
All status badges include dark mode support:Transaction Sorting
Purchases are sorted by creation date in descending order:- Customer support inquiries
- Real-time revenue monitoring
- Failed payment follow-up
Empty States
When no purchases match the filter criteria, a centered message appears: “No purchases found”
Use Cases
Revenue Tracking
Revenue Tracking
Monitor completed purchases to track platform revenue in real-time. Filter by date range to analyze trends.
Failed Payment Investigation
Failed Payment Investigation
Filter by “Failed” status to identify payment issues and proactively reach out to users experiencing problems.
Refund Management
Refund Management
Track all refunded transactions to maintain accurate financial records and identify refund patterns.
Customer Support
Customer Support
Search by User ID to quickly locate a specific customer’s purchase history during support inquiries.
Financial Reporting
Financial Reporting
Export completed purchase data for accounting and tax reporting purposes.
Responsive Design
Mobile
Displays course, amount, and status only for compact viewing
Tablet
Adds User ID column while hiding date for medium screens
Desktop
Shows all columns with complete transaction details
Performance Optimization
Server-side Filtering
Status filters are applied at the database level:Field Selection
Only necessary fields are queried:Populated References
Course titles are efficiently populated:Data Model
The Purchase model includes:| Field | Type | Description |
|---|---|---|
userId | String | Clerk user identifier |
courseId | ObjectId | Reference to Course document |
amount | Number | Payment amount in paisa/cents |
currency | String | Currency code (e.g., “INR”) |
status | String | One of: completed, created, pending, failed, refunded |
createdAt | Date | Transaction creation timestamp |