Personal Finance Tracker API Documentation

This document outlines the API endpoints for the Personal Finance Tracker.
Base URL: https://fintrack.sendiko.my.id


1. User Endpoints

POST /register

Description: Registers a new user.

Request Body (JSON):

                {
                    "name": "Sendiko",
                    "email": "rizkysendiko7@gmail.com",
                    "password": "00119922"
                }
            

Authentication: None

POST /login

Description: Logs in an existing user and returns an authentication token.

Request Body (JSON):

                {
                    "name": "Sendiko",
                    "password": "00119922"
                }
            

Authentication: None

PUT /users/{userId}

Description: Updates an existing user's information. Replace {userId} with the actual user ID.

Request Body (JSON):

                {
                    "name": "Sendikoo"
                }
            

Authentication: Bearer Token (e.g., eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiU2VuZGlrbyIsImlhdCI6MTc0OTQ0MDU0MH0.vNXODtOAKgDsaq4wdME5Qc5ExU-m2QtIg8X0Usl-1KA)

2. Wallet Endpoints

GET /wallets/

Description: Retrieves all wallets for the authenticated user.

Authentication: Bearer Token

POST /wallets

Description: Creates a new wallet.

Request Body (JSON):

                {
                    "name": "Daily Spending",
                    "purpose": "Spending",
                    "type": "card",
                    "balance": 0.0,
                    "userId": "6ac6b327-47c0-4e8a-adbb-4c1b075f162c"
                }
            

Authentication: Bearer Token

PUT /wallets/{walletId}

Description: Updates an existing wallet's information. Replace {walletId} with the actual wallet ID.

Request Body (JSON):

                {
                    "type": "e-money"
                }
            

Authentication: Bearer Token

3. Category Endpoints

GET /categories/{userId}

Description: Retrieves all categories for a specific user. Replace {userId} with the actual user ID.

Authentication: Bearer Token

POST /categories

Description: Creates a new category.

Request Body (JSON):

                {
                    "name": "Food and Beverage",
                    "userId": "6ac6b327-47c0-4e8a-adbb-4c1b075f162c"
                }
            

Authentication: Bearer Token

PUT /categories/{categoryId}

Description: Updates an existing category's information. Replace {categoryId} with the actual category ID.

Request Body (JSON):

                {
                    "name": "Foods and Beverages"
                }
            

Authentication: Bearer Token

4. Transaction Endpoints

GET /transactions/{userId}

Description: Retrieves all transactions for a specific user. Replace {userId} with the actual user ID.

Authentication: Bearer Token

POST /transactions

Description: Creates a new transaction.

Request Body (JSON):

                {
                    "name": "Luch at KFC",
                    "amount": 50000,
                    "type": "expense",
                    "categoryId": "70b92638-f06a-4d1a-b5f7-56ae7de4dc18",
                    "walletId": "afc42d8c-c3e1-43a1-aaff-0b01d1458bc9",
                    "userId": "6ac6b327-47c0-4e8a-adbb-4c1b075f162c"
                }
            

Authentication: Bearer Token

PUT /transactions/{transactionId}

Description: Updates an existing transaction's information. Replace {transactionId} with the actual transaction ID.

Request Body (JSON):

                {
                    "name": "Lunch at KFC"
                }
            

Authentication: Bearer Token

DELETE /transactions/{transactionId}

Description: Deletes a specific transaction. Replace {transactionId} with the actual transaction ID.

Authentication: Bearer Token