Prescription API
Create prescription
Create a new electronic prescription for a patient in draft status.
POST
/prescriptionsOAuth 2.0prescriptions.write201 CreatedAuthentication
OAuth 2.0
Required
Permissions
prescriptions.write
Required
Rate limit
300 requests / min
Default
Caching
No caching
Not applicable
Response
201 Created
New prescriptions are created in
draft status. They can then be clinically validated, signed and routed.Path parameters
Endpoint uses the authenticated context and request body.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| patient_id | uuid | Yes | Patient identifier |
| encounter_id | uuid | No | Related encounter |
| items | array | Yes | Prescribed medication items |
| notes | string | No | Prescription note |
| recurring | object | No | Recurring-treatment configuration |
Example request
cURL
curl -X POST "https://api.mediloop.com/v1/prescriptions" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"patient_id":"pat_123","items":[{"medication_code":"AMOX500","dose":"500mg","frequency":"3x/day"}]}'Example response
201 Created{
"data": {
"id": "presc_456",
"status": "draft",
"patient_id": "pat_123"
}
}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