Skip to main content

Overview

Toku supports two payslip workflows: automatic generation after a payroll run completes, and manual upload of PDF payslips. Both produce hrisPayslip records that employees can download via presigned URLs.

Payslip Generation

When a payroll run finishes, Toku automatically generates payslips and fires a payslip.generated webhook event. Subscribe to this event to know when payslips are ready. For webhook setup, see Webhooks.

File Upload Flow

To upload an external PDF payslip, follow this three-step process. The PDF must be under 20 MB (fileSizeInBytes ≤ 20971520).
1

Request a presigned upload URL

Call POST /createHrisPayslipFileUpload with the file metadata. The response contains a fileID and a presigned uploadUrl for S3.
Response:
Save both fileID and uploadUrl — you need them in the next steps.
2

Upload the PDF directly to S3

PUT the raw PDF binary to the presigned uploadUrl. No Toku authorization header is needed — the presigned URL includes all required credentials.
A 200 OK response confirms the upload succeeded. If S3 returns an error, the presigned URL may have expired — request a new one from Step 1.
3

Register the payslip with Toku

Call POST /createHrisPayslip with the fileID from Step 1 and the payslip financial details.
Response:
The returned hrisPayslipID is the stable identifier for this payslip record.

Retrieving Payslips

Organization-level listing

Use POST /getHrisPayslipsForOrg to list all payslips across an organization with optional filters: The response includes totalCount, a payslips[] array, and a dashboardSummary.

Employee-level listing

Use POST /getHrisPayslipsForEmployee with a roleInOrgID to retrieve all payslips for a specific employee.

Downloading Payslips

Call POST /getHrisPayslipDownloadUrl with an hrisPayslipID to get a short-lived presigned download URL:
Response:
Redirect the employee’s browser to downloadUrl or proxy it from your backend. The URL is short-lived — do not cache it.

Endpoints

Create Payslip File Upload

Get a presigned S3 URL for PDF upload

Create Payslip

Register an uploaded file as a payslip record

Get Payslips for Org

List all payslips with search and filters

Get Payslips for Employee

List payslips for a specific employee

Get Payslip Download URL

Get a presigned URL to download a payslip PDF