This is an API simulating a banking service. Users can be added, modified and removed, accounts can be created and modified and all services are secured using HTTP.BASIC protocols.
Clone or download the project from this git repository.
The database is set up as a H2 database and the password to access is:
Username: sysadmin, Password: 5y5@m1n
Open and run in your preferred IDE.
The API is set up with the following users as default:
Username: admin1, Password: admin1Pass, Role: ADMIN
Username: accholder1, Password: accHolder1Pass, Role: ACCOUNTHOLDER
Username: thirdparty1, Password: thirdparty1Pass, Role: THIRDPARTY
Route Type | Route | Access Roles | Input Required |
---|---|---|---|
GET | /users | ADMIN | NONE |
GET | /users/{username} | ADMIN, ACCOUNTHOLDER, THIRDPARTY | String - Username |
GET | /users/byid/{id} | ADMIN, ACCOUNTHOLDER, THIRDPARTY | Long - User ID |
POST | /users/new/admin | ADMIN | AdminDTO |
POST | /users/new/accountholder | ADMIN | AccountHolderDTO |
POST | /users/new/thirdparty | ADMIN | ThirdPartyDTO |
PATCH | /users/update/logindetails/{id} | ADMIN, ACCOUNTHOLDER, THIRDPARTY | Long - User ID, String - Username, String - Password |
PATCH | /users/update/username/{id} | ADMIN, ACCOUNTHOLDER, THIRDPARTY | Long - User Id, String - Username |
PATCH | /users/update/password/{id} | ADMIN, ACCOUNTHOLDER, THIRDPARTY | Long - User Id, String - Password |
PATCH | /users/update/accountholder/{id} | ADMIN, ACCOUNTHOLDER | Long - User ID, AccountHolderDTO |
PATCH | /users/update/thirdparty/{id} | ADMIN, THIRDPARTY | Long - User ID, ThirdPartyDTO |
PATCH | /users/update/admin/{id} | ADMIN | Long - User ID, AdminDTO |
DELETE | /users/remove/{id} | ADMIN | Long - User ID |
Route Type | Route | Access Roles | Input Required |
---|---|---|---|
GET | /accounts | ADMIN | NONE |
GET | /accounts/byid/{id} | ADMIN, ACCOUNTHOLDER, THIRDPARTY | Long - Account ID |
POST | /accounts/new/checking | ADMIN | CheckingAccountDTO |
POST | /accounts/new/savings | ADMIN | SavingsAccountDTO |
POST | /accounts/new/creditcard | ADMIN | CreditCardAccountDTO |
POST | /accounts/new/thirdparty | ADMIN | ThirdPartyAccountDTO |
PATCH | /accounts/update/status/{id} | ADMIN | Long - Account ID |
GET | /accounts/getbalance/checking/{account_id} | ADMIN, ACCOUNTHOLDER | Long - Account ID, String - Account Owner Username |
GET | /accounts/getbalance/studentchecking/{account_id} | ADMIN, ACCOUNTHOLDER | Long - Account ID, String - Account Owner Username |
GET | /accounts/getbalance/savings/{account_id} | ADMIN, ACCOUNTHOLDER | Long - Account ID, String - Account Owner Username |
GET | /accounts/getbalance/creditcard/{account_id} | ADMIN, ACCOUNTHOLDER | Long - Account ID, String - Account Owner Username |
GET | /accounts/getbalance/thirdparty/{account_id} | ADMIN, THIRDPARTY | Long - Account ID, String - Account Owner Username |
PATCH | /accounts/admin/transferfunds/ | ADMIN | TransactionDTO |
PATCH | /accounts/accountholder/transferfunds/{username} | ADMIN, ACCOUNTHOLDER | String - Username, TransactionDTO |
PATCH | /accounts/thirdparty/transferfunds/ | ADMIN, THIRDPARTY | String - HashedKey, ThirdPartyTransactionDTO |
Please note: In all DTOs, any reference to secondary owner is optional, and can be removed if not required
{
"balance": {"amount":"NUMBER",
"currency":"GBP"},
"primaryOwnerId":"USERID",
"secondaryOwnerId":"USERID"
}
{
"balance": {"amount":"NUMBER",
"currency":"GBP"},
"primaryOwnerId":"USERID",
"secondaryOwnerId":"USERID"
"secretKey":"STRING"
}
{
"balance": {"amount":"NUMBER",
"currency":"GBP"},
"primaryOwnerId":"USERID",
"secondaryOwnerId":"USERID"
"creditLimit": {"amount":"NUMBER",
"currency":"GBP"},
"interestRate": {"amount":"NUMBER",
"currency":"GBP"}
}
{
"balance": {"amount":"NUMBER",
"currency":"GBP"},
"primaryOwnerId":"USERID",
"secondaryOwnerId":"USERID"
"secretKey":"STRING"
,
"interestRate": {"amount":"NUMBER",
"currency":"GBP"}`` ``}
{
"balance": {"amount":"NUMBER",
"currency":"GBP"},
"primaryOwnerId":"USERID",
"secondaryOwnerId":"USERID"
"hashedKey":"STRING"
,
"name":"STRING"
``}`
{
"transactionAmount":"NUMBER",
"transferAccountId":"ACCOUNTID",
"receivingAccountId":"ACCOUNTID"
}
{
"transactionAmount":"NUMBER",
"transferAccountId":"ACCOUNTID",
"receivingAccountId":"ACCOUNTID"
"receivingSecretKey":"STRING"
}
{
"name":"STRING",
"username":"STRING",
"password":"STRING",
"dateOfBirth":"YYYY-MM-DD",
"primaryAddress": {"houseNumber":"NUMBER",
"streetName":"STRING",
"city":"STRING",
"postcode":"STRING",
"country":"STRING"},
"mailingAddress": {"houseNumber":"NUMBER",
"streetName":"STRING",
"city":"STRING",
"postcode":"STRING",
"country":"STRING"},
"accounts": {"id":"NUMBER",
"balance": {"amount":"NUMBER",
"currency":"GBP"},
"primaryOwnerId":"USERID",
"secondaryOwnerId":"USERID"}
}
{
"name":"STRING",
"username":"STRING",
"password":"STRING",
}
{
"name":"STRING",
"username":"STRING",
"password":"STRING",
"secretKey":"STRING"
}