Mediloop
DocsAPIsPrescription APICreate prescription
Prescription API

Create prescription

Create a new electronic prescription for a patient in draft status.

POST/prescriptionsOAuth 2.0prescriptions.write201 Created

Authentication

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

FieldTypeRequiredDescription
patient_iduuidYesPatient identifier
encounter_iduuidNoRelated encounter
itemsarrayYesPrescribed medication items
notesstringNoPrescription note
recurringobjectNoRecurring-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

HTTPDescription
200Request completed successfully
201Resource/action created
400Validation error
401Authentication required
403Insufficient permission or scope
404Prescription not found
409Lifecycle or concurrency conflict
422Unprocessable clinical/request data

Workflow

draft

Created by provider

clinically_validated

Clinically validated

signed

Digitally signed

routed

Sent to pharmacy

dispensed

Dispensed to patient