This is a bank API project built using node.js, express and mongoDB. in this repository you will find only the backend side of the project.
The Github repository of the front-end part for this project is here. and is still under development
Live deployment ( via Netlify ) is available here
live deployment of the API is available at https://bankapi-2-wa.onrender.com. (which is also the base adress for all API calls)
{
"_id": "639e27607310a399a4feaea0", // uniqu id of the account - auto generated
"firstName": "Ben", // first name - required for every account
"lastName": "Gurion", // last name - required for every account
"ownerID": "11111", // ownerID of the account - required for every account -
Length of ownerID is 5 digits - just the way i defined it.
"email": "[email protected]", // email of the account owner - optional
"balance": 100, // balance of the account - default (if not declared) = 0
"credit": 500000, // credit of the account - default (if not declared) = 0
"isActive": true, // is the account active - optional, default is true
"createdAt": "2022-12-17T20:32:32.368Z", // creation date of the account - auto genreted
"__v": 0
}
GET https://bankapi-2-wa.onrender.com/BankApi
GET https://bankapi-2-wa.onrender.com/BankApi/getaccount
Request body:
{"id": "639de29ec9a0404b03c76f39"}
GET https://bankapi-2-wa.onrender.com/BankApi/getallbyowner Request body:
{"ownerID": "12345"}
POST https://bankapi-2-wa.onrender.com/BankApi/add
Request body:
{
"firstName": "Avi", "lastName": "Ron", "ownerID": "12321",
"email": "[email protected]", "balance": "0", (default = 0), "credit": "5000", (default = 0),"isActive": true (default = true)
// ID is auto generated while creating account
}
POST https://bankapi-2-wa.onrender.com/BankApi/update
Request body:
{ "id": "639e04fdf2bfb269f5b75484", "isActive": "false" // Or any other fields you wish to update }
DELETE https://bankapi-2-wa.onrender.com/BankApi/delete
Request body:
{ "id": "639e04fdf2bfb269f5b75484" }
PATCH https://bankapi-2-wa.onrender.com/BankApi/deposit
Request body:
{ "id": "639c8e8058c499a29216d96a", "amount": "1500" // amount of money to deposit }
PATCH https://bankapi-2-wa.onrender.com/BankApi/withdraw
Request body:
{ "id": "639c8e8058c499a29216d96a", "amount": "1500" // amount of money to withdraw }
POST https://bankapi-2-wa.onrender.com/BankApi/transfer
Request body:
{ "receiverId": "639c8e8058c499a29216d96a", "senderId": "639de273c9a0404b03c76f37", "amount": "150" }