Skip to content

Run payroll

Say "run payroll" and get a Pay Run with every employee's withholding, an approval, direct deposit on payday and the run in your books.

Pay every employee for one pay period: the agent prepares the Pay Run, it is approved, and net pay lands on payday.

Needs Pay runs · Tax IDs

What you get

  • 1Pay Run with gross, withholding, deductions and net pay per employeePay Run
  • 1Approval when the run is over the Payroll Specialist’s LimitApproval
  • 1direct deposit to each employee on the pay dateTransaction
  • 1tax deposits and employer returns filed by the payroll providerPay Run
  • 4lines in your books per run: wages, employer tax, then cash outEntry
  • 1pay stub emailed to each employeeMessage

Your agent does

PayRun.prepare → PayRun.approve
You, to your agent

Run payroll this Friday.

Run payroll for the first half of November.

Run an off-cycle payroll for Maya’s bonus.

# 1. PayRun.prepare
PAY_RUN=$(curl -X POST https://api.sb/leaseline.app/pay-runs/prepare \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"company":"company_leaseline","periodStart":"2026-11-01","periodEnd":"2026-11-15","payDate":"2026-11-15"}' | jq -r '.payRun["$id"] | split("/") | last')

# 2. PayRun.approve
curl -X POST https://api.sb/leaseline.app/pay-runs/$PAY_RUN/approve \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
import { $ } from 'startup-builder'

const payRun = await $.PayRun.prepare({ company: 'company_leaseline', periodStart: '2026-11-01', periodEnd: '2026-11-15', payDate: '2026-11-15' })
await $.PayRun.approve({ payRun: payRun.$id })
PAY_RUN=$(npx startup-builder do PayRun.prepare --json '{"company":"company_leaseline","periodStart":"2026-11-01","periodEnd":"2026-11-15","payDate":"2026-11-15"}' | jq -r '.payRun["$id"] | split("/") | last')
npx startup-builder do PayRun.approve --json '{"payRun":"'"$PAY_RUN"'"}'
{
  "name": "do",
  "arguments": {
    "code": "const payRun = await $.PayRun.prepare({ company: 'company_leaseline', periodStart: '2026-11-01', periodEnd: '2026-11-15', payDate: '2026-11-15' })\nreturn await $.PayRun.approve({ payRun: payRun.$id })"
  }
}

Change it

  • Pay us twice a month instead of every two weeks.
  • Add Maya’s $2,000 bonus to the next run.
  • Approve every run under $40,000 without asking me.
  • Void this run and prepare it again.

Under the hood

Systems
Pay runs, Ledger, Treasury, Workforce
Nouns
Pay Run, Human, Agreement, Entry, Transaction
Events
PayRun.prepared, PayRun.approved, PayRun.paid

PayRun.prepare reads each employee's rate from their employment Agreement and withholds for the state where they work. A missing rate, tax setup or bank account opens a Task before anything is approved.

PayRun.approve books the cost the moment it runs, so the Ledger shows payroll by Team the same day. PayRun.pay draws on the operating account early enough to land on payday; keep the account funded before then.

A mistake in a paid run is fixed in the next one, or in an offCycle run the same week. Who is an employee and who is a contractor stays your call; contractors are paid through Earnings.