The shape of the request and the shape of the answer.
A JSON payroll tax API should be readable without a manual. The request is one object describing a paycheck. The response is one object describing what the paycheck owes. Here are both, with the fields that matter most.
The date on the check. Decides which year's rules apply.
payFrequency
weekly, biweekly, semimonthly, monthly and the other periods the rules define.
earnings[]
Each has a code, a category (regular, supplemental, imputed, reimbursement) and an amount in cents.
deductions[]
Each has a category such as deferral_401k, section125 or hsa, or null for post-tax.
federalW4
Filing status, multiple-jobs box, dependent credit, other income, deductions, extra withholding.
ytd
Social Security, Medicare and FUTA wages so far this year, so caps stop at the right check.
workState
The work state code and that state's certificate answers.
The response
Under result are the gross pay, the pre- and post-tax deduction totals, the taxes array, the employee and employer totals and netPay. Each tax line carries:
id: a stable identifier such as US_FIT or US_SS_EE.
name: the name for a pay stub.
payer: employee or employer.
jurisdiction: federal, state or local.
taxableWages and amount, both integer cents.
detail: a sentence on how the figure was reached.
For the Texas example, the federal income tax line has taxable wages of $3,000.00 and an amount of $320.38, and its detail reads: annualised $78000.00 → adjusted $69400.00; bracket 22% over $57900.00; tentative/yr $8330.00 ÷ 26
Optional blocks
A response may also carry notices (lines resting on a weaker source than the levying body's own form), warnings (inputs that need a second look) and electiveDeferrals (what stayed pre-tax after annual limits). Code that ignores them still works; code that reads them can show a reviewer why a line needs checking.
A result object with gross pay, deduction totals, an array of tax lines (id, name, payer, jurisdiction, taxable wages, amount, detail), employee and employer totals, and net pay, plus optional notices and warnings.
Are tax line ids stable?
Yes. Ids such as US_FIT and US_SS_EE are identifiers to branch on; names are for display and may be reworded.