HRM Quickstart Tutorial
From zero to your first payslip — one connected, copy-paste walkthrough
By the end you'll have a real department, a job title, an employee who can log in, a shift on the roster, a leave type, an approved leave request, a salary structure, and a finalized payslip the employee can download from their self-service portal — plus a live notification along the way. Every request below is taken from the shipped Postman collection.
Before You Start
| You need | Details |
|---|---|
| A running backend | Default http://localhost:5000. See Running the Project. |
| The HR module enabled | For your tenant — see What's New in v2. Otherwise every /hr call returns MODULE_DISABLED. |
| An admin login | An ADMIN (or HR_MANAGER) account to run the setup steps. |
| Postman or curl | Either works. The Postman collection auto-saves IDs (department_id, employee_id, …) so requests chain themselves. |
Step 0 — Log In & Get a Token
Everything except login needs a Bearer token. Log in once and reuse the
accessToken.
In the shell, export it so the next commands stay short. In Postman, the Login
request's test script already stores access_token for you.
Step 1 — Create a Department
Keep the returned id — call it department_id.
Step 2 — Create a Designation (Job Title)
Save the returned id as designation_id.
Step 3 — Create an Employee (with a login)
This creates the person and a login account in one call, so they can use
self-service later. Replace the {{...}} placeholders with the IDs from above.
An Employee row was created and linked to a new User
with the EMPLOYEE role. John can now log in and reach the
ESS portal at /me. Save the returned
employee id as employee_id.
Step 4 — Put a Shift on the Roster
First create a reusable shift template:
Save the template id as shift_template_id, then roster two days (a working
day and an off-day):
Step 5 — Set Up Leave & Approve a Request
Create a leave type, then have the employee apply, then approve it as the manager.
Create a leave type
Save the id as leave_type_id.
Apply for leave (as the employee)
Logged in as John, the ESS form calls:
The balance is reserved and every approver gets a live
notification. Save the request
id as leave_request_id.
Approve it (as admin/manager)
The reserved days convert to used, John is notified, and the "New leave request" badge clears for the other approvers automatically.
Step 6 — Pay the Employee
Build a salary structure, assign John a salary, then run payroll.
Create a salary structure
Save the id as salary_structure_id. Optionally
POST .../salary-structures/{{salary_structure_id}}/apply-preset
with { "countryCode": "BD" } to add standard components.
Assign a salary to John
Create, process, approve, disburse the run
The person who approves a run must not be the one who processed it — in a real setup, use two accounts (e.g. an ACCOUNTANT processes, an ADMIN approves). For this tutorial on a fresh install you may need a second admin user.
Step 7 — See It From the Employee's Side
Log in as John and hit self-service — the same data, scoped to just him.
In the browser, John sees all of this on the /me dashboard — payslips at
/me/payslips, leave at /me/leave, roster at /me/shifts.
You're Done — The Whole Flow at a Glance
| # | You did | Endpoint | Doc |
|---|---|---|---|
| 1 | Department | POST /api/v2/hr/departments | Employees |
| 2 | Designation | POST /api/v2/hr/designations | Employees |
| 3 | Employee + login | POST /api/v2/hr/employees | Employees |
| 4 | Shift + roster | POST /api/v2/hr/shifts/... | Attendance & Shifts |
| 5 | Leave + approval | POST /api/v2/hr/leave/... | Leave & Holidays |
| 6 | Payroll run → payslip | POST /api/v2/hr/payroll/... | Payroll |
| 7 | Self-service view | GET /api/v2/me/... | ESS |
Each step has a full module guide linked above, and every endpoint (with permissions) is in the v2 API Reference. Curious who can call what? See Permissions & RBAC.