Boya Employees API (1.0.0)

API for managing employees in the Boya platform

Download OpenAPI description
Languages
Servers
Mock server
https://developer.boyahq.com/_mock/employee/
Boya API server
https://api.boyahq.com/v1/

List all employees

Request

Query
pageinteger

Page number for pagination

Default 1
limitinteger

Number of items per page

Default 50
curl -i -X GET \
  'https://developer.boyahq.com/_mock/employee/employees?limit=50&page=1' \
  -H 'X-API-KEY: YOUR_API_KEY_HERE'

Responses

Successful response

Bodyapplication/jsonArray [
idstring
namestring
phonestring
team_codestring
organization_emailstring
rolestring
accnostring

employee wallet accno

balancedouble

account balance

statusstring
Enum"ACTIVE""SUSPENDED"
createdAtstring(date)
]
Response
application/json
[ { "id": "string", "name": "string", "phone": "string", "team_code": "string", "organization_email": "string", "role": "string", "accno": "string", "balance": null, "status": "ACTIVE", "createdAt": "2019-08-24" } ]

Create a new employee

Request

Bodyapplication/jsonrequired
namestringrequired
organization_emailstringrequired
phone_numberstringrequired
team_codestringrequired
rolestringrequired
Value"CARD USER"
curl -i -X POST \
  https://developer.boyahq.com/_mock/employee/employees \
  -H 'Content-Type: application/json' \
  -H 'X-API-KEY: YOUR_API_KEY_HERE' \
  -d '{
    "name": "string",
    "organization_email": "string",
    "phone_number": "string",
    "team_code": "string",
    "role": "CARD USER"
  }'

Responses

Created

Bodyapplication/json
idstring
namestring
phonestring
team_codestring
organization_emailstring
rolestring
accnostring

employee wallet accno

balancedouble

account balance

statusstring
Enum"ACTIVE""SUSPENDED"
createdAtstring(date)
Response
application/json
{ "id": "string", "name": "string", "phone": "string", "team_code": "string", "organization_email": "string", "role": "string", "accno": "string", "balance": null, "status": "ACTIVE", "createdAt": "2019-08-24" }

Suspend an employee

Request

Query
employee_idstringrequired
curl -i -X DELETE \
  'https://developer.boyahq.com/_mock/employee/employees/suspend?employee_id=string' \
  -H 'X-API-KEY: YOUR_API_KEY_HERE'

Responses

Employee suspended successfully

Response
No content

Activate an employee

Request

Query
employee_idstringrequired
curl -i -X PATCH \
  'https://developer.boyahq.com/_mock/employee/employees/activate?employee_id=string' \
  -H 'X-API-KEY: YOUR_API_KEY_HERE'

Responses

Employee activated successfully

Response
No content

Add money to an employee wallet

Request

Bodyapplication/jsonrequired
accountrefinteger

org_wallet_ref

Default 1
amountinteger
descriptionstring
employee_idstring
curl -i -X POST \
  https://developer.boyahq.com/_mock/employee/employees/addMoney \
  -H 'Content-Type: application/json' \
  -H 'X-API-KEY: YOUR_API_KEY_HERE' \
  -d '{
    "accountref": 1,
    "amount": 0,
    "description": "string",
    "employee_id": "string"
  }'

Responses

Allocation successful

Response
No content

Deduct money from employee wallet

Request

Bodyapplication/jsonrequired
accountrefinteger

org_wallet_ref

Default 1
amountinteger
descriptionstring
employee_idstring
curl -i -X POST \
  https://developer.boyahq.com/_mock/employee/employees/deductMoney \
  -H 'Content-Type: application/json' \
  -H 'X-API-KEY: YOUR_API_KEY_HERE' \
  -d '{
    "accountref": 1,
    "amount": 0,
    "description": "string",
    "employee_id": "string"
  }'

Responses

Deduction successful

Response
No content

Get a specific employee profile and balance

Request

Query
employee_idintegerrequired
org_wallet_refstringrequired
curl -i -X GET \
  'https://developer.boyahq.com/_mock/employee/employees/?employee_id={employee_id}&org_wallet_ref=string' \
  -H 'X-API-KEY: YOUR_API_KEY_HERE'

Responses

Successful response

Bodyapplication/json
idstring
namestring
phonestring
team_codestring
organization_emailstring
rolestring
accnostring

employee wallet accno

balancedouble

account balance

statusstring
Enum"ACTIVE""SUSPENDED"
createdAtstring(date)
Response
application/json
{ "id": "string", "name": "string", "phone": "string", "team_code": "string", "organization_email": "string", "role": "string", "accno": "string", "balance": null, "status": "ACTIVE", "createdAt": "2019-08-24" }

Get All employee balances - add a specified date range

Request

Query
fromstring(date-time)required

Start date and time for the balance period

tostring(date-time)required

End date and time for the balance period YYYY-MM-DD HH:MM:SS

pageinteger

Page number for pagination

Default 1
limitinteger

Number of items per page

Default 50
curl -i -X GET \
  'https://developer.boyahq.com/_mock/employee/employees/balances?from=2019-08-24T14%3A15%3A22Z&limit=50&page=1&to=2019-08-24T14%3A15%3A22Z' \
  -H 'X-API-KEY: YOUR_API_KEY_HERE'

Responses

Successful response

Bodyapplication/json
openingEmployeeWalletsTotalnumber
closingEmployeeWalletsTotalnumber
employeesobject
Response
application/json
{ "openingEmployeeWalletsTotal": 0, "closingEmployeeWalletsTotal": 0, "employees": { "docs": [], "total": 0, "limit": "string", "page": "string", "pages": 0 } }