Retrieves a paginated list of all content purchased by the authenticated user. This endpoint requires authentication.
This endpoint requires user authentication. Include a valid JWT token in the Authorization header: Bearer <token>
Bearer token for user authentication
Query Parameters
Page number for pagination
Response
Array of purchase objects Unique identifier for the purchase
User ID who made the purchase
Populated content object (limited fields) Content type: pdf, video, or audio
URL to the content thumbnail image
Purchase status (only completed purchases are returned)
Total count of completed purchases
Error Responses
401 Unauthorized
Returned when authentication token is missing or invalid.
500 Internal Server Error
{
"error" : "Error message"
}
This endpoint only returns purchases with status: 'completed'. Pending or failed purchases are not included. The purchases are sorted by purchasedAt in descending order (most recent first).
To access the full content including the file URL, use the Access Content endpoint with the content ID from the purchase.
{
"purchases" : [
{
"_id" : "507f1f77bcf86cd799439014" ,
"user" : "507f1f77bcf86cd799439015" ,
"content" : {
"_id" : "507f1f77bcf86cd799439011" ,
"title" : "Advanced JavaScript Patterns" ,
"description" : "Learn advanced design patterns in JavaScript" ,
"type" : "pdf" ,
"category" : "507f1f77bcf86cd799439012" ,
"price" : 29.99 ,
"thumbnailUrl" : "https://res.cloudinary.com/example/image/upload/v1234567890/thumbnail.jpg"
},
"status" : "completed" ,
"purchasedAt" : "2024-03-02T10:30:00.000Z"
},
{
"_id" : "507f1f77bcf86cd799439016" ,
"user" : "507f1f77bcf86cd799439015" ,
"content" : {
"_id" : "507f1f77bcf86cd799439017" ,
"title" : "Node.js Microservices" ,
"description" : "Building scalable microservices with Node.js" ,
"type" : "video" ,
"category" : "507f1f77bcf86cd799439018" ,
"price" : 49.99 ,
"thumbnailUrl" : "https://res.cloudinary.com/example/image/upload/v1234567890/thumbnail2.jpg"
},
"status" : "completed" ,
"purchasedAt" : "2024-03-01T14:20:00.000Z"
}
],
"totalPages" : 2 ,
"currentPage" : 1 ,
"totalPurchases" : 15
}