Login: /api/auth/login
( organization / user )
{
"email": "[email protected]",
"password": "password123"
}
Response:
{
"message": "User authenticated successfully",
"statusCode": 200,
"data": {
"access_token": "your-auth-token-here",
"email": "[email protected]",
"id": "random_id",
"isAdmin": true | false
}
}
User Signup: /api/auth/user/signup
( organization only )
Method: POST
Request Body:
{
"email": "[email protected]",
"password": "password123",
"first_name": "",
"last_name": "",
"phone_number": ""
}
Create Organization**:** /api/organization/create
Method: PUT
Description: This is a PUT
Method because on creating the user, a lunch prize is assigned to the organization table along with the org_id field.. The user has to be loggedIn automatically after been created using the access token returned back. The access token would then be used to update the organization name and lunch price on the table. [CONSUMED.]
Headers: Authorization: Bearer <access_token>
Request Body:
{
"organization_name": "",
"lunch_price": "" // default to "#1000" if not set
}
Staff Signup: /api/organization/staff/signup
( Staff only )
Method: POST
Description: An OTP
code would be sent to user email, the token sent would be used within the otp_token
field
Request Body:
{
"email": "[email protected]",
"password": "password123",
"otp_token": "", // 6-digit token sent to inbox
"first_name": "",
"last_name": "",
"phone_number": ""
}
Create Organization Invite (Admin Only)
Endpoint: /api/organization/invite
Method: POST
Headers: Authorization: Bearer <access_token>
Description: Allows an admin user to send an invitation to join the organization.
Request Body:
{
"email": "[email protected]"
}
Response Body:
{
"message": "success",
"statusCode": 200,
"data": null
}
Update Organization launch wallet balance (Admin Only)
/api/organization/wallet/update
PATCH
Headers: Authorization: Bearer <access_token>
Description: Allows an admin user to update wallet balance.
Request Body:
{
"amount": "<balance>"
}
Response Body:
{
"message": "success",
"statusCode": 200,
"data": null
}
Update Organization launch price (Admin Only)
/api/organization/launch/update
PATCH
Headers: Authorization: Bearer <access_token>
Description: Allows an admin user to update launch price.
Request Body:
{
"launch_price": "<launch_price>"
}
Response Body:
{
"message": "success",
"statusCode": 200,
"data": null
}
Endpoint : /api/user/profile
Method: GET
Headers: Authorization: Bearer <access_token>
Request Response:
// you could choose to return just the username or email depending on
// your usecase
{
"message": "User data fetched successfully",
"statusCode": 200,
"data": {
"id" :"sdcsdc",
"name": "John Doe",
"email": "[email protected]",
"profile_picture": "user-profile-picture-url",
"isAdmin": true | false
}
}
Add Bank Account : /api/user/bank
Method: PATCH
Headers: Authorization: Bearer <access_token>
Request Body:
// you could choose to return just the username or email depending on
// your usecase
{
"bank_number": "1234-5678-9012-3456",
"bank_code": "123456",
"bank_name": "Bank Name"
}
Response :
{
"message": "successfully created bank account",
"statusCode": 200
}
Get all Users: /api/user/all
Method: GET
Headers: Authorization: Bearer <access_token>
Request Body: None
Response :
{
"message": "successfully created bank account",
"statusCode": 200,
"data": [
{
"name": "John Doe",
"email": "[email protected]",
"profile_picture": "user-profile-picture-url",
"user_id": "",
},
{
"name": "John Doe",
"email": "[email protected]",
"profile_picture": "user-profile-picture-url",
"user_id": "",
}
]
}
Search Users: /api/user/search/<nameoremail>
GET
Authorization: Bearer <access_token>
{
"message": "User found",
"statusCode": 200,
"data":
{
"name": "John Doe",
"email": "[email protected]",
"profile_picture": "user-profile-picture-url",
"user_id": "",
}
}