GET /api/transactions
Retrieves all transactions belonging to the authenticated user. Results are automatically ordered by creation date in descending order (most recent first).Authentication
This endpoint requires authentication. Include a valid JWT token in the Authorization header:Request
This endpoint does not accept any query parameters or request body. It automatically filters transactions to show only those belonging to the authenticated user.Example Request
Response
Returns an array of transaction objects. If the user has no transactions, an empty array is returned.Array of transaction objects ordered by
created_at in descending order.Success Response Example
Empty Response Example
When the user has no transactions:Error Responses
Returned when the authentication token is missing, invalid, or expired.
Returned when an unexpected server error occurs.
Implementation Details
Filtering
The endpoint automatically filters transactions based on the authenticated user’s ID. Users can only see their own transactions and cannot access transactions belonging to other users. Database query:Ordering
Results are always ordered by thecreated_at field in descending order, ensuring that the most recent transactions appear first in the response array.