> 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/troubleshooting/common-errors-and-resolutions.md).

# Common Errors & Resolutions

Diagnose frequent API, webhook, pharmacy, and Shopify integration issues.

Use this guide to diagnose recurring integration issues. Before escalating, check the environment, the request ID, and any relevant resource ID — most of the symptoms below trace back to one of those three things.

| Symptom                                                     | Likely cause                                                                               | Resolution                                                                                                             |
| ----------------------------------------------------------- | ------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------- |
| `401 Unauthorized` on API calls                             | The bearer token expired or is missing.                                                    | Re-authenticate with the token endpoint and retry with a fresh token.                                                  |
| `404 Not Found` for a known Patient, Encounter, or Offering | The ID and credential belong to different environments.                                    | Use a credential from the same environment where the ID was created.                                                   |
| `422` when creating or forwarding a message                 | The message targets the wrong channel.                                                     | Create patient messages on the Patient Channel, not a Support or Internal Channel.                                     |
| Prescriptions do not reach a pharmacy in Sandbox            | Sandbox never sends prescriptions to real pharmacies.                                      | Use an approved Live test with a clearly named `TEST` patient.                                                         |
| Webhooks retry repeatedly or arrive more than once          | The endpoint does not return `2xx` quickly, or duplicate events are not handled.           | Return `2xx` immediately, process asynchronously, and make event handling idempotent.                                  |
| Shopify product associations disappeared                    | The app was disconnected, or its API credentials changed. Both clear product associations. | Re-map every product to its intake form and Offering. Treat reconnection and credential changes as disruptive actions. |
| Intake link is missing in Shopify                           | A required app block is absent, or the purchased product lacks an intake-form mapping.     | Add both required app blocks and confirm the product mapping in the Partner Portal.                                    |
| An unapproved patient received a shipment                   | Fulfillment used payment status instead of the MDI order tag.                              | Ship only when the Shopify order tag is `MDI Completed`. Train fulfillment teams on all four tags.                     |

{% hint style="info" %}
When you contact support, include the request ID, environment, expected result, actual result, and relevant resource IDs — that context lets the team reproduce the issue instead of guessing at it. Do not include protected health information.
{% 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/troubleshooting/common-errors-and-resolutions.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.
