Golden paychecks, edge cases, and what to do when numbers differ.
The surest way to trust an integration is to run paychecks whose answers you already know. Build a set of those as fixtures, run them in CI against a test key, and treat any change as a question to answer rather than a number to update.
Cases worth having
Case
What it proves
A no-income-tax state (Texas)
Baseline: net $2,450.12 on $3,000.00.
A state with its own disability tax (California)
State lines appear: net $2,277.06.
A city tax (Columbus, Ohio)
Local lines appear: net $2,299.35.
A bonus
Supplemental wages follow the flat-rate or aggregate method.
A 401(k) deferral
Income tax wages drop but Social Security wages do not.
A check at the Social Security cap
The tax stops partway through a check.
A weekly and a monthly check
Pay frequency changes the withholding table.
A bad request
Your error handling shows the field-level message.
Run them in CI
Use a test key, which is never billed. Store each request and the expected netPay and the expected amount for each important id. Assert on ids and cents, never on formatted strings.
Check which wages the tax was applied to. Different taxableWages is the usual cause.
If the old system and the engine disagree after that, look up the agency's published method for the line.
Re-run on upgrades
Rules change. Rerun the fixtures when you pin a new API version or when a new tax year starts, and review every difference. A fixture that never changes is a fixture that is not testing the new year.
Run paychecks whose answers you know against a test key, assert on tax ids and integer cents, include edge cases such as a bonus, a deferral and a Social Security cap, and review any difference when rules change.
Do test calls cost money?
No. Test keys use the same engine and data as live keys and are never billed. They are capped at 30 requests a minute and 500 a day.