Prescription API
Route to pharmacy
Route a validated and signed prescription to the patient’s preferred pharmacy.
POST
/prescriptions/{id}/routeOAuth 2.0prescriptions.route202 AcceptedAuthentication
OAuth 2.0
Required
Permissions
prescriptions.route
Required
Rate limit
300 requests / min
Default
Caching
30 seconds
Recommended
Response
202 Accepted
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | uuid | Yes | Prescription identifier |
Request headers
| Header | Type | Required | Description |
|---|---|---|---|
| Idempotency-Key | string | No | Prevents duplicate routing |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| pharmacy_id | uuid | No | Specific destination pharmacy |
| use_default_pharmacy | boolean | No | Use patient default pharmacy |
| notes | string | No | Optional note to pharmacy |
| notify_pharmacy | boolean | No | Send pharmacy notification |
Example request
cURL
curl -X POST "https://api.mediloop.com/v1/prescriptions/presc_456/route" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"pharmacy_id":"pharm_789","notify_pharmacy":true}'Example response
202 Accepted{
"data": {"id":"presc_456","status":"routed","pharmacy_id":"pharm_789"}
}Example response
Responses use stable identifiers and lifecycle status values so clients can safely coordinate clinical and pharmacy workflows.
Responses
| HTTP | Description |
|---|---|
| 200 | Request completed successfully |
| 201 | Resource/action created |
| 400 | Validation error |
| 401 | Authentication required |
| 403 | Insufficient permission or scope |
| 404 | Prescription not found |
| 409 | Lifecycle or concurrency conflict |
| 422 | Unprocessable clinical/request data |
Workflow
draftCreated by provider
clinically_validatedClinically validated
signedDigitally signed
routedSent to pharmacy
dispensedDispensed to patient