> For the complete documentation index, see [llms.txt](https://docs.mdintegrations.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mdintegrations.com/partner/key-concepts/environments.md).

# Environments

MDI provides two separate environments so you can build with confidence and never risk real patients along the way: Sandbox, for building and validating your integration, and Live, which you move to only after approval, once you're ready to serve real patients.

### Sandbox

Sandbox contains test data and supports safe integration testing — nothing you do here touches a real patient or a real pharmacy order.

* Patients, Encounters, and orders are test data.
* Prescriptions are not sent to pharmacies.
* Transactions are not billed.

Use Sandbox for API development, Questionnaire and Voucher flows, webhook delivery, and error scenarios, including denied Encounters and failed identity verification.

See Testing Pharmacy Integration and Testing Webhooks for testing guidance.

### Live

Live is the production environment, and everything in it is real.

* Patient data is real and requires HIPAA-compliant handling.
* Prescriptions are sent to pharmacies for fulfillment.
* Transactions are billable.

{% hint style="warning" %}
Do not run tests, load tests, or exploratory calls in Live unless our team instructs you to. For approved end-to-end tests, clearly mark the Encounter as a test. Live prescriptions reach pharmacies, and Live transactions can affect patients and billing.
{% endhint %}

### Generate credentials

Each environment uses a separate API credential, and you create each one independently in the Partner Portal:

1. Sign in to the Partner Portal.
2. Open **API credentials** and select **Create an API credential**.
3. Choose **Sandbox** or **Live**.
4. Store the credential as a secret.

Use the credential only with its matching environment — see Authentication & Credentials for request authentication.

{% hint style="danger" %}
Never expose API secrets in client-side applications. Use them only from secure back-end services. Exposed credentials can compromise protected data, security, and compliance.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.mdintegrations.com/partner/key-concepts/environments.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
