> 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-api-reference/patients/preferred-pharmacies/return-the-list-of-preferred-pharmacies.md).

# return the list of preferred pharmacies

Returns the patient's enabled preferred pharmacies, sortable by any requested field and order (defaults to most recently updated first).

```json
{"openapi":"3.1.0","info":{"title":"MD Integrations","version":"1.0.0"},"tags":[{"name":"Patients/Preferred Pharmacies"}],"servers":[{"url":"https://api.mdintegrations.dev/v1","description":"Development"}],"security":[{"oauth2":[]}],"components":{"securitySchemes":{"oauth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"https://api.mdintegrations.dev/v1/partner/auth/token","scopes":{"*":"Full partner account access"}}}}},"schemas":{"PatientPreferredPharmacyResource":{"type":"object","properties":{"patient_id":{"type":"string"},"pharmacy_id":{"type":"integer"},"name":{"type":"string"},"address1":{"type":["string","null"]},"address2":{"type":["string","null"]},"city":{"type":["string","null"]},"state":{"type":["string","null"]},"zip_code":{"type":["string","null"]},"primary_phone":{"type":["string","null"]},"primary_phone_type":{"type":["string","null"]},"primary_fax":{"type":["string","null"]},"enabled":{"type":"string"},"id":{"type":"integer","description":"keeping compatibility"},"phone_additional_1":{"type":"null"},"phone_additional_type_1":{"type":"integer"},"phone_additional_2":{"type":"null"},"phone_additional_type_2":{"type":"integer"},"phone_additional_3":{"type":"null"},"phone_additional_type_3":{"type":"integer"},"pharmacy_specialties":{"type":"array","items":{"type":"string"},"minItems":0,"maxItems":0,"additionalItems":false},"service_level":{"type":"null"},"latitude":{"type":"null"},"longitude":{"type":"null"}},"required":["patient_id","pharmacy_id","name","address1","address2","city","state","zip_code","primary_phone","primary_phone_type","primary_fax","enabled","id","phone_additional_1","phone_additional_type_1","phone_additional_2","phone_additional_type_2","phone_additional_3","phone_additional_type_3","pharmacy_specialties","service_level","latitude","longitude"],"title":"PatientPreferredPharmacyResource"}},"responses":{"AuthorizationException":{"description":"Authorization error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error overview."}},"required":["message"]}}}},"ModelNotFoundException":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Error overview."}},"required":["message"]}}}},"ValidationException":{"description":"Validation error","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","description":"Errors overview."},"errors":{"type":"object","description":"A detailed description of each field that failed validation.","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["message","errors"]}}}}}},"paths":{"/partner/patients/{patient}/pharmacies":{"get":{"operationId":"patient.listPatientPreferredPharmacies","description":"Returns the patient's enabled preferred pharmacies, sortable by any requested field and\norder (defaults to most recently updated first).","summary":"return the list of preferred pharmacies","tags":["Patients/Preferred Pharmacies"],"parameters":[{"name":"patient","in":"path","required":true,"description":"The patient ID","schema":{"type":"string"}},{"name":"order","in":"query","schema":{"type":"string","enum":["asc","desc"]}},{"name":"sort","in":"query","schema":{"type":"string","enum":["updated_at","store_name"]}}],"responses":{"200":{"description":"Array of `PatientPreferredPharmacyResource`","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PatientPreferredPharmacyResource"}}}}},"403":{"$ref":"#/components/responses/AuthorizationException"},"404":{"$ref":"#/components/responses/ModelNotFoundException"},"422":{"$ref":"#/components/responses/ValidationException"}}}}}}
```


---

# 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-api-reference/patients/preferred-pharmacies/return-the-list-of-preferred-pharmacies.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.
