Sandbox: Advanced Testing

Last updated: September 25, 2026

Finch Sandbox vs. Provider Sandbox: which to use

Start with the Finch Sandbox to test the full range of scenarios, including assisted integrations, and to iterate quickly with controlled data. Use the Provider Sandbox when you need to validate that data flows correctly end-to-end for automated integrations.

You don't need to test specifically against every provider in Finch's network. Finch normalizes data across all providers into a consistent schema, so your application code doesn't change based on which provider an employer uses. Use the Field Support matrix to identify which fields are supported for the providers most relevant to your use case.

Scenario

Finch Sandbox

Provider Sandbox

Assisted integrations (connections and deductions)

✅ Only option

❌ Not supported

Automated integrations

✅

✅

Automated deductions

✅

✅

End-to-end testing

❌

✅

Quickly adding or modifying individuals and payments

✅ Via /sandbox endpoints

❌ Requires changes in the provider UI

Simulating connection status changes (pending, error_reauth)

✅

❌

Testing error handling and job failures

✅

❌

Multi-entity flows

✅ Use multi_entity credential

Depends on provider

Testing large data sets

✅ Via /sandbox endpoints

❌ Limited by provider demo account

Testing large data sets

For guidance on configuring and testing with large numbers of employees or payments, see Testing Large Datasets in the Finch Sandbox.

Recommended Scenarios to Test

Use the /sandbox endpoints to configure specific employment scenarios before making API calls. Always run a refresh data sync after modifying data to see changes reflected in /employer responses.

Test Your Finch Connect Flow

  • Successful connection — does your application correctly receive and store the authorization code, and exchange it for an access token?

  • Reauthentication — when an employer reauthenticates an existing connection, confirm your system stores and uses the new access token. Test this by setting the connection status to error_reauth using Update a sandbox account, then walking through the reconnect flow.

Test specific data scenarios

Build test cases around:

  • Null field values — Finch always returns the fields defined in the schema, but values may be null if a provider doesn't support the field or the employer hasn't populated it. Your application should handle null values without breaking.

  • Reauthentication errors — connections can require reauth when a provider credential expires or changes. Test that your application detects and responds correctly to a 401 with REAUTHENTICATE_USER. The application should then generate a reauth session for that connection and then update your system with the new access_token after the employer completes the reauthentication session.

  • Deductions edge cases — if you're using the Deductions product, test enrollment submissions and validate that your error handling surfaces the right feedback to your team and employers.

  • Rate limits — Finch enforces rate limits per connection. Test that your request patterns stay within bounds and that your application handles 429 responses correctly.

Test Employee Onboarding

  1. Call POST /sandbox/directory to add a new individual. Set employment_status to active.

  2. Run a refresh data sync.

  3. Call /employer/directory to confirm the individual appears.

  4. Call /employer/individual/{individual_id} and /employer/employment/{individual_id} to verify their full record is populated correctly.

Test Employee Offboarding/Termination

  1. Call PUT /sandbox/employment/{individual_id} to update employment_status to inactive and set a termination_date.

  2. Run a refresh data sync.

  3. Call /employer/employment/{individual_id} to confirm the termination is reflected.

  4. Verify your application handles the status change correctly — for example, confirm that deductions enrollment no longer applies to terminated individuals.

Test Payments and Pay Statements

  1. Call POST /sandbox/payment to add a payment. Specify start_date and end_date.

  2. Run a refresh data sync. Confirm the job completes using the jobs endpoint.

  3. Call /employer/payment to confirm the payment appears.

  4. Call /employer/pay-statement with the payment_id to verify pay statement data for each individual.

A sync includes only payments with a pay date inside the connection's sync window: about 3 months before today through 6 months after. POST /sandbox/payment returns a payment_id for a payment created outside the window, but that payment doesn't appear in /employer responses after a sync.

Test Connection Status Changes

Use the Update Sandbox Account endpoint to simulate various connection states:

curl -X PUT "https://api.tryfinch.com/sandbox/connections/accounts" \
  -H "Authorization: Bearer your-access-token" \
  -H "Content-Type: application/json" \
  -d '{
    "connection_status": "error_reauth"
  }'
  • If a connection shows as reauth in the Finch Sandbox, use this endpoint to update the status to connected for continued testing

  • For all assisted integrations in sandbox, you are required to call this endpoint to set the status to connected. This replicates how assisted integrations in production must be manually set up by Finch after the initial connection is created

Testing logic that spans multiple pay statements

For logic that depends on a history of pay statements, such as year-to-date totals, annual contribution limits, or eligibility thresholds, create a small set of payments in the Finch Sandbox, save the responses, and build the rest of your scenarios as fixtures in your own test suite. Configuring every scenario as live sandbox data takes longer and runs into sandbox constraints.

Why fixtures work better for multi-pay-statement logic

  • Sandbox pay history is generated once, when the connection is created. New payrolls don't accrue over time; you add each one with POST /sandbox/payment.

  • A sync includes only payments with a pay date inside the connection's sync window, about 3 months back through 6 months ahead. Backdated payments can't build up a full year of history.

  • Each sandbox scenario requires a create, refresh sync, and read cycle. Fixtures run in seconds and return the same result on every run.

How to build fixtures from sandbox data

  1. Call POST /sandbox/payment to create 2–3 payments that include the earnings, employee_deductions, and employer_contributions types your logic reads. Set end_date (the pay date) inside the sync window.

  2. Run a refresh data sync.

  3. Call /employer/payment and /employer/pay-statement and save the raw JSON responses.

  4. In your test suite, copy and edit those responses to build each scenario: change amounts, pay dates, the number of pay statements, or deduction types.

  5. Keep one end-to-end test against the Finch Sandbox that runs the full flow, so you confirm your code reads the live response shape.

Example use cases for pay statement fixtures

Use case

Capture from the sandbox

Fixture scenarios to build

Annual contribution limits (401(k), HSA, FSA)

Pay statements with the relevant employee_deductions and employer_contributions types

Year-to-date totals just under, at, and over the limit; employee-only, employer-only, and combined contributions; several line items of the same type on one pay statement

Year-to-date wages and taxes

earnings and taxes by type

Mid-year hire or termination, off-cycle and bonus payments, pay statements with zero earnings

Hours-based eligibility (ACA, retirement plan eligibility)

total_hours and earnings hours

Crossing the hours threshold mid-year, variable hours, missing hours

Deduction amounts compared to enrollment

Pay statements for an individual enrolled in a benefit

Withheld amount matches, differs from, or is missing compared to the enrolled amount

Null and missing values

Pay statements from the providers most relevant to your use case

null amounts, missing type values, empty deduction arrays

Amounts are in cents. Check the Field Support matrix for the providers relevant to your use case, and set fields to null in your fixtures where those providers don't return them.

Data Synchronization Requirements

Critical Step: Refresh Data Sync

Sandbox connections function just like production connections in that a sync is required in order for data updates to be reflected by Finch's /employer API endpoints. However, the data syncs do not run automatically every 24 hours in the Sandbox.

After adding or updating any data, always call the Refresh Job endpoint:

curl -X POST "https://api.tryfinch.com/sandbox/jobs" \
  -H "Authorization: Bearer your-access-token" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "data_sync_all"
  }'