Bank Api which has the functionalities similar to the transactions done by customers such as deposit, withdraw, tranfers and list of transactions, also provides functionalities for the banker to add or remove customers from the system and also revert failed transactions. A standard backend developed routes using expressJs
Interaction with the endpoints can be done using fetch, Axios, e.t.c
curl -x GET https://stan-bank-apis.herokuapp.com/
- Create Users Accounts
- Get all User Accounts
- Delete User Accounts
- Disable Users Accounts
- Reverse User Transactions
curl -x POST \
-H 'Content-Type: application/json' \
https://stan-bank-apis.herokuapp.com/register \
-d '{
"firstName": "firstname",
"lastName": "lastname",
"username": "username",
"email": "email@gmail.com",
"password": "123456"
}'
Registration Successful
curl -x POST \
-H 'Content-Type: application/json' \
https://stan-bank-apis.herokuapp.com/login \
-d '{
"email": "email@gmail.com",
"password": "123456"
}'
{token : "6c67493d-8fc2-4cd4-9161-4f1ec11cbe69"}
Only authenticated User with admin role can access this route
curl -x POST \
-H 'Content-Type: application/json' \
https://stan-bank-apis.herokuapp.com/addUser \
-d '{
"firstName": "firstname",
"lastName": "lastname",
"tel": "5161566",
"balance" : 563",
"role" : "user"
"email": "email@gmail.com",
"password": "123456"
}'
{"id" : "6c67493d-8fc2-4cd4-9161-4f1ec11cbe69",
"firstName": "firstname",
"lastName": "lastname",
"tel": "5161566",
"balance" : 563",
"role" : "user",
'status" : "active",
"email": "email@gmail.com",
"password": "123456",
"acctNo" : "4984645489"
}
Only authenticated User with admin role can access this route
curl -x GET \
-H 'Content-Type: application/json' \
https://stan-bank-apis.herokuapp.com/users
[
{
"id" : "6c67493d-8fc2-4cd4-9161-4f1ec11cbe69",
"firstName": "firstname",
"lastName": "lastname",
"tel": "5161566",
"balance" : 563",
"role" : "user",
'status" : "active",
"email": "email@gmail.com",
"password": "123456",
"acctNo" : "4984645489"
},
{
...
},
...
]
Only authenticated User with admin role can access this route
curl -x POST \
-H 'Content-Type: application/json' \
https://stan-bank-apis.herokuapp.com/deleteUser \
-d '{
"id": "e89jns-sa6864654d"
}'
User with account Number e89jns-sa6864654d deleted
Only authenticated User with admin role can access this route
curl -x GET \
-H 'Content-Type: application/json' \
https://stan-bank-apis.herokuapp.com/disableUser/e89jns-sa6864654d
User e89jns-sa6864654d disabled
Only authenticated User with admin role can access this route
curl -x GET \
-H 'Content-Type: application/json' \
https://stan-bank-apis.herokuapp.com/enableUser/e89jns-sa6864654d
User e89jns-sa6864654d enabled
Only authenticated User with admin role can access this route
curl -x POST \
-H 'Content-Type: application/json' \
https://stan-bank-apis.herokuapp.com/reverse \
-d '{
"acctNo": "5345434465"
}'
Transaction with transaction id 5345434465 reversed
Only authenticated User with user role can access this routes
curl -x POST \
-H 'Content-Type: application/json' \
https://stan-bank-apis.herokuapp.com/user/login \
-d '{
"email": "email@gmail.com",
"password": "123456"
}'
{token : "6c67493d-8fc2-4cd4-9161-4f1ec11cbe69"}
curl -x POST \
-H 'Content-Type: application/json' \
https://stan-bank-apis.herokuapp.com/user/deposit \
-d '{
"acctNo": "216832168",
"amount": 54700
}'
Deposit Successful
curl -x POST \
-H 'Content-Type: application/json' \
https://stan-bank-apis.herokuapp.com/user/withdraw \
-d '{
"acctNo": "216832168",
"amount": 54700
}'
Withdrawal Successful
curl -x POST \
-H 'Content-Type: application/json' \
https://stan-bank-apis.herokuapp.com/user/transfer \
-d '{
"recieverNo": "216832168",
"amount": 54700
}'
Transfer Successful
curl -x GET \
-H 'Content-Type: application/json' \
https://stan-bank-apis.herokuapp.com/user/transactions
[
{
"id" : "6c67493d-8fc2-4cd4-9161-4f1ec11cbe69",
"amount" : 563,
'status" : "active",
"time" : "20210117:293049"
"acctNo" : "4984645489"
},
{
...
},
...
]