Actors
• Admin
• Merchant
• Secondary Users
Admin Roles
• Admin can send email
• Admin can see email listing
• Admin can see merchants
• Admin can see billing info
• Admin can see secondary users
• Admin can register secondary users
• Admin can recharge their account using stripe API
Merchant Roles
• Merchant can register themselves
• Merchant can create secondary users
• Merchant can see billing info
• Merchant can see e-mail list
• Merchant can recharge their account using stripe API
Secondary Users
• Can perform roles as assigned to them
• Roles of secondary users are as follow
o Email Sent
o View Email
Cost of each email is being deducted from user balance.
Low balance emails are being sent.
Method: POST
Parameters
{
"name": "Admin",
"email":"admin@mail.com",
"password":"123456",
"image":"imagetokeninbase64Code="
}
Output
{
"success": 1,
"status": 201,
"message": "You have successfully registered."
}
Method: POST
Parameters
{
"email":"someone@gmail.com",
"password":"123456"
}
Output
{
"success": 1,
"message": "You have successfully logged in.",
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.
eyJpc3MiOiJodHRwOlwvXC9sb2NhbGhvc3RcL3BocF9hdXRoX2FwaVwvIiwiYXVkIjoiaHR0cDpcL1wvbG9jYWxob3N0XC9waHBfYXV0aF9hcGlcLyIsImlhdCI6MTYzNTMzODA2NCwiZXhwIjoxNjM1MzQxNjY0LCJkYXRhIjp7InVzZXJfaWQiOiI1NSJ9fQ.a7sxj2kuynFbnig4otCeFgJGTbwQ1sxfyY97tX43nRI"
}
Method: POST
Parameters
• {
• "password”: “password",
• "from":"someone@gmail.com",
• "to":"sentto@gmail.com",
• "subject": "Email Sent by Me",
• "body”: "New Email"
• }
Output
Email has been sent
Method: GET
Parameters
None
Output
{
"emails": [
{
"to": "someone@gmail.com",
"from": "sentfrom@gmail.com",
"subject": "Email Sent me",
"body": "New Email"
}
]
}
Method: POST
Duty parameters: “accountCreator” OR “emailViewer”
Parameters
{
"name”: “Second",
"email":"seconduser@gmail.com",
"password":"123456",
"duty”: “accountCreator",
"image":"ImageTokenBase64Code="
}
Output
{
"success": 1,
"status": 201,
"message": "You have successfully registered."
}
Method: POST
Header: Authorization => Bearer token
If user is not authorized
{
"success": 0,
"status": 401,
"message": "You are not authorized"
}
Else
{
"success": 1,
"status": 201,
"message": "Your Payment received successfully"
}
Method: POST
Parameters
{
"password”: “password",
"from”: “email"
}
Output
{
"message": "Email sent to, mail@gmail.com"
}{
"message": "Email sent to, mail2@gmail.com"
}[]
Method: GET
Parameters
None
Output
{
"billings": [
{
"id": "6",
"customer_id": "55",
"amount": "10",
"card_number": "4242424242424242",
"exp_month": "12",
"exp_year": "2022",
"cvc": "123",
"created_at": "1635272723"
},
{
"id": "7",
"customer_id": "61",
"amount": "10",
"card_number": "4242424242424242",
"exp_month": "12",
"exp_year": "2022",
"cvc": "123",
"created_at": "1635275654"
},
{
"id": "8",
"customer_id": "55",
"amount": "10",
"card_number": "4242424242424242",
"exp_month": "12",
"exp_year": "2022",
"cvc": "123",
"created_at": "1635339554"
}
]
}[]
Method: GET
Output
{
"billings": [
{
"id": "61",
"name": "Second",
"email": "seconduser@gmail.com",
"password": password",
"role": "S_USER",
"duty": "accountCreator",
"balance": "10"
}
]
}[]
Output
{
"billings": [
{
"id": "55",
"name": "name",
"email": "name@gmail.com",
"password": "$2y$10$sdasd/uA1z7USEDMRMdeLWSle",
"role": "MERCHANT",
"balance": "10.9511"
},
{
"id": "64",
"name": "name2",
"email": "name2@mail.com",
"password": "$2y$10$da.llGZp1SpXKj84UssssrV8OBXa",
"role": "MERCHANT",
"balance": "0"
}
]
}[]