Low-Code API
The Low-Code API extends the No-Code API with C# scripting functions for cases, payruns, and reports. Scripts are embedded directly in regulation files and compiled by the backend at object creation time — no build pipeline required.
Scripting Functions
| Object | Functions |
|---|---|
| Case | Build, Validate |
| Wage Type | Available, Value, Result |
| Collector | Start, Apply, End |
| Payrun | Start, Employee Available, Employee Start/End, End |
| Report | Build, Start, End |
Scripts have access to case values, lookup tables, payrun results, and time data utilities.
Runtime Context
Each scripting function receives a typed runtime context that exposes the payroll object model and helper methods:
| Context | Available In |
|---|---|
ICaseRuntime |
Case Build, Case Validate |
ICaseRelationRuntime |
Case Relation Build, Case Relation Validate |
IWageTypeRuntime |
Wage Type Available, Value, Result |
ICollectorRuntime |
Collector Start, Apply, End |
IPayrunRuntime |
Payrun Start/End, Employee Available/Start/End |
IReportRuntime |
Report Build, Start, End |
All runtimes expose shared utilities: GetCaseValue, GetLookupValue, PayrunResults, and date/period helpers.
Embedding Scripts
Scripts are embedded as plain C# function bodies inside regulation JSON or YAML:
{
"name": "BasicSalary",
"wageTypeNumber": 1000,
"valueExpression": "return GetCaseValue<decimal>(\"MonthlySalary\");"
}
The backend compiles each expression with Roslyn when the regulation object is created. Compilation errors are reported immediately via the REST API response.
Local Development
Case and report scripts can be developed and debugged locally in Visual Studio or VS Code using the scripting runtime from the Client SDK:
- Add
PayrollEngine.Client.ScriptingNuGet package - Implement the scripting interface (e.g.
IWageTypeValueFunction) - Run and debug with full IntelliSense and breakpoint support
- Copy the function body into the regulation JSON/YAML
See the ScriptingDevelopment tutorial for a complete setup.
API Reference
The full scripting API reference is generated from the PayrollEngine.Client.Scripting source:
See Also
- No-Code API — declarative actions without scripting
- Payroll Automation — when to use No-Code vs Low-Code
- Custom Actions — extending the action vocabulary
- Client SDK — scripting runtime and NuGet packages