Audience: frontend and integration engineers. The HTTP surface of Payroll — which controller owns what, base routes, and the endpoints that matter, with the lifecycle mutations detailed.

Companion: technical.md (what the endpoints do internally), glossary.md (payload vocabulary).

Source of truth: routes read from src/Core.Backend.Api/Controllers/** on 2026-07-17. Every controller here is [Authorize] (bearer token + tenant context required). Route templates are shown relative to the API base (https://pademware.azurewebsites.net).


1. Controller map — where Payroll lives

Payroll's HTTP surface is split across several controllers, and the split is not obvious. Learn this table first:

Base route Controller Owns
Admin/Payrolls Admin/PayrollsController Running payroll — Prepare / Submit / Cancel, previews, reports, on-demand, skip-employees
Admin/Company Admin/CompanyController Configuration CRUD — paybands, paygrades, allowances, tax reliefs, statutory benefits
Admin/Payment_Schedules Admin/Payment_SchedulesController The payment pipeline — schedules, disbursement, reversals, retries
Admin/Benefits Admin/BenefitsController Benefit / PFA / HMO enrolment
Payrolls PayrollsController Non-admin read views of items/reports
Payment_Schedules Payment_SchedulesController Approver review of payment schedules
Payroll_Items Payroll_ItemsController Payslip item views (View/Payslip, View/Payslips, _Admin variants)
Employee/Payslips Employee/PayslipsController Employee self-service payslips (View/Index, View/Consolidate_Payslips, GetPayrollYears)

Gotcha: paygrade/payband/allowance configuration is under Admin/Company, not Admin/Payrolls. Don't hunt for it in the Payrolls controller.


2. The lifecycle mutations (the ones that change money)

Prepare a run — POST Admin/Payrolls/Prepare

Computes the payroll for a schedule + period into preview (Temp) tables. Idempotent-ish: re-preparing recomputes the preview. Internally dispatches spPrepareRegularPayroll / spPrepareOffcyclePayroll (see technical §8). Guarded by the PayrollMonitor concurrency lock.

Submit a run — POST Admin/Payrolls/Submit

Commits the preview to live tables and moves the run into approval + payment. Dispatches spSubmitRegularPayroll / spSubmitOffcyclePayroll. After this the run status advances New → Submitted → Approved → Processing → Processed.

Cancel a run — POST Admin/Payrolls/Cancel

Cancels/rolls back a run (spRollbackPayroll).

On-Demand payroll