Skip to content

Pay Run methods: approve, pay, prepare, void

The Pay Run Verbs approve, pay, prepare, void as typed SDK methods, with inputs, result, refusals and an example.

Reference for Pay Run, one group of Pay Run methods.

PayRun.approve

Approve accepts a prepared Pay Run within the approver’s Mandate, books its cost, and schedules payment to land on the pay date. Verb page.

TypeScript
interface PayRunVerbs {
  approve(input: PayRunApproveInput, options?: SB.CallOptions): SB.Call<PayRun>
}

Emits PayRun.approved.

Inputs

InputTypeRequiredDescription
payRunPay RunrequiredThe prepared Pay Run.

Returns

OutputTypeRequiredDescription
payRunPay RunrequiredThe approved Pay Run, scheduled for its pay date.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

TypeScript
import { $ } from 'startup-builder'

const payRun = await $.PayRun.approve({ payRun: 'payrun_hqqWu5rAyZ' })

PayRun.pay

Pay funds an approved Pay Run: net pay to each employee’s bank on the pay date, taxes and deductions to the payroll provider. Verb page.

TypeScript
interface PayRunVerbs {
  pay(input: PayRunPayInput, options?: SB.CallOptions): SB.Call<PayRunPayOutput>
}

Emits PayRun.paid.

Inputs

InputTypeRequiredDescription
payRunPay RunrequiredThe approved Pay Run.

Returns

OutputTypeRequiredDescription
payRunPay RunrequiredThe paid Pay Run.
transactionTransactionrequiredThe funding Transaction.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

TypeScript
import { $ } from 'startup-builder'

const { payRun, transaction } = await $.PayRun.pay({ payRun: 'payrun_hqqWu5rAyZ' })

PayRun.prepare

Prepare computes one pay period’s gross pay, withholding, deductions and employer taxes for each employee, and holds the Pay Run for approval. Verb page.

TypeScript
interface PayRunVerbs {
  prepare(input: PayRunPrepareInput, options?: SB.CallOptions): SB.Call<PayRun>
}

Emits PayRun.prepared.

Inputs

InputTypeRequiredDescription
companyCompanyrequiredThe employer Company.
periodStartdaterequiredThe first day of the pay period.
periodEnddaterequiredThe last day of the pay period.
payDatedaterequiredThe day net pay should land.
kindstringDefaults to regular; offCycle pays outside the schedule.
humanslist of HumanOnly these employees. Defaults to every employee of the Company.

Returns

OutputTypeRequiredDescription
payRunPay RunrequiredThe prepared Pay Run, with every amount per employee.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

TypeScript
import { $ } from 'startup-builder'

const payRun = await $.PayRun.prepare({ company: 'company_28zYNZEno0', periodStart: '2026-10-22', periodEnd: '2026-10-22', payDate: '2026-10-22' })

PayRun.void

Void sets aside a prepared Pay Run that is wrong, so a corrected one can be prepared; the record stays. Verb page.

TypeScript
interface PayRunVerbs {
  void(input: PayRunVoidInput, options?: SB.CallOptions): SB.Call<PayRun>
}

Emits PayRun.voided.

Inputs

InputTypeRequiredDescription
payRunPay RunrequiredThe prepared Pay Run.
reasontextrequiredWhy it was set aside.

Returns

OutputTypeRequiredDescription
payRunPay RunrequiredThe voided Pay Run.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

TypeScript
import { $ } from 'startup-builder'

const payRun = await $.PayRun.void({ payRun: 'payrun_hqqWu5rAyZ', reason: 'Example reason' })