# Area 1: Onboard a company

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 server logic that onboard a customer as an Everee company from inside my product: capture details, send documents and people, show Everee's embedded contract signing, submit for review, and track status through APPROVED to went-live.

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/docs/company-onboarding-overview
- https://developer.everee.com/reference/company-onboarding-api-guide
- https://developer.everee.com/docs/creating-and-completing-a-company
- https://developer.everee.com/docs/signing-the-agreements
- https://developer.everee.com/docs/company-onboarding-events
- https://developer.everee.com/docs/how-to-embed-components-guide
- https://developer.everee.com/reference/get-partner-company-status
- https://developer.everee.com/reference/create-partner-company-contract-session
- Reference implementation: the Company Signup Simulator at https://files.everee.com/simulators/company-signup.html. Walk it before you design the screens. Its developer pane shows each call, the live /status JSON, the signed webhooks and the code. Match its behavior, not its styling: your product's look comes from my UI framework.

BUILD
- POST https://api.everee.com/integration/v1/partner/companies with the legal name, EIN and primary contact. Save the returned company id, apiKey and webhookSigningKey immediately: they are shown once. The webhookUrl is my integration's configuration (one endpoint for the platform), so pass it from config and don't put it on a form.
- Wizard screens that fill the draft: company details and payroll profile, documents, taxes, control person, owners of 25% or more, and signer. Use GET /partner/companies/{id}/status after every change; its readiness codes say exactly what is missing.
- Some steps have no screen of their own because the integration does them: reporting the customer's agreement consent (only when the account uses an umbrella agreement) and the submit. Do them from the server at the point the status says they are due, and show the customer only what they need to act on.
- Lock-step: show the next screen only once the one before it is saved, and drive it from readiness.missing rather than from a fixed list, because Everee can add a requirement while the company is a draft (for example a business formation document).
- A signing screen: create a signing session (experience COMPANY_CONTRACT), show the returned URL in an iframe, handle the MESSAGE_PORT_REGISTERED, CONTRACT_SIGNED and DISMISS messages, and create a new session if one expires. The signer chooses the funding bank account inside that embedded screen, so never collect bank details yourself.
- Submit for review, then handle identity verification links and review requests that come back. On company-onboarding.status-changed to APPROVED, switch to using the company key.
- Payroll history, after submitting: create a session with POST https://api.everee.com/integration/v1/partner/companies/{id}/payroll-history/embedded-session right before showing it, open its url in an iframe, and on PAYROLL_HISTORY_DONE read GET /payroll-history to show the files and Everee's review of each. Answer a DOCUMENT_NEEDED request for PAYROLL_HISTORY by opening the component again; it can come after approval. A company that paid no one earlier in the go-live year declares it instead (PUT /payroll-history/declaration with a reason, or in the component); show NONE_DECLARED as waiting for Everee to confirm, not as done.
- Going live: send targetGoLiveDate (the first day of a pay period, tomorrow or later) with the payroll profile and offer only valid dates; after signing change it with PUT /go-live/target. Show goLive from the status: the target, Everee's goLiveDate, and outstanding in plain words. If outstanding lists TARGET_GO_LIVE_DATE, ask for a new date. If it lists TAX_SETUP, Everee's tax team is collecting tax information from the company's tax contact (taxContact on create, defaulting to the primary contact; the signer replaces it): send a phone number and tell the customer to expect the call. In Sandbox, Everee's post-approval steps run on their own (about 6 minutes to live, about 15 with payroll history); a payroll history file named changes-requested or a company document named information-needed takes the unhappy path. The company can run payroll on company-onboarding.went-live or goLive.live true.

