Routes for user authentication including register, login, reset password, etc
Generate password token and send email
Endpoint:
Method: POST
Type: RAW
URL: {{URL}}/api/v1/auth/forgotpassword
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json |
Body:
{
"email": "[email protected]"
}
Endpoint:
Method: GET
Type: RAW
URL: {{URL}}/api/v1/auth/me
Endpoint:
Method: POST
Type: RAW
URL: {{URL}}/api/v1/auth/login
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | JSON Type |
Body:
{
"username": "oyedotunsodiq045",
"password": "123456"
}
Clear user token
Endpoint:
Method: GET
Type: RAW
URL: {{URL}}/api/v1/auth/logout
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json |
Register a User, Auto creates Savings and Primary Account
Endpoint:
Method: POST
Type: RAW
URL: {{URL}}/api/v1/auth/register
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | JSON Type |
Body:
{
"username": "sweetman",
"firstname": "Major",
"lastname": "Stark",
"email": "[email protected]",
"phone": "07058924457",
"password": "123456"
}
Reset user password using token
Endpoint:
Method: PUT
Type: RAW
URL: {{URL}}/api/v1/auth/resetpassword/52f0e1e7291ff23cf390dd8a96cd3ecb0d5e60e9
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | JSON Type |
Body:
{
"password": "1234567"
}
Endpoint:
Method: PUT
Type: RAW
URL: {{URL}}/api/v1/auth/updatepassword
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json |
Body:
{
"currentPassword": "1234567",
"newPassword": "123456"
}
Endpoint:
Method: PUT
Type: RAW
URL: {{URL}}/api/v1/auth/updatedetails
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json |
Body:
{
"username": "abbey",
"firstname": "Abiodun Omogbolahan",
"lastname": "Oyedotun",
"email": "[email protected]",
"phone": "07058924457"
}
Recipient CRUD functionality. Recipient are StarkTechBank account holders who you regularly transfer money to. Users can add, read and remove, while only Admin manage recipient (update)
Recipient must be an account holder
Endpoint:
Method: POST
Type: RAW
URL: {{URL}}/api/v1/recipients
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | JSON Type |
Body:
{
"username": "ifeoye",
"accountNumber": "11223147",
"type": "Primary",
"description": "Fiancee"
}
Delete a recipient.
Endpoint:
Method: DELETE
Type:
URL: {{URL}}/api/v1/recipients/5f8246f1fcb2c42d0a279619
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json |
Get a recipient from the database
Endpoint:
Method: GET
Type:
URL: {{URL}}/api/v1/recipients/5f824698fcb2c42d0a279616
Get all recipients data. Admin only
Endpoint:
Method: GET
Type:
URL: {{URL}}/api/v1/recipients
Update recipient data. Admin only
Endpoint:
Method: PUT
Type: RAW
URL: {{URL}}/api/v1/recipients/5f824698fcb2c42d0a279616
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json |
Body:
{
"description": "only you"
}
Users can make deposit, withdrawal, transfers in and out of their primary and savings account. Primary and Savings Transactions table are updated respectively for record keeping and statement request.
Deposit into Primary or Savings Account
Endpoint:
Method: POST
Type: RAW
URL: {{URL}}/api/v1/transactions/deposit
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json |
Body:
{
"type": "Savings",
"amount": 600
}
Withdraw from Primary or Savings Account
Endpoint:
Method: POST
Type: RAW
URL: {{URL}}/api/v1/transactions/withdrawal
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json |
Body:
{
"type": "Primary",
"amount": 230
}
Transfers between your account, (Primary to Savings) and vice versa, and to someone else.
Make transaction between primary and savings accounts. Deduct from primary, auto add to savings
Endpoint:
Method: POST
Type: RAW
URL: {{URL}}/api/v1/transfers
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json |
Body:
{
"type": "Primary",
"amount": 100
}
Make transaction between savings and primary accounts. Deduct from savings, auto add to primary
Endpoint:
Method: POST
Type: RAW
URL: {{URL}}/api/v1/transfers
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json |
Body:
{
"type": "Savings",
"amount": 390
}
Transfer to another StarkTechBank account holder
Endpoint:
Method: POST
Type: RAW
URL: {{URL}}/api/v1/transfers/out
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json |
Body:
{
"accountNumber": 11223147,
"type": "Primary",
"transferFrom": "Primary",
"amount": 999
}
Users CRUD functionality. Admin only
Add user to database (admin)
Endpoint:
Method: POST
Type: RAW
URL: {{URL}}/api/v1/users
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json | JSON Type |
Body:
{
"username": "test",
"firstname": "Test",
"lastname": "Microphone",
"email": "[email protected]",
"phone": "08123456789",
"password": "123456"
}
Delete a user from database (admin)
Endpoint:
Method: DELETE
Type:
URL: {{URL}}/api/v1/users/5f7e592e078929412a34a955
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json |
Get a user by id (admin)
Endpoint:
Method: GET
Type:
URL: {{URL}}/api/v1/users/5f7df53b25f6723e4802cf2f
Get all users (admin)
Endpoint:
Method: GET
Type:
URL: {{URL}}/api/v1/users
Update a user by id (admin)
Endpoint:
Method: PUT
Type: RAW
URL: {{URL}}/api/v1/users/5f7df53b25f6723e4802cf2f
Headers:
Key | Value | Description |
---|---|---|
Content-Type | application/json |
Body:
{
"email": "[email protected]"
}
Made with ♥ by thedevsaddam | Generated at: 2020-10-28 20:47:49 by docgen