Skip to main content
Use this endpoint to record a medication prescription for a patient. You must provide the patientId, prescriberId, and medication (as a code or coded concept). Optionally specify dosage instructions, refill count, supply duration, and whether substitution is permitted.

Request

POST https://api.clinikapi.com/v1/prescriptions

Headers

x-api-key
string
required
Your ClinikAPI secret key (clk_live_* or clk_test_*).
Content-Type
string
required
Must be application/json.

Body

patientId
string
required
ID of the patient receiving the prescription.
prescriberId
string
required
ID of the prescribing practitioner.
medication
string | object
required
The medication being prescribed. Pass a string shorthand or a full { system, code, display } object (e.g. RxNorm code).
encounterId
string
ID of the associated encounter.
intent
string
Prescription intent. One of: proposal, plan, order, original-order. Defaults to order.
status
string
Prescription status. One of: active, on-hold, cancelled, completed, draft. Defaults to active.
priority
string
Dispensing priority. One of: routine, urgent, asap, stat.
dosageText
string
Free-text dosage instructions (e.g. Take 1 tablet by mouth twice daily with food). Maximum 1000 characters.
dosage
object
Structured dosage details.
refills
integer
Number of authorized refills. Minimum: 0, Maximum: 99.
quantity
object
Total quantity dispensed with value and unit (e.g. { value: 30, unit: "tablets" }).
supplyDays
integer
Days of medication supply.
substitutionAllowed
boolean
Whether generic substitution is permitted.
reason
string
Clinical reason for the prescription. Maximum 500 characters.
note
string
Additional notes. Maximum 2000 characters.

Response

Returns 201 Created with the new prescription resource.
data.id
string
Generated prescription ID.
data.status
string
Prescription status.
data.patientId
string
Patient ID.
data.prescriberId
string
Prescriber ID.
meta
object
Standard response metadata.

Examples

curl

curl -X POST https://api.clinikapi.com/v1/prescriptions \
  -H "x-api-key: clk_live_abc123" \
  -H "Content-Type: application/json" \
  -d '{
    "patientId": "pt_abc123",
    "prescriberId": "prac_xyz789",
    "medication": { "system": "http://www.nlm.nih.gov/research/umls/rxnorm", "code": "1049502", "display": "12 HR Oxycodone" },
    "status": "active",
    "priority": "routine",
    "dosageText": "Take 1 tablet by mouth every 12 hours",
    "dosage": {
      "dose": { "value": 10, "unit": "mg" },
      "frequency": 2,
      "period": 1,
      "periodUnit": "d",
      "route": "oral"
    },
    "refills": 0,
    "quantity": { "value": 30, "unit": "tablets" },
    "supplyDays": 15,
    "substitutionAllowed": false
  }'

TypeScript SDK

import { ClinikAPI } from "@clinikapi/sdk";

const client = new ClinikAPI({ apiKey: "clk_live_abc123" });

const rx = await client.prescriptions.create({
  patientId: "pt_abc123",
  prescriberId: "prac_xyz789",
  medication: { system: "http://www.nlm.nih.gov/research/umls/rxnorm", code: "1049502", display: "12 HR Oxycodone" },
  status: "active",
  dosageText: "Take 1 tablet by mouth every 12 hours",
  dosage: { dose: { value: 10, unit: "mg" }, frequency: 2, period: 1, periodUnit: "d", route: "oral" },
  refills: 0,
  supplyDays: 15,
});

console.log(rx.data.id);