POST /v1/paycheck
Calculate a paycheck
Returns each federal, state and local tax for one paycheck, plus totals and net pay. All amounts are integers in cents.
The body is described by a JSON Schema, and the whole API by an OpenAPI 3.1 document. Import either into your editor, client generator or Postman. Both are generated from the same lists the server validates against, so a value they allow is a value the API accepts.
Money is integer cents: $3,000.00 is 300000. A decimal such as 3000.5 is a 422 that says so. Rates are decimals: 0.031 is 3.1%. Dates are YYYY-MM-DD.
Body
| checkDate string | required | Pay date, YYYY-MM-DD. Picks the tax year. |
| payPeriodStart string | First day of the pay period, YYYY-MM-DD, on or before checkDate. Only local taxes whose ordinance starts with a pay period read it (Whitesville KY, Springfield OR); everything else keys to checkDate. | |
| payFrequency string | required | One of weekly, biweekly, semimonthly, monthly, quarterly, semiannual, annual or daily. |
| earnings array | required | { code, category, amount } per earning line. amount is cents. |
| deductions array | required | Pretax and posttax deductions, amounts in cents. Send [] when there are none. |
| federalW4 object | required | All six fields are required: filingStatus, multipleJobs, dependentCredit, otherIncome, deductions, extraWithholding. Dollar fields are cents. For an employee still on a 2019-or-earlier W-4, send legacyAllowances (the line 5 count) with multipleJobs false, the credit and income fields at 0, and filingStatus single or married_joint. |
| ytd object | required | Year-to-date socialSecurity, medicare, and futa wages, in cents. Send zeros at the start of the year. Add electiveDeferrals { section402gAggregate, deferral457, simple } to apply the annual retirement limit; without it every deferral is treated as the first of the year. |
| employee object | ageAtYearEnd: the age the employee reaches by December 31. 50 and over raises the 401(k), 403(b), 457(b) and SIMPLE limits; 60 through 63 raises them further. Without it the standard limits apply and a capped deferral carries a warning. | |
| workState object | required | { code, certificate }. Pennsylvania uses workPSD and residencePSD. |
| residenceState object | { code, certificate } for where the employee lives, when it differs from workState. residenceStateWithholding { nexus, voluntary } says whether that state also withholds. | |
| employer object | Facts only the employer has. stateUnemploymentRate is your assigned rate by state, e.g. { "OH": 0.031 }; without it the state's new-employer rate is used and the line says so. | |
| employmentCategory string | standard (default), clergy, statutory_employee, household, agricultural, railroad or election_worker. A misspelling is a 422. | |
| priorRegularPayment object | For a bonus paid apart from regular pay: { taxableWages, stateIncomeTaxWithheld } of the check it is aggregated with. | |
| roundToWholeDollars boolean | Round state withholding to whole dollars where the state requires it. | |
| minimumWageCheck object | { hourlyRate } in cents, compared with wage floors on the same call. Optional: locality, employeeCount, tipped, region, occupation. American Samoa has no single minimum wage, so it also needs industry (for example garment); without it the check is refused. | |
| garnishments array | Orders: consumer_creditor, child_support, federal_student_loan_default, federal_nontax_debt, federal_tax_levy, state_tax_levy, chapter_13_bankruptcy, medical_support. amountOrdered is cents. Each type has its own fields; see the API reference. |
Response
The HTTP body wraps the engine result: { "result": PaycheckResult }.
| grossPay | Total earnings in cents. |
| taxes | { id, name, payer, jurisdiction, taxableWages, amount, detail }. |
| employeeTaxTotal | Sum of employee taxes, in cents. |
| employerTaxTotal | Sum of employer taxes, in cents. |
| netPay | Gross minus employee taxes and deductions, in cents. |
| notices, warnings | Returned when an input needs a second look. warnings also names any request field the API did not read, with the field you probably meant, so a misspelled optional field is not silent. |
Errors
| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_json | The body is not valid JSON. |
| 401 | missing_key | No API key was sent. |
| 401 | invalid_key | The key is wrong or inactive. |
| 401 | expired_key | The key passed its expiry date. |
| 402 | payment_method_required | No card or bank account on file. |
| 402 | subscription_cancelled | The subscription was cancelled. Start a new one in the console. |
| 402 | account_suspended | A payment failed and the key is paused. Update the payment method. |
| 422 | invalid_input | The body failed validation. See details. |
| 422 | unsupported_tax_year | No rules for the year of checkDate. |
| 422 | cannot_compute | The input is valid but the engine cannot compute it, for example a missing certificate field. The message says which. |
| 429 | rate_limited | Too many requests this minute. Retry later. |