> 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/pharmacy-fulfillment/testing-your-pharmacy-integration.md).

# Testing Your Pharmacy Integration

Run this test to confirm that a real prescription actually reaches your pharmacy, and do it before you rely on a Live pharmacy workflow in production.

### Use Live only for pharmacy delivery

Sandbox is the right environment for everything else — API testing, intake flows, webhook behavior — since Sandbox prescriptions never actually reach a pharmacy.

Reach for a Live credential only when you specifically need to verify real pharmacy delivery, and keep in mind that Live credentials are issued to approved partners only.

{% hint style="warning" %}
Live tests involve a real physician review and prescription routing. Create a clearly labeled test record and add a chart note before the Encounter is reviewed.
{% endhint %}

{% hint style="info" %}
Pharmacy connections can route through different underlying mechanisms — electronic transmission over the Surescripts network for pharmacies that support it, or a PDF-based prescription for pharmacies that don't. Confirm with MDI which one applies to your pharmacy. If you connect to multiple pharmacies, test each one independently, since delivery behavior can differ per pharmacy.
{% endhint %}

See [Environments](/partner/key-concepts/environments.md) for environment boundaries.

### Run a pharmacy test

{% stepper %}
{% step %}

#### Confirm Live readiness

Make sure you have a Live credential and a valid Offering configured under your Live account. If you don't have a Live credential yet, contact MDI to arrange the test.
{% endstep %}

{% step %}

#### Create a labeled test Patient

Create a new Patient with `TEST` in their name, so the record is clearly identifiable to your team, the reviewing physician, and any downstream pharmacy staff. Also set the `is_test` flag to true, which ensures the Encounter is configured correctly as a test.
{% endstep %}

{% step %}

#### Create the test Encounter

Create an Encounter for that test Patient, using the Offering you configured for Live testing.
{% endstep %}

{% step %}

#### Add a chart note

Add a chart note telling the physician this is a test, and state exactly what action you need from them — whether that's approving the prescription for transmission or rejecting it so you can test that path instead.
{% endstep %}

{% step %}

#### Verify the pharmacy workflow

Once the physician approves, confirm the prescription actually reaches the pharmacy and follows the fulfillment path you expected.
{% endstep %}
{% endstepper %}

### Verify the outcome

Check the items that apply to your fulfillment model:

* The pharmacy received the prescription correctly.
* Your team submitted the required commercial order, if applicable.
* Webhooks updated your order records and shipment status.
* Refill and tracking workflows operate as expected.

MDI notifies your team once the test is ready for follow-up on their end.


---

# 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/pharmacy-fulfillment/testing-your-pharmacy-integration.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.
