# Area 4: Worker payroll settings

Generated 2026-12-01 from the Everee docs (branch v1.0). Part of https://files.everee.com/everee-payroll-infrastructure-explainer.md

```text
GOAL
Build the screens and sync for each worker's payroll settings: benefit, retirement and other deductions, garnishments and child-support orders, and paid leave (types, policies, enrollment, balances).

READ FIRST (each page also has a Markdown version at the same URL with .md added; the docs index is https://developer.everee.com/llms.txt)
- https://developer.everee.com/reference/deductions-api-guide
- https://developer.everee.com/reference/apply-benefit-deduction
- https://developer.everee.com/reference/apply-retirement-deduction
- https://developer.everee.com/reference/apply-other-deduction
- https://developer.everee.com/reference/get-deduction-reconciliation
- https://developer.everee.com/reference/list-leave-types
- https://developer.everee.com/reference/create-leave-policy
- https://developer.everee.com/reference/enroll-workers-in-leave-policy

BUILD
- An elections table per worker like a benefits screen: each row posts to POST /deductions/benefits, /retirement or /other to start, change or end it, with an effective date and employee and employer amounts or percentages (including 401(k) match tiers).
- A reconciliation view from GET /deductions/reconciliation showing what payroll actually deducted for a pay period, to compare with the elections.
- Leave: manage types, policies, enrollment and balances (GET/POST /leave/types, /leave/policies, enrollments, worker balances, award rules).
- Garnishments and income-withholding orders are multipart POSTs (/garnishments, /income-withholding-orders): upload the order document with the terms.

OPERATIONS (all paths are under https://api.everee.com/integration/v1; each reference page, with .md added, lists its request and response fields)
- POST /deductions/benefits | operationId apply-benefit-deduction | https://developer.everee.com/reference/apply-benefit-deduction.md
- POST /deductions/retirement | operationId apply-retirement-deduction | https://developer.everee.com/reference/apply-retirement-deduction.md
- POST /deductions/other | operationId apply-other-deduction | https://developer.everee.com/reference/apply-other-deduction.md
- GET /deductions/reconciliation | operationId get_deduction_reconciliation | https://developer.everee.com/reference/get-deduction-reconciliation.md
- GET /leave/types | operationId list-leave-types | https://developer.everee.com/reference/list-leave-types.md
- POST /leave/types | operationId create-leave-type | https://developer.everee.com/reference/create-leave-type.md
- DELETE /leave/types/{leaveTypeName} | operationId delete-leave-type | https://developer.everee.com/reference/delete-leave-type.md
- GET /leave/policies | operationId list-leave-policies | https://developer.everee.com/reference/list-leave-policies.md
- POST /leave/policies | operationId create-leave-policy | https://developer.everee.com/reference/create-leave-policy.md
- PUT /leave/policies/{policyId} | operationId update-leave-policy | https://developer.everee.com/reference/update-leave-policy.md
- DELETE /leave/policies/{policyId} | operationId delete-leave-policy | https://developer.everee.com/reference/delete-leave-policy.md
- GET /leave/policies/unenrolled | operationId list-unenrolled-workers | https://developer.everee.com/reference/list-unenrolled-workers.md
- POST /leave/policies/{policyId}/enrollments | operationId enroll-workers-in-leave-policy | https://developer.everee.com/reference/enroll-workers-in-leave-policy.md
- POST /leave/policies/{policyId}/unenroll | operationId unenroll-workers-from-leave-policy | https://developer.everee.com/reference/unenroll-workers-from-leave-policy.md
- GET /workers/{workerId}/leave/balances | operationId get-worker-leave-balances | https://developer.everee.com/reference/get-worker-leave-balances.md
- PUT /workers/{workerId}/leave/balances/{leaveTypePayCode} | operationId update-worker-leave-balance | https://developer.everee.com/reference/update-worker-leave-balance.md
- PUT /workers/{workerId}/leave/award-rules | operationId update-worker-leave-award-rules | https://developer.everee.com/reference/update-worker-leave-award-rules.md
- POST /garnishments | operationId (see page)
- POST /income-withholding-orders | operationId (see page)

RULES
- Changes apply from an effective date and never change past payrolls. Show the effective date and don't offer back-dating that Everee would reject.
- Everee calculates garnishment limits and handles remittance. Send the order, never calculate or remit it yourself.
- Build every flow as a loop around reads that tell you what is left: make a change, read the state again (readiness.missing for onboarding, a run's blockers and the requirements behind them for payroll, a funding's status and resolutionInstructions), and act on what is left. Never hard-code the steps: codes appear and disappear. Map each code you know to a screen, and show resolutionInstructions for any you don't. Use webhooks (company-onboarding.status-changed, requirement.created, payroll-run.status-changed) to know when to read again, not instead of the read. A requirement does NOT open when a worker is created or changed: it opens only when a payroll calculation or a returned deposit finds the problem, so calculate runs early.
- Base URL https://api.everee.com/integration/v1. The partner key is the HTTP Basic user name for the Company Onboarding API: the test key (zk_test_...) creates and reaches only Sandbox companies and the production key (zk_prod_...), issued after Everee approves the integration, only Production companies. A company in the other environment returns 404. The company key (tsk_...) is the HTTP Basic user name for everything else, plus an x-everee-tenant-id header holding the company's id.
- Keep every key on the server. Everee rejects browser requests. Read keys from a secrets store, never log them, never hard-code them.
- Rate limit: 100 operations per 5 seconds per key (see the RateLimit-Policy header). Back off on 429.
- Only payables and payroll run items have an idempotency key (externalId). Make other creates safe yourself: look first, keep the Everee ID next to your own record.
- Test against a sandbox instance (tsk_test_... keys) before production. Nothing in a URL selects the environment; the key does. Sandbox company creation is limited (25 alive at once, 50 created in any rolling 7 days; evaluation access before the agreement is signed: 1 and 2, 14 days, companies created without an agreement), and each Sandbox company is limited to 250 workers, 100 off-cycle runs in 7 days and 100 payroll calculations in 24 hours: a refused request returns 429 with when the next can be created, and a sandbox company you no longer need can be retired.

DONE WHEN
- A deduction can be started, changed and ended in sandbox, and reconciliation matches the election after a sandbox payroll.
- Leave balances shown to users come from the API, not a local calculation.

TESTS TO WRITE
- Start, change and end a deduction each send the right effective date, and a past end date is blocked in your UI.
- After a sandbox payroll, the reconciliation endpoint totals match the elections, or the screen shows the difference.
- A garnishment or income-withholding order is sent as multipart with its document.
- Leave balances on screen come from the API, never from a local calculation.

If a fact you need isn't in the docs, ask me. Don't guess endpoint paths, field names or business rules.
```
