v2 API Reference

Every v2 endpoint, grouped by module — matching the shipped Postman collection

Dev Only
This is the v2 companion to the v1 API Reference

v1 endpoints (products, sales, inventory, customers, etc.) are documented in the API Reference. This page covers the /api/v2/* surface added in v2. Both are served by the same backend. The authoritative, runnable source is the Postman collection in the backend repo under /postman.

Connection & Conventions

PropertyValue
Base URL (dev)http://localhost:5000
v2 path prefix/api/v2/...
Auth headerAuthorization: Bearer <access_token>
Access / refresh token life15 minutes / 7 days (single-use refresh)
Socket.IO URLhttp://localhost:5000 with auth: { token }
HR gatingAll /hr/* and /me/* endpoints require the HR module enabled for the tenant.

Response envelope

json

List endpoints accept ?page=&limit= (limit capped at 100), plus common ?search=, ?sortBy=, ?sortOrder=asc|desc, and date/status filters.

HR — Departments & Designations

MethodPathPermission
GET/api/v2/hr/departmentshr.departments.read
POST/api/v2/hr/departmentshr.departments.manage
GET/api/v2/hr/departments/:idhr.departments.read
PATCH/api/v2/hr/departments/:idhr.departments.manage
DELETE/api/v2/hr/departments/:idhr.departments.manage
PATCH/api/v2/hr/departments/:id/restorehr.departments.manage
GET/api/v2/hr/designationshr.designations.read
POST/api/v2/hr/designationshr.designations.manage
GET/api/v2/hr/designations/:idhr.designations.read
PATCH/api/v2/hr/designations/:idhr.designations.manage
DELETE/api/v2/hr/designations/:idhr.designations.manage
PATCH/api/v2/hr/designations/:id/restorehr.designations.manage

HR — Employees

MethodPathPermission
GET/api/v2/hr/employeeshr.employees.read
POST/api/v2/hr/employeeshr.employees.create
GET/api/v2/hr/employees/:idhr.employees.read
PATCH/api/v2/hr/employees/:idhr.employees.update
DELETE/api/v2/hr/employees/:idhr.employees.update (soft delete)
PATCH/api/v2/hr/employees/:id/restorehr.employees.update
POST/api/v2/hr/employees/:id/userLink / create login user
PATCH/api/v2/hr/employees/:id/sensitivehr.employees.update.sensitive
PATCH/api/v2/hr/employees/:id/salaryhr.employees.update.salary
POST/api/v2/hr/employees/:id/terminatehr.employees.terminate
GET/api/v2/hr/employees/:id/contractshr.contracts.read
POST/api/v2/hr/employees/:id/contractshr.contracts.create
GET/api/v2/hr/employees/:id/documentshr.employees.documents.read
POST/api/v2/hr/employees/:id/documentshr.employees.documents.upload
DELETE/api/v2/hr/employees/:id/documents/:docIdhr.employees.documents.delete

HR — Attendance

MethodPathPermission / Notes
POST/api/v2/hr/attendance/check-inself ess.attendance.check-in · others hr.attendance.check-in.manual
POST/api/v2/hr/attendance/check-outsame as check-in
POST/api/v2/hr/attendance/break-startsame as check-in
POST/api/v2/hr/attendance/break-endsame as check-in
GET/api/v2/hr/attendance/todayhr.attendance.read.team
GET/api/v2/hr/attendance/summaryread (team/all)
GET/api/v2/hr/attendancehr.attendance.read.all
GET/api/v2/hr/attendance/:idattendance read
GET/api/v2/hr/attendance/correctionshr.attendance.regularize.approve
POST/api/v2/hr/attendance/correctionshr.attendance.regularize.request
GET/api/v2/hr/attendance/corrections/:idcorrection read
POST/api/v2/hr/attendance/corrections/:id/approvehr.attendance.regularize.approve
POST/api/v2/hr/attendance/corrections/:id/rejecthr.attendance.regularize.reject
POST/api/v2/hr/attendance/corrections/:id/cancelowner only
Check-in body
json

method: MANUAL · WEB · MOBILE_APP · GEOFENCE · IP_RESTRICTED · QR_CODE · BIOMETRIC. Omit employeeId for self; supplying it forces MANUAL.

HR — Shifts

MethodPathPermission
GET/api/v2/hr/shifts/templateshr.shifts.read
GET/api/v2/hr/shifts/templates/:idhr.shifts.read
POST/api/v2/hr/shifts/templateshr.shifts.template.manage
PATCH/api/v2/hr/shifts/templates/:idhr.shifts.template.manage
DELETE/api/v2/hr/shifts/templates/:idhr.shifts.template.manage
POST/api/v2/hr/shifts/templates/:id/restorehr.shifts.template.manage
GET/api/v2/hr/shifts/schedulehr.shifts.schedule.read
POST/api/v2/hr/shifts/schedulehr.shifts.schedule.create (bulk 1–500)
PATCH/api/v2/hr/shifts/schedule/:idhr.shifts.schedule.update
DELETE/api/v2/hr/shifts/schedule/:idhr.shifts.schedule.delete
GET/api/v2/hr/shifts/swap-requestsswap read
GET/api/v2/hr/shifts/swap-requests/:idswap read
POST/api/v2/hr/shifts/swap-requestshr.shifts.swap.request.own
POST/api/v2/hr/shifts/swap-requests/:id/respondhr.shifts.swap.respond
POST/api/v2/hr/shifts/swap-requests/:id/approvehr.shifts.swap.approve
POST/api/v2/hr/shifts/swap-requests/:id/cancelowner only

HR — Leave

MethodPathPermission
GET / POST/api/v2/hr/leave/typeshr.leave.types.read / .manage
GET / PATCH / DELETE/api/v2/hr/leave/types/:idhr.leave.types.read / .manage
POST/api/v2/hr/leave/types/:id/restorehr.leave.types.manage
GET / POST/api/v2/hr/leave/policieshr.leave.policies.read / .manage
PATCH/api/v2/hr/leave/policies/:idhr.leave.policies.manage
GET/api/v2/hr/leave/balanceshr.leave.balances.read.all
POST/api/v2/hr/leave/balances/adjusthr.leave.balances.adjust
GET/api/v2/hr/leave/requestshr.leave.request.read.all
GET/api/v2/hr/leave/requests/:idrequest read
POST/api/v2/hr/leave/requestshr.leave.request.create.for
PATCH/api/v2/hr/leave/requests/:idrequest update (PENDING only)
POST/api/v2/hr/leave/requests/:id/approvehr.leave.request.approve
POST/api/v2/hr/leave/requests/:id/rejecthr.leave.request.approve
POST/api/v2/hr/leave/requests/:id/cancelowner / approver

HR — Holidays

MethodPathPermission
GET/api/v2/hr/holidays/calendar?year=&storeId=hr.holidays.read
POST/api/v2/hr/holidays/import-presethr.holidays.manage (US/UK/IN/BD/UAE)
GET/api/v2/hr/holidayshr.holidays.read
POST/api/v2/hr/holidayshr.holidays.manage
GET/api/v2/hr/holidays/:idhr.holidays.read
PATCH/api/v2/hr/holidays/:idhr.holidays.manage
DELETE/api/v2/hr/holidays/:idhr.holidays.manage

HR — Payroll

MethodPathPermission
GET/api/v2/hr/payroll/country-presetshr.payroll.country-preset.read
GET / POST/api/v2/hr/payroll/salary-structureshr.payroll.salary-structure.read / .manage
GET / PATCH / DELETE/api/v2/hr/payroll/salary-structures/:id...salary-structure.read / .manage
POST/api/v2/hr/payroll/salary-structures/:id/apply-presethr.payroll.country-preset.apply
POST / PATCH / DELETE/api/v2/hr/payroll/salary-structures/:id/components[/:cid]hr.payroll.salary-structure.manage
GET / POST/api/v2/hr/payroll/employee-salarieshr.payroll.salary-structure.manage
GET / POST/api/v2/hr/payroll/runshr.payroll.read / .run.create
GET/api/v2/hr/payroll/runs/:idhr.payroll.read
POST/api/v2/hr/payroll/runs/:id/processhr.payroll.run.process
POST/api/v2/hr/payroll/runs/:id/approvehr.payroll.run.approve (SoD + step-up 2FA)
POST/api/v2/hr/payroll/runs/:id/disbursehr.payroll.run.disburse
POST/api/v2/hr/payroll/runs/:id/cancelhr.payroll.run.cancel
GET/api/v2/hr/payroll/runs/:id/payslipshr.payroll.read.payslip.all
GET/api/v2/hr/payroll/payslips/:idhr.payroll.read.payslip.all
GET/api/v2/hr/payroll/payslips/:id/pdfpayslip read
POST/api/v2/hr/payroll/payslips/:id/voidhr.payroll.payslip.void
GET / POST/api/v2/hr/payroll/advanceshr.payroll.advance.read / .create
GET/api/v2/hr/payroll/advances/:idhr.payroll.advance.read
POST/api/v2/hr/payroll/advances/:id/approvehr.payroll.advance.approve
POST/api/v2/hr/payroll/advances/:id/rejecthr.payroll.advance.approve
POST/api/v2/hr/payroll/advances/:id/disbursehr.payroll.advance.disburse
DELETE/api/v2/hr/payroll/advances/:idcancel (pre-disbursement)

Employee Self-Service (ESS) — /api/v2/me/*

All endpoints self-scope to the caller's linked employee. Client-supplied employee ids are ignored.

MethodPathPermission
GET/api/v2/me/dashboardess (linked employee)
GET / PATCH/api/v2/me/profileess.profile.read / .update
GET/api/v2/me/attendanceess.attendance.read
GET/api/v2/me/attendance/todayess.attendance.read
GET/api/v2/me/attendance/summaryess.attendance.read
POST/api/v2/me/attendance/check-iness.attendance.check-in
POST/api/v2/me/attendance/check-outess.attendance.check-out
POST/api/v2/me/attendance/break-startess.attendance.check-in
POST/api/v2/me/attendance/break-endess.attendance.check-out
POST/api/v2/me/attendance/regularizeess.attendance.regularize
GET/api/v2/me/shiftsess.shifts.read
POST/api/v2/me/shifts/swap-requestess.shifts.swap.request
POST/api/v2/me/shifts/swap-respond/:idess.shifts.swap.respond
GET/api/v2/me/leave/typesess.leave.balance.read
GET/api/v2/me/leave/balanceess.leave.balance.read
GET/api/v2/me/leave/requestsess.leave.request.read
POST/api/v2/me/leave/requestsess.leave.request.create
POST/api/v2/me/leave/requests/:id/canceless.leave.request.read (own)
GET/api/v2/me/payslipsess.payslips.read
GET/api/v2/me/payslips/:idess.payslips.read
GET/api/v2/me/payslips/:id/pdfess.payslips.download
GET/api/v2/me/documentsess.documents.read
GET/api/v2/me/holidays?year=ess.holidays.read

Catalog — Brands

MethodPathPermission
GET/api/v2/brandsbrands.read
POST/api/v2/brandsbrands.manage
GET/api/v2/brands/:idbrands.read
PATCH/api/v2/brands/:idbrands.manage
DELETE/api/v2/brands/:idbrands.manage (soft delete)
PATCH/api/v2/brands/:id/restorebrands.manage

Stores — Attendance Geofencing

MethodPathPermissionBody
PATCH/api/v2/stores/:id/geolocationstores.geolocation.update{ geoLat, geoLng, geoRadiusM } (1–50000, or all null to clear)
PATCH/api/v2/stores/:id/ip-whiteliststores.ip-whitelist.updateArray of CIDR strings

Reports — Dashboard & HR Analytics

MethodPathConsumer
GET/api/v2/reports/dashboardKPI rollup (reserved for the consolidated dashboard)
GET/api/v2/reports/employees/reports/hr → Employees tab
GET/api/v2/reports/attendance/reports/hr → Attendance tab
GET/api/v2/reports/leave/reports/hr → Leave tab
GET/api/v2/reports/payroll/reports/hr → Payroll tab
GET/api/v2/reports/activity/reports/hr → Activity tab

Notifications — Real-Time

MethodPathPermission
GET/api/v2/notificationsAny authenticated (own rows)
GET/api/v2/notifications/unread-countAny authenticated
POST/api/v2/notifications/read-allAny authenticated
PATCH/api/v2/notifications/:id/readAny authenticated (own)
POST/api/v2/notifications/broadcastnotifications.send.manual

Socket.IO Rooms & Events

RoomUsed for
tenant:{tid}:user:{uid}Per-user notification delivery
tenant:{tid}:role:{role}Role-addressed delivery
tenant:{tid}Tenant-wide
tenant:{tid}:store:{sid}Per-store (scanner relay, stock, store alerts)
EventDirectionPayload
notification:newserver → user roomthe persisted notification row
scanner:scanclient → server{ barcode }
scanner:relayserver → POS clients{ barcode, scannerDeviceId }
stock:updatedserver → store room{ productId, storeId, newQty }

Error Codes

HTTPCodeMeaning
400VALIDATION_ERRORBody failed schema validation — see error.details.
401AUTHENTICATION_FAILEDMissing/expired access token.
403AUTHORIZATION_FAILEDValid token, but missing the required permission.
403EMPLOYMENT_INACTIVEESS write attempted by a terminated/resigned employee.
404NOT_FOUNDResource missing or not yours.
409CONFLICTUnique constraint / state conflict (e.g. duplicate employeeCode).
409NO_LINKED_EMPLOYEEESS called by a login with no employee record.
409INSUFFICIENT_BALANCELeave request exceeds available balance.
403MODULE_DISABLEDHR module not enabled for this tenant.
Run it yourself

Import postman/POSVelo-API.postman_collection.json and postman/POSVelo-Development.postman_environment.json, log in, and every request above is one click away — with example bodies and auto-chained IDs. See What's New in v2 for the quick start.