Prescription API
Prescription API Reference
Reference for Prescription API endpoints, scopes, lifecycle transitions, response codes and resource behavior.
Base URL & authentication
Authenticated request
GET /v1/prescriptions HTTP/1.1
Host: api.mediloop.com
Authorization: Bearer $ACCESS_TOKEN
X-Tenant-Id: $TENANT_IDEndpoints
| Method | Endpoint | Purpose | Scope |
|---|---|---|---|
| POST | /prescriptions | Create draft | prescriptions.write |
| GET | /prescriptions | List prescriptions | prescriptions.read |
| GET | /prescriptions/{id} | Get prescription | prescriptions.read |
| PUT | /prescriptions/{id} | Update draft | prescriptions.write |
| POST | /prescriptions/{id}/cancel | Cancel prescription | prescriptions.write |
| POST | /prescriptions/{id}/sign | Sign prescription | prescriptions.sign |
| POST | /prescriptions/{id}/route | Route to pharmacy | prescriptions.route |
| GET | /prescriptions/recurring | Recurring treatments | prescriptions.read |
| GET | /prescriptions/templates | Templates | prescriptions.templates |
| POST | /prescriptions/{id}/dispense | Record dispensation | prescriptions.dispense |
| GET | /prescriptions/audit | Audit history | prescriptions.audit.read |
Scopes
| Scope | Purpose |
|---|---|
| prescriptions.read | Read resources |
| prescriptions.write | Create/update/cancel |
| prescriptions.sign | Digital signature |
| prescriptions.route | Pharmacy routing |
| prescriptions.dispense | Dispensation |
| prescriptions.audit.read | Audit access |
Prescription lifecycle
draftCreated by provider
clinically_validatedClinically validated
signedDigitally signed
routedSent to pharmacy
dispensedDispensed to patient
Status values
| Status | Meaning |
|---|---|
| draft | Created and editable by the prescriber |
| clinically_validated | Clinical checks completed |
| signed | Immutable signed snapshot created |
| routed | Sent to a pharmacy |
| dispensed | Medication dispensation recorded |
| cancelled | Cancelled before completion |
Idempotency
Use idempotency keys for signature, routing, cancellation and dispensation where supported so network retries do not create duplicate business actions.
Response codes
| HTTP | Meaning |
|---|---|
| 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 |