Welcome to the documentation of the DT-Money API! This API is designed to help you manage your personal finances by allowing you to create, list, and delete transactions. It provides various endpoints to interact with the financial data. This documentation will guide you through the available endpoints, request/response formats, and technologies used.
The DT-Money API offers the following endpoints:
- Endpoint:
POST /transactions
- Description: Create a new transaction.
- Request Body:
{
"title": "Salary",
"amount": 5000,
"description": "income",
"type": "credit"
}
- Response:
{
"message": "Transaction created"
}
- Endpoint:
GET /transactions
- Description: Retrieve all transactions.
- Response:
{
"transactions": [
{
"id": "1",
"title": "Salary",
"amount": 5000,
"description": "income",
"type": "credit",
"created_at": "2021-06-27T22:26:05.000Z"
},
{
"id": "2",
"title": "Rent",
"amount": 1000,
"description": "outcome",
"type": "debit",
"created_at": "2021-06-27T22:26:05.000Z"
}
]
}
- Endpoint:
GET /transactions/:id
- Description: Retrieve a specific transaction by ID.
- Response:
{
"transaction": {
"id": "1",
"title": "Salary",
"amount": 5000,
"description": "income",
"type": "credit",
"created_at": "2021-06-27T22:26:05.000Z"
}
}
OR
undefined
- Endpoint:
GET /transactions/query?search=string
- Description: Search transactions by title or description.
- Endpoint:
GET /transactions/summary
- Description: Retrieve a summary of all transactions.
- Response:
{
"summary": {
"amount": 4000
},
"outcome": {
"amount": 1000
},
"income": {
"amount": 5000
}
}
- Endpoint:
DELETE /transactions/:id
- Description: Delete a transaction by ID.
- Response:
{
"message": "Transaction deleted"
}
The DT-Money API is built using the following technologies:
- Node.js
- Fastify
- TypeScript
- Knex
- SQLite3 and PostgreSQL
- Vitest
Feel free to explore these endpoints and leverage the power of the DT-Money API for efficient personal finance management!