A Financial Transaction System that can effectively detect fraud
http://127.0.0.1:5000/
Endpoint: /auth/register
Method: POST
Description: Registers a new user.
Request Body:
{
"full_name": "John Doe",
"email": "johndoe@example.com",
"password": "securepassword",
"country": "USA"
}Response:
{
"message": "User registered successfully!"
}Endpoint: /auth/login
Method: POST
Description: Authenticates a user and returns a JWT token.
Request Body:
{
"email": "johndoe@example.com",
"password": "securepassword"
}Response:
{
"token": "your_jwt_token"
}Endpoint: /transaction/create
Method: POST
Description: Records a financial transaction.
Headers:
Authorization: Bearer your_jwt_token
Request Body:
{
"user_id": "user_123",
"amount": 200.00,
"transaction_type": "transfer",
"status": "completed",
"ip_address": "192.168.1.1",
"location": "New York, USA"
}Response:
{
"message": "Transaction recorded successfully!"
}Endpoint: /transaction/list
Method: GET
Description: Retrieves all transactions of a user.
Query Parameters:
?user_id=user_123
Response:
[
{
"transaction_id": "txn_001",
"amount": 200.00,
"transaction_type": "transfer",
"status": "completed",
"ip_address": "192.168.1.1",
"location": "New York, USA"
}
]Endpoint: /fraud/detect
Method: POST
Description: Detects fraudulent transactions based on various parameters.
Request Body:
{
"transaction_id": "txn_001",
"user_id": "user_123",
"amount": 10000.00,
"ip_address": "192.168.1.1",
"location": "New York, USA"
}Response:
{
"fraud": true,
"reason": "Unusual transaction amount"
}Endpoint: /admin/freeze
Method: POST
Description: Freezes a user account due to fraudulent activity.
Request Body:
{
"user_id": "user_123"
}Response:
{
"message": "User account frozen!"
}Endpoint: /admin/unfreeze
Method: POST
Description: Unfreezes a previously frozen user account.
Request Body:
{
"user_id": "user_123"
}Response:
{
"message": "User account unfrozen!"
}- All requests (except registration & login) require a JWT token in the
Authorizationheader. - Fraud detection is automated based on transaction history and predefined rules.
- Admin users have access to account freezing/unfreezing functionality.
📌 API Version: v1.0