All endpoints require authentication using JWT (JSON Web Tokens).
- URL:
/budget/api/login/
- Method:
POST
- Data:
{ "username": "string", "password": "string" }
- Success Response:
{ "refresh": "string", "access": "string" }
- URL:
/budget/api/token/refresh/
- Method:
POST
- Data:
{ "refresh": "string" }
- Success Response:
{ "access": "string" }
- URL:
/budget/api/dashboard/
- Method:
GET
- Success Response:
{ "income": float, "expenses": float, "balance": float, "recent_transactions": [ { "id": integer, "amount": float, "date": "YYYY-MM-DD", "description": "string", "category": { "name": "string", "type": "string" } } ], "budgets": [ { "id": integer, "category": "string", "amount": float, "period": "string" } ] }
- URL:
/budget/api/transactions/
- Methods:
GET
,POST
- GET Query Parameters:
category
: Filter by category namedate_from
: Filter by start date (YYYY-MM-DD)date_to
: Filter by end date (YYYY-MM-DD)
- POST Data:
{ "amount": float, "date": "YYYY-MM-DD", "description": "string", "category_id": integer }
- Success Response: List of transaction objects or created transaction object
- URL:
/budget/api/transactions/<int:pk>/
- Methods:
GET
,PUT
,DELETE
- Success Response: Transaction object
- URL:
/budget/api/categories/
- Methods:
GET
,POST
- POST Data:
{ "name": "string", "type": "income|expense" }
- Success Response: List of category objects or created category object
- URL:
/budget/api/categories/<int:pk>/
- Methods:
GET
,PUT
,DELETE
- Success Response: Category object
- URL:
/budget/api/budgets/
- Methods:
GET
,POST
- POST Data:
{ "category": integer, "amount": float, "period": "string" }
- Success Response: List of budget objects or created budget object
- URL:
/budget/api/budgets/<int:pk>/
- Methods:
GET
,PUT
,DELETE
- Success Response: Budget object
- URL:
/budget/api/user-profile/
- Method:
GET
- Success Response:
{ "username": "string", "email": "string" }
- URL:
/budget/api/statistics/
- Method:
GET
- Success Response:
{ "total_income": float, "total_expenses": float, "savings_rate": float }
- URL:
/budget/api/export-data/
- Method:
GET
- Success Response: JSON object with user's transactions, categories, and budgets
- URL:
/budget/api/import-data/
- Method:
POST
- Note: Implementation pending
Our API now comes with Swagger UI integration for easy exploration and testing of endpoints.
To access the Swagger UI, navigate to:
http://[your-domain]/api/schema/swagger-ui/
(Replace [your-domain] with your actual domain or use localhost:8000 for local development)
- Interactive API documentation
- Test API endpoints directly from the browser
- Detailed request and response information
- Authentication support
- Easy-to-read API schema
- Navigate to the Swagger UI URL
- Click on an endpoint to expand its details
- Click "Try it out" to test the endpoint
- Fill in any required parameters
- Click "Execute" to send the request
- View the response directly in the browser
Note: Some endpoints may require authentication. Use the "Authorize" button at the top of the page to input your credentials.
Happy API exploring!