> 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/offerings/general/returns-a-list-of-compounds-matching-a-specified-query-belonging-to-a-given-partner-id-in-case-a-que.md).

Returns a list of compounds matching a specified query belonging to a given partner ID.\
In case a query is not provided, then returns all the available compounds for a given partner
=============================================================================================

When a patient\_id is included in the request, the patient is validated as belonging to the authenticated partner and the search is scoped accordingly.

```json
{"openapi":"3.1.0","info":{"title":"MD Integrations","version":"1.0.0"},"tags":[{"name":"Offerings/General"}],"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":{"PartnerCompoundResource":{"type":"object","properties":{"title":{"type":["string","null"]},"name":{"type":"string"},"partner_compound_id":{"type":"string"},"allow_substitutions":{"type":"string"},"refills":{"type":"string"},"dispense_unit_id":{"type":"string"},"is_additional_approval_needed":{"type":"string"},"dispense_unit":{"type":"string"},"pharmacy_id":{"type":"string"},"pharmacy_name":{"type":"string"},"days_supply":{"type":"string"},"pharmacy_notes":{"type":"string"},"order":{"type":"string"},"metadata":{"type":["string","null"]},"thank_you_note":{"type":["string","null"]},"clinical_note":{"type":["string","null"]},"directions":{"type":"string"},"quantity":{"type":"string"},"active":{"type":"string"},"effective_date":{"type":"string"},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"},"is_controlled_substance":{"anyOf":[{"type":"string"},{"type":"boolean"}]},"schedule":{"anyOf":[{"type":"string"},{"type":"integer","enum":[0]}]}},"required":["title","name","partner_compound_id","allow_substitutions","refills","dispense_unit_id","is_additional_approval_needed","dispense_unit","pharmacy_id","pharmacy_name","days_supply","pharmacy_notes","order","metadata","thank_you_note","clinical_note","directions","quantity","active","effective_date","created_at","updated_at","is_controlled_substance","schedule"],"title":"PartnerCompoundResource"}},"responses":{"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/compounds/search":{"get":{"operationId":"v1.partners.compounds.search.get","description":"When a patient_id is included in the request, the patient is validated as belonging to\nthe authenticated partner and the search is scoped accordingly.","summary":"Returns a list of compounds matching a specified query belonging to a given partner ID.\nIn case a query is not provided, then returns all the available compounds for a given partner","tags":["Offerings/General"],"parameters":[{"name":"name","in":"query","schema":{"type":["string","null"],"maxLength":105}},{"name":"patient_id","in":"query","schema":{"type":["string","null"],"format":"uuid"}}],"responses":{"200":{"description":"Array of `PartnerCompoundResource`","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PartnerCompoundResource"}}}}},"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/offerings/general/returns-a-list-of-compounds-matching-a-specified-query-belonging-to-a-given-partner-id-in-case-a-que.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.
