# Area 6: Retrieve financial data

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 financial reporting for the company's finance users: payments, payroll cost, a balanced payroll journal ready to post to a general ledger, and file-based reports.

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/after-payroll
- https://developer.everee.com/reference/get-payment-data
- https://developer.everee.com/reference/list-payroll-journal-fundings
- https://developer.everee.com/reference/get-payroll-journal-for-funding
- https://developer.everee.com/reference/upsert-gl-mappings
- https://developer.everee.com/reference/reports-api-guide
- https://developer.everee.com/reference/retrieve-report-run
- https://developer.everee.com/reference/get-payroll-cost-segments-by-period

BUILD
- A journal screen: list fundings (GET /payroll-costs/journal/fundings), open one (/fundings/{id}) to show balanced debit and credit lines by category, type, GL code and account, and a GL-mapping editor (GET/PUT /payroll-costs/journal/gl-mappings and /options).
- Cost views from /payroll-costs/segments/by-period and /by-cost-centers, payment data from GET /payment-data, a worker pay history, and deduction reconciliation.
- A reports screen: request a report run (POST /reports/{report-type}), wait for the report.completed webhook, then retrieve the run for a download link. Also list worker files and company tax files.

OPERATIONS (all paths are under https://api.everee.com/integration/v1; each reference page, with .md added, lists its request and response fields)
- GET /payment-data | operationId get_payment_data | https://developer.everee.com/reference/get-payment-data.md
- GET /payroll-costs/segments/by-period | operationId get_payroll_cost_segments_by_period | https://developer.everee.com/reference/get-payroll-cost-segments-by-period.md
- GET /payroll-costs/segments/by-cost-centers | operationId get_payroll_cost_segments_by_cost_centers | https://developer.everee.com/reference/get-payroll-cost-segments-by-cost-centers.md
- GET /payroll-costs/journal/fundings | operationId list_payroll_journal_fundings | https://developer.everee.com/reference/list-payroll-journal-fundings.md
- GET /payroll-costs/journal/fundings/{fundingId} | operationId get_payroll_journal_for_funding | https://developer.everee.com/reference/get-payroll-journal-for-funding.md
- PUT /payroll-costs/journal/gl-mappings | operationId upsert_payroll_journal_gl_mappings | https://developer.everee.com/reference/upsert-gl-mappings.md
- GET /payroll-costs/journal/gl-mappings | operationId list_payroll_journal_gl_mappings | https://developer.everee.com/reference/list-gl-mappings.md
- GET /payroll-costs/journal/gl-mappings/options | operationId list_payroll_journal_gl_mapping_options | https://developer.everee.com/reference/list-gl-mapping-options.md
- POST /reports/{report-type} | operationId create-report-run-{report-type} | https://developer.everee.com/reference/reports-api-guide.md
- GET /reports/{id} | operationId retrieve-report-run | https://developer.everee.com/reference/retrieve-report-run.md
- GET /deductions/reconciliation | operationId get_deduction_reconciliation | https://developer.everee.com/reference/get-deduction-reconciliation.md
- GET /workers/{id}/payment-history | operationId retrieve-a-workers-pay-history | https://developer.everee.com/reference/retrieve-a-workers-pay-history.md
- GET /workers/files | operationId list-files | https://developer.everee.com/reference/list-files.md
- GET /company-files/tax/{taxYear} | operationId list-company-tax-files | https://developer.everee.com/reference/list-company-tax-files.md

RULES
- Journal lines must balance. If they don't, show the discrepancy instead of posting it.
- Report download links expire. Retrieve the run again for a fresh link instead of storing the link.
- Don't recompute payroll cost. Show Everee's numbers and let finance users export them.
- 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 funding's journal renders balanced and can be exported or posted with my GL mapping.
- A requested report completes via webhook and downloads with a fresh link.

TESTS TO WRITE
- A journal's debits equal its credits, otherwise the screen shows the difference instead of posting it.
- An expired report link is refreshed by retrieving the run again.
- The report.completed webhook triggers the retrieval, and a duplicate event doesn't download twice.
- A GL mapping saved with PUT reads back identically with GET.
- Cost and payment totals on screen equal the API's numbers.

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