payrollRuns
Crew module · 6 operations
List payroll run rows
GET/payroll-runs
A payroll run. It cannot jump from Draft to Accepted. Returns a cursor page of payroll run rows the caller may see. The default order is `created_at` ascending. Supports sparse fieldsets and the filter grammar.
Create a payroll run
POST/payroll-runs
A payroll run. It cannot jump from Draft to Accepted. Creates a payroll run. Requires `Idempotency-Key`; a replay returns the original response. The organization is derived from the credential or the parent row, never from the body.
Get a payroll run
GET/payroll-runs/{id}
A payroll run. It cannot jump from Draft to Accepted. Returns one payroll run with its `ETag`. A payroll run the caller may not see returns 404.
Transition the payroll run state
POST/payroll-runs/{id}/transitions
Moves the payroll run lifecycle to another state through its transition RPC, which writes the transition ledger. Uses compare-and-set on `expected_state`; a disallowed transition returns a 422 refusal. Requires `Idempotency-Key`; a replay returns the original response. A rule that refuses the request returns 422 with `refusal` and `reason`.
Calculate a payroll run
POST/payroll-runs/{id}/calculate
Replaces the run's lines from the approved member timesheets of its pay period, splitting overtime by the canon wage and hour rule of each project's jurisdiction; the run becomes Calculated. A missing earning code, rate or rule is refused (422) and names it. Requires `Idempotency-Key`; a replay returns the original response. A rule that refuses the request returns 422 with `refusal` and `reason`.
Approve a payroll run
POST/payroll-runs/{id}/approve
Records an approval on a Calculated run under spend authority for Payroll Run, never by the run's creator; the run becomes Approved once fully approved. A refusal returns 422 and names the rule. Requires `Idempotency-Key`; a replay returns the original response. A rule that refuses the request returns 422 with `refusal` and `reason`.