Prescription API
Cancel prescription
Cancel a prescription that is no longer valid or needed.
POST
/prescriptions/{id}/cancelOAuth 2.0prescriptions.write200 OKAuthentication
OAuth 2.0
Required
Permissions
prescriptions.write
Required
Rate limit
300 requests / min
Default
Caching
30 seconds
Recommended
Response
200 OK
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | uuid | Yes | Prescription identifier |
Request headers
| Header | Type | Required | Description |
|---|---|---|---|
| Idempotency-Key | string | No | Prevents duplicate cancellation |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| reason | string | No | Cancellation reason |
| notes | string | No | Additional audit note |
Example request
cURL
curl -X POST "https://api.mediloop.com/v1/prescriptions/presc_456/cancel" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"reason":"Treatment changed"}'Example response
200 OK{
"data": {"id":"presc_456","status":"cancelled"}
}Example response
Responses use stable identifiers and lifecycle status values so clients can safely coordinate clinical and pharmacy workflows.
Errors
| 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