Skip to content
medgridehr.comRequest a Demo

Prescriptions

The object

Field Type Description
id, patientId, prescriberId string
medicationName string
strength, dosageForm string or null
quantity integer
refills integer 0 to 11
daysSupply integer or null
directions string The sig
controlledSchedule II, III, IV, V or null
pharmacyName, notes string or null
status string DRAFT, SUBMITTED, SYNC_ERROR or CANCELLED
externalId string or null Your system’s id, set when SUBMITTED
submittedAt string or null
syncError string or null Set when SYNC_ERROR
fulfillmentStatus string or null RECEIVED, IN_PROGRESS, SHIPPED, FILLED, REJECTED, CANCELLED. Null until the marketplace pharmacy has taken it.
fulfillmentUpdatedAt, trackingNumber, fulfillmentNote Fulfillment details once sent
createdAt, updatedAt string

List GET /api/v1/prescriptions requires read:prescriptions. Query: status, patientId, plus limit, cursor, updatedSince. Returns { "data": [Prescription], "nextCursor": … }.

Retrieve GET /api/v1/prescriptions/{id} returns { "data": Prescription } or 404.

Create POST /api/v1/prescriptions requires write:prescriptions. The prescription is created as a DRAFT.

Body field Required Notes
patientId yes
prescriberId yes From GET /api/v1/prescribers
medicationName yes
quantity yes Integer, 1 or more
directions yes
strength, dosageForm, notes, pharmacyName no
refills no 0 to 11. Default 0.
daysSupply no 1 or more
controlledSchedule no II, III, IV or V
Terminal window
curl -X POST "https://ehr.medgrid.com/api/v1/prescriptions" \
-H "Authorization: Bearer YOUR_SECRET_KEY" -H "Content-Type: application/json" \
-d '{"patientId":"clx…","prescriberId":"clx…","medicationName":"Semaglutide","quantity":1,"directions":"Inject 0.25 mg weekly"}'

Errors: 400 invalid body; 404 patient or prescriber not in your clinic; 422 the prescriber can’t prescribe (no valid NPI, DEA or licensed state, or not licensed in the patient’s state). The message says which. This request has no idempotency key, so before retrying after a timeout, list the patient’s prescriptions to check whether it was created.

Report status PATCH /api/v1/prescriptions/{id} requires write:prescriptions. Tell GridOS what happened on your side:

{ "status": "SUBMITTED", "externalId": "RX-1042" }

SUBMITTED needs externalId; SYNC_ERROR needs syncError. Allowed changes: DRAFT or SYNC_ERROR to SUBMITTED or CANCELLED; SUBMITTED to SYNC_ERROR or CANCELLED. CANCELLED is final. Anything else returns 422.

Was this page helpful?