Backend Server URL: https://hglevel-wallet-server.onrender.com
Frontend URL: https://highlevel-wallet-ui.onrender.com
NOTE: First api hit can take upto 2 min as render service automatically sleeps due to inactivity
React UI: Frontend code link here
-
Clone the repository:
git clone https://github.com/MrDroid17/highlevel-wallet-backend.gitcd highlevel-wallet-backend
-
Install dependencies:
npm install
-
Create a
.envfile with your environment variables:API_PORT=9091 MONGODB_URI=your_mongodb_connection_string
-
Start the development server:
npm run start:dev
Make sure you have Node.js and MongoDB installed(Can also use cloud mongoDB such as MongoDb atlas). Update .env with your credentials.
- Backend URL: https://hglevel-wallet-server.onrender.com
- Frontend URL: https://highlevel-wallet-ui.onrender.com
- Database:
MongoDB Atlas - Backend Technology:
Node.jswithexpressJoi- request Validationmongoose- MongoDB ORM for Schema and DB level validation
- Backend Deployment: deployed on
render.com - Frontend Technology:
React.js - Frontend Deployment: deployed on
render.com
Create new wallet with name and optional balance field.
Request URL
https://hglevel-wallet-server.onrender.com/wallet/setup
Request Type
POST
Request Body
{
"name": "walletXYZ",
"balance": 80
}Curl Example
curl --location 'https://hglevel-wallet-server.onrender.com/wallet/setup' \
--header 'Content-Type: application/json' \
--data '{
"name": "walletXYZ",
"balance": 80
}'Response Example
{
"id": "689fdff3dc1485f55beb8b0b",
"balance": 80,
"transactionId": "689fdff3dc1485f55beb8b0d",
"name": "walletXYZ",
"date": "2025-08-16T01:33:39.431Z"
}Create a transaction on wallet using walletId. -ve/+ve amount will tells the transaction type.
- +ve amount is Credit
- -ve amount is Debit
- Amount can be decimal with only 4 precision point after decimal e.g. 45.4566, 12.3467
- description can be optional
- the path variable
walledIdand payload have proper validation
Request URL
https://hglevel-wallet-server.onrender.com/wallet/transact/689fdff3dc1485f55beb8b0b
Request Type
POST
Request Body
{
"description": "Recharge",
"amount": 10
}Curl Example
curl --location 'https://hglevel-wallet-server.onrender.com/wallet/transact/689fdff3dc1485f55beb8b0b' \
--header 'Content-Type: application/json' \
--data '{
"description": "Recharge",
"amount": 10
}'Response Example
{
"balance": 79,
"transactionId": "689fe010dc1485f55beb8b15"
}Get all transaction for a wallet with pagination using skip and limit Query params:
walletIdskiplimitProper validation has been added for allQueryParams. All threeQueryParamsare optional. in Case skip and limit is not provided all the transaction depending on if walletId is provided or not
Request URL
https://hglevel-wallet-server.onrender.com/wallet/transactions?walletId=689fdff3dc1485f55beb8b0b&skip=0&limit=10
Request Type
GET
Curl Example
curl --location 'https://hglevel-wallet-server.onrender.com/wallet/transactions?walletId=689fdff3dc1485f55beb8b0b&skip=0&limit=10' \
--header 'Content-Type: application/json'Response Example
[
{
"id": "689fe010dc1485f55beb8b15",
"walletId": "689fdff3dc1485f55beb8b0b",
"amount": 10,
"balance": 79,
"date": "2025-08-16T01:34:08.107Z",
"description": "Recharge",
"type": "CREDIT"
},
{
"id": "689fe008dc1485f55beb8b11",
"walletId": "689fdff3dc1485f55beb8b0b",
"amount": 11,
"balance": 69,
"date": "2025-08-16T01:34:00.375Z",
"description": "Recharge",
"type": "DEBIT"
},
{
"id": "689fdff3dc1485f55beb8b0d",
"walletId": "689fdff3dc1485f55beb8b0b",
"amount": 80,
"balance": 80,
"date": "2025-08-16T01:33:39.651Z",
"description": "Initial new wallet setup",
"type": "CREDIT"
}
]Get wallet details by it walletId in params
- Proper wallidation has been added for walletId
Request URL
https://hglevel-wallet-server.onrender.com/wallet/689fdff3dc1485f55beb8b0b
Request Type
GET
Curl Example
curl --location 'https://hglevel-wallet-server.onrender.com/wallet/689fdff3dc1485f55beb8b0b' \
--header 'Content-Type: application/json'Response Example
{
"id": "689fdff3dc1485f55beb8b0b",
"balance": 79,
"name": "walletXYZ",
"date": "2025-08-16T01:33:39.431Z"
}Invalid Route
- Status Code: `404` Route Not Found
{
"success": false,
"message": "Route not found."
}Validation Error
- Status Code: `400` bad Request
{
"message": "\"walletId\" with value \"689fdff3dc1485f55beb8b0\" fails to match the required pattern: /^[0-9a-fA-F]{24}$/"
}Internal Server Error
- Status Code: `500`
{
"message": "Transaction failed.", // where it failed
"error": "MSG thrown by server"// server generic error
}