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

# Testing in Sandbox

> Test lab test ordering in the Junction sandbox environment with lifecycle simulation, pre-configured tests, and collection method restrictions.

To enable customers to simulate the ordering process in the sandbox environment, Junction provides simulated results and a way to transition an order through its [lifecycle](/lab/workflow/lab-test-lifecycle).

## Creating Lab Tests

Every created team comes with 4 standard `Lab Tests` to allow the customer to test all 4 collection modalities:

* **Test Kit**: At-home collection using shipped test kits
* **Walk-in Test**: Patient visits a Patient Service Center (PSC) location
* **At-Home Phlebotomy**: A mobile phlebotomist visits the patient's location
* **On-Site Collection**: Collection at the customer's facility

However, since most customers choose to have their own custom lab tests, you should create your own tests using the [API](/lab/workflow/create-test). This is encouraged, as Junction generates results based on the associated markers. More on this in the [results section](/lab/overview/sandbox#results).

## Lifecycle

When an order is placed in the sandbox environment, it is "stuck" in the `ordered` state and will not progress unless triggered to do so. This can be done through the dashboard or through the [API](/api-reference/lab-testing/simulate-order).

Initiating the simulation process will progress the order through the expected success states defined in the [lifecycle section](/lab/workflow/lab-test-lifecycle), triggering all expected webhooks, emails, and SMS messages.

## Collection Method Restrictions

### At-Home Phlebotomy

<Warning>
  When testing At-Home Phlebotomy appointments, there are only two specific zip codes allowed:

  * **85004** (Phoenix, AZ) - Uses Getlabs provider
    * And only one specific address: `West Lincoln Street, Phoenix, AZ 85004, USA`
  * **54650** - Uses PhlebFinders provider
</Warning>

### Quest PSC Appointments

In the sandbox, Quest appointment slots are generated automatically with these patterns:

**Availability:**

* Same day: Next hour until 5 PM EST (if before 4 PM)
* Future days: 7 AM - 12 PM EST
* 20-minute intervals for all slots

<Warning>
  **Timezone:** All sandbox appointments use `America/New_York` timezone regardless of location (production uses actual PSC timezones).
</Warning>

We have a feature request in our backlog to support more representative sandbox appointment slots, including handling time zones specific to locations. We don't have a timeline for this right now, but if you'd like to be notified when it is implemented, please contact our support team.

## Results

To allow customers to test, Junction generates fake results for each lab test based on the [expected markers](/lab/results/result-formats#expected-results).

The generated JSON results will cycle through all possible [result types](/lab/results/result-formats#resulttype):

* `numeric`: Numerical values with reference ranges
* `comment`: Textual commentary results
* `range`: Range-based results (e.g., "\<50")

<Warning>
  **Important Notes:**

  * Generated values might not match the expected unit
  * **PDF results are not dynamically generated** - Junction returns an example PDF that does not reflect the ordered test
  * Account numbers for shipping labels return a hardcoded value `1234567890` in sandbox
</Warning>

## Customizing the Response

You can customize the end response of the results via the body of the [Simulate Order](/api-reference/lab-testing/simulate-order) endpoint.

There are three avenues of customization currently:

### 1. Interpretation

Supplying the `interpretation` field will set the result's status to the supplied value. If you set it to critical, then the critical result workflow will be triggered.

```json theme={null}
{
  "interpretation": "critical"
}
```

Available interpretations:

* `normal`: Standard normal results (default)
* `abnormal`: Results outside normal ranges
* `critical`: Triggers critical result notifications and workflows

### 2. Result Types

This field controls what result types will be generated. Omitting it will cycle through all available types.

```json theme={null}
{
  "result_types": ["numeric", "comment"]
}
```

Available result types:

* `numeric`: Numerical results with reference ranges
* `comment`: Text-based results and observations
* `range`: Range-based results

### 3. Missing Results

Supplying this field will generate missing biomarkers in the result to simulate incomplete lab processing.

```json theme={null}
{
  "has_missing_results": true
}
```

This simulates scenarios where some biomarkers fail processing or are unavailable, which is common in real-world lab operations.

## Environment-Specific Behavior

### Sandbox vs Production Differences

| Feature              | Sandbox                                      | Production                                |
| -------------------- | -------------------------------------------- | ----------------------------------------- |
| Order Progression    | Manual trigger required                      | Automatic, based on lab processing times. |
| PDF Results          | Static example PDF                           | Dynamic lab-generated PDFs                |
| Account Numbers      | Hardcoded `1234567890`                       | Real lab account numbers                  |
| Phlebotomy Locations | Restricted to specific zip codes             | Full coverage area                        |
| Quest PSC Slots      | Mock slots, `America/New_York` timezone only | Real Quest API integration                |
| Appointment Times    | Restricted availability (see above)          | Based on actual PSC availability          |

## Testing Recommendations

1. **Use Custom Lab Tests**: Create tests with your specific biomarkers for realistic result simulation
2. **Test All Collection Methods**: Verify each modality works with your integration
3. **Test Error Scenarios**: Use missing results and different interpretations
4. **Test Appointment Workflows**: Book, reschedule, and cancel appointments to verify full flow
