Axiomatic

Payroll

API reference for payroll connections, runs, employees, tax forms, and calculator.

Payroll connections, runs, employees, pay stubs, tax forms, and the payroll calculator. All endpoints require tenant context via entityId unless noted.

Authentication

  • Session cookie — set when signed in via the web app
  • API key — pass via the x-api-key header

All endpoints require authentication and entity access.


Endpoints

Connections and runs

MethodEndpointDescription
GET/api/payroll?entityId=List connections and runs for the entity
POST/api/payrollActions: create-connection, manual-run, sync
PATCH/api/payrollUpdate connection settings
DELETE/api/payroll?connectionId=Delete a connection

GET /api/payroll

Query parameters:

ParameterTypeRequiredDescription
entityIdstringYesEntity ID for tenant context

Response: Array of connections and runs, or a single run depending on query.

POST /api/payroll

Request body:

{
  "entityId": "string",
  "action": "create-connection" | "manual-run" | "sync",
  "connectionId": "string",
  "provider": "gusto" | "adp" | "deel" | "remote",
  "credentials": { }
}

PATCH /api/payroll

Request body: Connection fields to update (e.g., sync frequency, credentials).

DELETE /api/payroll

Query parameters:

ParameterTypeRequiredDescription
connectionIdstringYesConnection to delete
entityIdstringYesEntity ID for tenant context

Employees

MethodEndpointDescription
GET/api/payroll/employees?entityId=List employees for the entity
POST/api/payroll/employeesCreate employee
PATCH/api/payroll/employees/[id]Update employee
DELETE/api/payroll/employees/[id]Terminate employee
GET/api/payroll/employees/[id]/stubsPay stub history for employee

GET /api/payroll/employees

Query parameters:

ParameterTypeRequiredDescription
entityIdstringYesEntity ID for tenant context

Response: Array of employee records with name, status, compensation, and tax info.

POST /api/payroll/employees

Request body:

{
  "entityId": "string",
  "name": "string",
  "email": "string",
  "employeeType": "employee" | "contractor",
  "compensation": { "amount": 0, "currency": "USD", "period": "monthly" },
  "taxInfo": { }
}

PATCH /api/payroll/employees/[id]

Request body: Employee fields to update.

DELETE /api/payroll/employees/[id]

Terminates the employee. Request body may include termination date and reason.

GET /api/payroll/employees/[id]/stubs

Response: Array of pay stubs with gross pay, withholdings, net pay, and period.


Runs

MethodEndpointDescription
GET/api/payroll/runs/[id]?entityId=Run detail with line items
PATCH/api/payroll/runs/[id]Approve run

GET /api/payroll/runs/[id]

Query parameters:

ParameterTypeRequiredDescription
entityIdstringYesEntity ID for tenant context

Response: Run with status, period, total amounts, and per-employee line items.

PATCH /api/payroll/runs/[id]

Request body:

{
  "action": "approve"
}

Calculator

MethodEndpointDescription
POST/api/payroll/calculatePreview or submit calculated payroll

POST /api/payroll/calculate

Request body:

{
  "entityId": "string",
  "mode": "preview" | "submit",
  "runDate": "YYYY-MM-DD",
  "employees": [
    {
      "employeeId": "string",
      "grossPay": 0,
      "deductions": [ ],
      "employerTaxes": [ ]
    }
  ]
}

Response: For preview, returns net pay and tax withholdings per employee. For submit, creates the payroll run and returns the run ID.


Tax forms

MethodEndpointDescription
GET/api/payroll/tax-forms?form=&entityId=&year=W-2, 1099, 941, 940

GET /api/payroll/tax-forms

Query parameters:

ParameterTypeRequiredDescription
formstringYesw2, 1099, 941, or 940
entityIdstringYesEntity ID for tenant context
yearnumberYesTax year (e.g., 2024)
quarternumberNoFor 941 only: 1, 2, 3, or 4

Response: Tax form data in the format required for filing (SSA/IRS) or distribution to recipients.