> ## Documentation Index
> Fetch the complete documentation index at: https://getprescience.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Environments

> Test and live are two isolated environments behind one base URL. Learn what runs in each.

The Partner API provides two environments: **test mode** for development and integration testing, and **live mode** for real employer groups. Both run the same code paths: the same rating engine, the same validations, the same webhooks, the same onboarding state machine. The only things that never happen in test mode are the real-world ones: outbound email, production activation, and money movement.

Unlike platforms that separate environments by base URL, the Partner API derives the environment from your API key.

## How environments work

* **The environment comes from the key.** `psk_test_` keys operate in test mode, `psk_live_` keys in live mode. Same base URL, same endpoints, same payload shapes.
* **Every resource is stamped with its environment.** Each group, quote, and enrollment carries `"mode": "test"` or `"mode": "live"`.
* **Environments are fully isolated.** Test keys only see test resources; live keys only see live resources. There is no cross-mode read and no "promote to live". When you go live, you recreate real employers with your live key.

## Test mode vs live mode

| Behavior                        | Test mode                                                | Live mode                                               |
| ------------------------------- | -------------------------------------------------------- | ------------------------------------------------------- |
| Rating engine                   | Same deterministic engine                                | Same deterministic engine                               |
| Quotes                          | Real numbers from your census                            | Real numbers from your census                           |
| Enrollments                     | Fully working sandbox company, flagged `test: true`      | Sandbox company, then onboarding to `prod`              |
| Onboarding pipeline             | Runs (sandbox state)                                     | Runs, completed with the employer                       |
| Employer portal provisioning    | Account provisioned, no email (`inviteSuppressed: true`) | Account provisioned, set-password invite emailed        |
| Outbound email                  | Never sent                                               | Sent (portal invites, member invitations at activation) |
| Webhooks                        | Delivered and signed, `"mode": "test"`                   | Delivered and signed, `"mode": "live"`                  |
| Activation (`sandbox` → `prod`) | Never; test companies stay sandboxed                     | By Prescience, after onboarding                         |
| Money movement                  | None                                                     | None until Prescience flips the company to `prod`       |

<Note>
  **No money moves in either environment until Prescience activates the company.** Activation (`sandbox` → `prod`) is a manual gate on our side, after the employer completes onboarding. Test companies are never activated. You cannot trigger a funding pull by accident; there is no API for it.
</Note>

## Deterministic quotes

The rating engine is a pure function of the census, the plan year start date, and the rate card. The same inputs always produce the same cents, in test and in live. That means you can:

* **Snapshot-test your integration.** The quote in the [quickstart](/quickstart) (`monthly.totalCents: 660096`) will reproduce exactly from the same census.
* **Build pricing UI against real numbers.** No mock data drift between your test fixtures and production behavior.
* **Re-quote freely.** Quoting has no side effects beyond writing the quote record. Rate limit: 60 quote creates per hour.

The [quotes guide](/guides/quotes) documents quote inputs, response fields, expiry, and in-review handling.

## Test the full lifecycle

A complete test-mode pass looks like:

1. `POST /groups` → `PUT /census` → `POST /quotes`: verify your quote handling and plan-selection UI.
2. `POST /enrollments`: verify your selection flow, the `employerPortal` response (`inviteSuppressed: true` in test mode), and the `enrollment.created` webhook.
3. `GET /account` + `GET /members`: build the benefits tab against the sandbox company.
4. `PUT /webhook` + `POST /webhook/test`: verify signatures end to end.
5. New hire and termination calls: verify [census sync](/guides/census-sync).

When that loop is green, going live is a key swap plus the [compliance checklist](/resources/compliance). The code does not change.
