> 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/cases/prescriptions/creates-a-prescription-to-a-case.md).

# Creates a prescription to a case

Creates a new prescription on the case, resolving the referenced medication, compound, supply, or offering and attaching any diseases and tags associated with it. Depending on the case's status and the prescription's insurance requirements, this can flag the case for additional approval, tag it for a DoseSpot prior-authorization flow, and queue pharmacy-preference and benefits-check events.

```json
{"openapi":"3.1.0","info":{"title":"MD Integrations","version":"1.0.0"},"tags":[{"name":"Cases/Prescriptions"}],"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":{"PostCasePrescriptionRequest":{"type":"object","properties":{"refills":{"type":"integer","maximum":99},"days_supply":{"type":["integer","null"],"maximum":365},"quantity":{"type":"number","minimum":0,"maximum":9999999999},"directions":{"type":"string","maxLength":1000},"dispense_unit_id":{"type":"integer"},"pharmacy_id":{"type":["integer","null"]},"dosespot_medication_id":{"type":"integer"},"partner_medication_id":{"type":"string","format":"uuid"},"partner_supply_id":{"type":"string","format":"uuid"},"partner_compound_id":{"type":"string","format":"uuid"},"offering_id":{"type":"string","format":"uuid"},"dosespot_supply_ndc":{"type":"string"},"pharmacy_notes":{"type":["string","null"],"maxLength":210},"no_substitutions":{"type":"boolean"},"is_additional_approval_needed":{"type":["boolean","null"]},"order":{"type":["integer","null"],"minimum":1}},"title":"PostCasePrescriptionRequest"},"CasePrescriptionResource":{"type":"object","properties":{"id":{"type":"string"},"case_prescription_id":{"type":"string"},"order":{"type":["integer","null"]},"title":{"type":["string","null"]},"name":{"type":["string","null"]},"is_important":{"type":["string","null"]},"refills":{"type":["integer","null"]},"quantity":{"type":["string","null"]},"days_supply":{"type":["string","null"]},"directions":{"type":["string","null"]},"dispense_unit_id":{"type":["string","null"]},"is_additional_approval_needed":{"type":"string"},"dispense_unit_name":{"type":["string","null"]},"pharmacy_id":{"anyOf":[{"type":"string"},{"type":"integer"},{"type":"null"}]},"pharmacy_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"thank_you_note":{"type":["string","null"]},"thank_you_files":{"type":"array","items":{"$ref":"#/components/schemas/App.Http.Resources.FileResource"}},"clinical_note":{"type":["string","null"]},"dosespot_prescription_id":{"type":["integer","null"]},"status":{"type":"string"},"effective_date":{"type":["string","null"]},"status_details":{"type":["string","null"]},"upcharged":{"type":["string","null"]},"clinician_extra_fee":{"type":["string","null"]},"pharmacy_notes":{"type":["string","null"]},"no_substitutions":{"type":"boolean"},"dosespot_display_name":{"type":"string"},"offering_cost":{"type":["string","null"]},"is_insurance_check_needed":{"type":["string","null"]},"dosespot_prescription_benefits":{"type":"string"},"dosespot_prior_auth_id":{"type":"string"},"dosespot_prior_auth_status":{"type":"string"},"dosespot_prior_auth_status_details":{"type":"string"},"dosespot_prior_auth_status_at":{"type":"string"},"dosespot_prior_auth_details":{"type":"string"},"medication":{"type":["string","null"]},"partner_compound":{"type":["array","null"],"items":{}},"partner_supply":{"type":["object","null"],"properties":{"ndc":{"type":["string","null"]},"name":{"type":["string","null"]},"active":{"type":["string","null"]},"refills":{"type":["string","null"]},"metadata":{"type":["string","null"]},"quantity":{"type":["string","null"]},"directions":{"type":["string","null"]},"days_supply":{"type":["string","null"]},"pharmacy_id":{"type":["string","null"]},"clinical_note":{"type":["string","null"]},"dispense_unit":{"type":["string","null"]},"pharmacy_name":{"anyOf":[{"type":"string"},{"type":"null"}]},"pharmacy_notes":{"type":["string","null"]},"thank_you_note":{"type":["string","null"]},"dispense_unit_id":{"type":["string","null"]},"partner_supply_id":{"type":["string","null"]},"dosespot_supply_id":{"type":["string","null"]}},"required":["ndc","name","active","refills","metadata","quantity","directions","days_supply","pharmacy_id","clinical_note","dispense_unit","pharmacy_name","pharmacy_notes","thank_you_note","dispense_unit_id","partner_supply_id","dosespot_supply_id"]},"offering":{"type":["object","null"],"properties":{"offering_id":{"type":["string","null"]},"name":{"type":["string","null"]},"title":{"type":["string","null"]}},"required":["offering_id","name","title"]},"offerable_type":{"type":["string","null"]},"offerable_id":{"type":["string","null"]},"diseases":{"type":"array","items":{"$ref":"#/components/schemas/App.Http.Resources.V1.DiseaseResource"}}},"required":["id","case_prescription_id","order","title","name","is_important","refills","quantity","days_supply","directions","dispense_unit_id","is_additional_approval_needed","dispense_unit_name","pharmacy_id","pharmacy_name","thank_you_note","thank_you_files","clinical_note","dosespot_prescription_id","status","effective_date","status_details","upcharged","clinician_extra_fee","pharmacy_notes","no_substitutions","dosespot_display_name","offering_cost","is_insurance_check_needed","dosespot_prescription_benefits","dosespot_prior_auth_id","dosespot_prior_auth_status","dosespot_prior_auth_status_details","dosespot_prior_auth_status_at","dosespot_prior_auth_details","medication","partner_compound","partner_supply","offering","offerable_type","offerable_id","diseases"],"title":"CasePrescriptionResource"},"App.Http.Resources.FileResource":{"type":"object","properties":{"id":{"type":"string","description":"Attributes;"},"name":{"type":"string"},"type":{"type":["string","null"]},"mime_type":{"type":"string"},"path":{"type":"string"},"metadata":{"type":["array","null"],"items":{}},"created_at":{"type":["string","null"],"format":"date-time"},"updated_at":{"type":["string","null"],"format":"date-time"},"deleted_at":{"type":["string","null"],"format":"date-time"},"url":{"type":"string","description":"Appended Attributes;"},"url_thumbnail":{"type":"string"},"pivot":{"type":"object","description":"Pivot Attributes (Partner);","properties":{"file_id":{"type":"string","description":"When loaded;"},"partner_id":{"type":"string"},"title":{"type":"string"},"type":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["file_id","partner_id","title","type","created_at","updated_at"]},"file_id":{"type":"string","description":"Keep compatibility;"}},"required":["id","name","type","mime_type","path","metadata","created_at","updated_at","deleted_at","url","url_thumbnail","file_id"],"title":"App.Http.Resources.FileResource"},"App.Http.Resources.V1.DiseaseResource":{"type":"object","properties":{"disease_id":{"type":"string"},"icd":{"type":"string"},"description":{"type":"string"},"is_primary":{"type":"string"}},"required":["disease_id","icd","description"],"title":"App.Http.Resources.V1.DiseaseResource"}},"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/cases/{case}/prescriptions":{"post":{"operationId":"v1.partners-app.cases.prescriptions.post","description":"Creates a new prescription on the case, resolving the referenced medication, compound,\nsupply, or offering and attaching any diseases and tags associated with it. Depending\non the case's status and the prescription's insurance requirements, this can flag the\ncase for additional approval, tag it for a DoseSpot prior-authorization flow, and\nqueue pharmacy-preference and benefits-check events.","summary":"Creates a prescription to a case","tags":["Cases/Prescriptions"],"parameters":[{"name":"case","in":"path","required":true,"description":"The case ID","schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostCasePrescriptionRequest"}}}},"responses":{"200":{"description":"Array of `CasePrescriptionResource`","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CasePrescriptionResource"}}}}},"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/cases/prescriptions/creates-a-prescription-to-a-case.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.