OPERATIONS (all paths are under https://api.everee.com/integration/v1; each reference page, with .md added, lists its request and response fields)
- POST /partner/companies | operationId create-partner-company | https://developer.everee.com/reference/create-partner-company.md
- GET /partner/companies/{companyId} | operationId get-partner-company | https://developer.everee.com/reference/get-partner-company.md
- PATCH /partner/companies/{companyId} | operationId update-partner-company | https://developer.everee.com/reference/update-partner-company.md
- PATCH /partner/companies/{companyId}/payroll-profile | operationId update-partner-company-payroll-profile | https://developer.everee.com/reference/update-partner-company-payroll-profile.md
- GET /partner/companies/naics-codes | operationId list-partner-company-naics-codes | https://developer.everee.com/reference/list-partner-company-naics-codes.md
- POST /partner/companies/{companyId}/documents/{kind} | operationId upload-partner-company-document | https://developer.everee.com/reference/upload-partner-company-document.md
- GET /partner/companies/{companyId}/documents | operationId list-partner-company-documents | https://developer.everee.com/reference/list-partner-company-documents.md
- POST /partner/companies/{companyId}/payroll-history/embedded-session | operationId create-partner-company-payroll-history-session | https://developer.everee.com/reference/create-partner-company-payroll-history-session.md
- GET /partner/companies/{companyId}/payroll-history | operationId get-partner-company-payroll-history | https://developer.everee.com/reference/get-partner-company-payroll-history.md
- POST /partner/companies/{companyId}/payroll-history/files | operationId upload-partner-company-payroll-history-file | https://developer.everee.com/reference/upload-partner-company-payroll-history-file.md
- PUT /partner/companies/{companyId}/payroll-history/declaration | operationId declare-partner-company-no-payroll-history | https://developer.everee.com/reference/declare-partner-company-no-payroll-history.md
- PUT /partner/companies/files/year-to-date | operationId upload-partner-company-year-to-date-file | https://developer.everee.com/reference/upload-partner-company-year-to-date-file.md
- GET /partner/companies/{companyId}/go-live | operationId get-partner-company-go-live | https://developer.everee.com/reference/get-partner-company-go-live.md
- PUT /partner/companies/{companyId}/go-live/target | operationId set-partner-company-target-go-live | https://developer.everee.com/reference/set-partner-company-target-go-live.md
- PUT /partner/companies/{companyId}/files/certificate-of-authority | operationId upload-partner-company-certificate-of-authority | https://developer.everee.com/reference/upload-partner-company-certificate-of-authority.md
- PUT /partner/companies/{companyId}/control-person | operationId put-partner-company-control-person | https://developer.everee.com/reference/put-partner-company-control-person.md
- PUT /partner/companies/{companyId}/ownership-declaration | operationId put-partner-company-ownership-declaration | https://developer.everee.com/reference/put-partner-company-ownership-declaration.md
- POST /partner/companies/{companyId}/beneficial-owners | operationId add-partner-company-beneficial-owner | https://developer.everee.com/reference/add-partner-company-beneficial-owner.md
- PUT /partner/companies/{companyId}/signer | operationId put-partner-company-signer | https://developer.everee.com/reference/put-partner-company-signer.md
- PATCH /partner/companies/{companyId}/people/{personRef}/contact | operationId correct-partner-company-person-contact | https://developer.everee.com/reference/correct-partner-company-person-contact.md
- POST /partner/companies/{companyId}/people/{personRef}/identity-verification/resend | operationId resend-partner-company-identity-link | https://developer.everee.com/reference/resend-partner-company-identity-link.md
- PUT /partner/companies/{companyId}/agreement-consent | operationId put-partner-company-agreement-consent | https://developer.everee.com/reference/put-partner-company-agreement-consent.md
- PATCH /partner/companies/{companyId}/tax-setup | operationId update-partner-company-tax-setup | https://developer.everee.com/reference/update-partner-company-tax-setup.md
- GET /partner/companies/{companyId}/bank-account | operationId get-partner-company-bank-account | https://developer.everee.com/reference/get-partner-company-bank-account.md
- POST /partner/companies/{companyId}/contract/embedded-session | operationId create-partner-company-contract-session | https://developer.everee.com/reference/create-partner-company-contract-session.md
- GET /partner/companies/{companyId}/contract/documents/{documentType} | operationId get-partner-company-contract-document | https://developer.everee.com/reference/get-partner-company-contract-document.md
- GET /partner/companies/{companyId}/status | operationId get-partner-company-status | https://developer.everee.com/reference/get-partner-company-status.md
- POST /partner/companies/{companyId}/submit | operationId submit-partner-company | https://developer.everee.com/reference/submit-partner-company.md
- POST /partner/companies/{companyId}/withdraw | operationId withdraw-partner-company | https://developer.everee.com/reference/withdraw-partner-company.md
- GET /partner/companies/{companyId}/requests | operationId list-partner-company-requests | https://developer.everee.com/reference/list-partner-company-requests.md
- PUT /partner/companies/{companyId}/requests/{requestId}/file | operationId fulfill-partner-company-request-with-file | https://developer.everee.com/reference/fulfill-partner-company-request-with-file.md
- PUT /partner/companies/{companyId}/requests/{requestId} | operationId fulfill-partner-company-request-with-text | https://developer.everee.com/reference/fulfill-partner-company-request-with-text.md

RULES
- After signing the documents' data is locked: name, address, signer, owners, tax details and pricing return 409. Don't offer edit controls for them after signing.
- Sessions are single-use and expire in minutes. Create one when the user arrives, never earlier.
- Webhooks are nudges. Re-read /status to decide what to show.
- 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 sandbox company goes from DRAFT through signing to submitted, and the UI always reflects the readiness codes from /status.
- The company key and company id are stored encrypted, and a status-changed webhook updates the UI.
- These scenarios from the simulator behave the same in my build: a late requirement (Everee adds the formation document after the customer has filled the draft, and the customer uploads it before signing); an owner is added in response to a review request; an expired identity link is resent; a rejected document is replaced; and a declined company shows a generic message.

TESTS TO WRITE
- Every readiness code from /status renders the right prompt or screen.
- An expired signing session is replaced by a new one, and no session is created before the user arrives.
- After signing, the locked fields are read-only in the UI, and a 409 from the API is shown as an explanation.
- A company-onboarding.status-changed event for APPROVED switches the company to its company key, and a replayed event changes nothing.
- An approved company isn't treated as live: the product waits for company-onboarding.went-live (or goLive.live) before it offers payroll runs.
- The company key and webhook signing key are stored encrypted and are not logged.

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