This is a credit system wallet API built with node.js. It enables an account holder to transfer cash wallet to wallet, withdraw, transfer, and fund wallet.
cp .env-example .env
- Create two MySQL databases one for test and the other for development and assign the values of the connection strings to
DB_DATABASE
andDB_TEST_DATABASE
= respectively.
js npm install
npm start
npm run dev
create an account
POST
{{url}}/auth/register
{
"email": "sundaypaul@gmail.com",
"password": "123456",
"first_name": "Sunday",
"last_name": "Paul"
}
{
"status": true,
"message": "Account successfully created",
"data": {
"id": 4,
"first_name": "Sunday",
"last_name": "Paul",
"email": "sundaypaul@gmail.com",
"created_at": "2023-03-11T08:50:16.000Z",
"updated_at": "2023-03-11T08:50:16.000Z",
"wallet": 1000,
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXlsb2FkIjp7ImlkIjo0LCJmaXJzdF9uYW1lIjoiU3VuZGF5IiwibGFzdF9uYW1lIjoiUGF1bCIsImVtYWlsIjoic3VuZGF5cGF1bEBnbWFpbC5jb20iLCJjcmVhdGVkX2F0IjoiMjAyMy0wMy0xMVQwODo1MDoxNi4wMDBaIiwidXBkYXRlZF9hdCI6IjIwMjMtMDMtMTFUMDg6NTA6MTYuMDAwWiIsIndhbGxldCI6MTAwMH0sImlhdCI6MTY4OTE1NTIxNSwiZXhwIjoxNjg5MTg0MDE1LCJhdWQiOiJzdW5kYXlwYXVsQGdtYWlsLmNvbSIsImlzcyI6ImNyZWRpdF9hcGkifQ.xYT1PRnoXt8Y0TW5aJ0CBWStjBdqk-LMS9p8_s0x474",
"refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXlsb2FkIjp7ImlkIjo0LCJmaXJzdF9uYW1lIjoiU3VuZGF5IiwibGFzdF9uYW1lIjoiUGF1bCIsImVtYWlsIjoic3VuZGF5cGF1bEBnbWFpbC5jb20iLCJjcmVhdGVkX2F0IjoiMjAyMy0wMy0xMVQwODo1MDoxNi4wMDBaIiwidXBkYXRlZF9hdCI6IjIwMjMtMDMtMTFUMDg6NTA6MTYuMDAwWiIsIndhbGxldCI6MTAwMH0sImlhdCI6MTY4OTE1NTIxNSwiZXhwIjoxNjg5MTg0MDE1LCJhdWQiOiJzdW5kYXlwYXVsQGdtYWlsLmNvbSIsImlzcyI6ImNyZWRpdF9hcGkifQ.xYT1PRnoXt8Y0TW5aJ0CBWStjBdqk-LMS9p8_s0x474"
}
}
Loggin Account
POST
{{url}}/auth/login
{
"email": "sundaypaul@gmail.com",
"password": "123456"
}
{
"status": true,
"message": "Account login successful",
"data": {
"id": 4,
"first_name": "Sunday",
"last_name": "Paul",
"email": "sundaypaul@gmail.com",
"created_at": "2023-03-11T08:50:16.000Z",
"updated_at": "2023-03-11T08:50:16.000Z",
"wallet": 1000,
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXlsb2FkIjp7ImlkIjo0LCJmaXJzdF9uYW1lIjoiU3VuZGF5IiwibGFzdF9uYW1lIjoiUGF1bCIsImVtYWlsIjoic3VuZGF5cGF1bEBnbWFpbC5jb20iLCJjcmVhdGVkX2F0IjoiMjAyMy0wMy0xMVQwODo1MDoxNi4wMDBaIiwidXBkYXRlZF9hdCI6IjIwMjMtMDMtMTFUMDg6NTA6MTYuMDAwWiIsIndhbGxldCI6MTAwMH0sImlhdCI6MTY3ODY2MzA3NSwiZXhwIjoxNjc4NjkxODc1LCJhdWQiOiJzdW5kYXlwYXVsQGdtYWlsLmNvbSIsImlzcyI6ImNyZWRpdF9hcGkifQ.OAVTaLp85Clj7wGj2fiLgUAaupdmH1AhZNbqvKPzzDc",
"refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJwYXlsb2FkIjp7ImlkIjo0LCJmaXJzdF9uYW1lIjoiU3VuZGF5IiwibGFzdF9uYW1lIjoiUGF1bCIsImVtYWlsIjoic3VuZGF5cGF1bEBnbWFpbC5jb20iLCJjcmVhdGVkX2F0IjoiMjAyMy0wMy0xMVQwODo1MDoxNi4wMDBaIiwidXBkYXRlZF9hdCI6IjIwMjMtMDMtMTFUMDg6NTA6MTYuMDAwWiIsIndhbGxldCI6MTAwMH0sImlhdCI6MTY3ODY2MzA3NSwiZXhwIjoxNjc4NjkxODc1LCJhdWQiOiJzdW5kYXlwYXVsQGdtYWlsLmNvbSIsImlzcyI6ImNyZWRpdF9hcGkifQ.OAVTaLp85Clj7wGj2fiLgUAaupdmH1AhZNbqvKPzzDc"
}
}