Get Sales
GET /api/admin/sales?status=completed&limit=10&page=1
Retrieves a paginated list of orders (sales) with optional filtering by status.
Authentication: Admin access required
Query Parameters
Filter orders by status (e.g., “completed”, “pending”, “refunded”)
Number of orders to return per page
Page number for pagination
Response
Indicates if the request was successful
Array of order objects with populated user information
User object containing username and email
Order status (completed, pending, refunded, etc.)
ISO 8601 timestamp of order creation
Blockchain transaction hash
Array of products included in the order
Customer’s wallet address used for payment
Total number of orders matching the query
Total number of pages available
Response Example
{
"success": true,
"sales": [
{
"orderId": "ORD-123456",
"userId": {
"username": "john_doe",
"email": "[email protected]"
},
"total": 299.99,
"status": "completed",
"createdAt": "2026-03-04T10:30:00.000Z",
"txHash": "0xabc123def456...",
"products": [
{
"productId": "prod123",
"name": "Premium Package",
"price": 299.99,
"quantity": 1
}
],
"walletAddress": "TXYZabc123..."
}
],
"pagination": {
"total": 245,
"page": 1,
"pages": 25
}
}
Error Response
{
"error": "Error message"
}