developer.prescribenow.ca

Developer Documentation

Integrate your EMR, pharmacy system, or application with PrescribeNow. This guide covers authentication, API keys, and how to send and retrieve prescription data.

API keys & authentication

PrescribeNow supports two authentication methods for integrations:

  1. JWT tokens — For user-initiated actions (e.g. a physician logged into your EMR). Obtain via login, use as Bearer token.
  2. API keys — For machine-to-machine integrations (batch jobs, background sync). Long-lived credentials scoped to your organization.

Who can create API keys?

API keys can be created and revoked by:

  • Platform super admin — For cross-organization or vendor integrations
  • Pharmacy site owner — For pharmacy system integrations
  • Physician/clinic site owner — For EMR or clinic system integrations

Each organization can create multiple API keys. Keys can be named (e.g. "EMR Prod", "Batch Sync") and assigned to either test (sandbox) or production environments. Revoke keys anytime from the PrescribeNow dashboard.

How to get an API key

  1. Log in to PrescribeNow at https://prescribenow.icyrock-2519c9f7.canadacentral.azurecontainerapps.io
  2. Go to Settings → API keys (or ask your platform/tenant admin)
  3. Click Create API key, choose environment (test or production), and optionally add a name
  4. Copy the key immediately — it is shown only once. Store it securely.

Using the key

Send the API key in the Authorization header:

Authorization: Bearer pn_live_xxxxxxxxxxxxxxxxxxxxxxxx

Test vs production

API keys are scoped to either sandbox (test) or production:

  • Sandbox — Use for development and integration testing. Data is isolated and safe to experiment with.
  • Production — Use for live prescriptions. Requires verified organization and active account.

Base URLs are the same; the key itself determines which environment your requests hit.

Message formats

PrescribeNow uses JSON for all API requests and responses. We do not support HL7.

  • JSON (REST) — Primary format. Simple, well-documented, easy to integrate.
  • FHIR R4/R5 — Supported. Submit prescriptions as FHIR MedicationRequest with contained Patient. Invalid messages return FHIR OperationOutcome.

All endpoints use Content-Type: application/json.

Sending data

Submit a prescription in a single call. Include patient data inline — we find existing patients by health card or create new ones automatically. You need the pharmacy ID (from the pharmacy owner's account).

Patient lookup logic

  • Health card provided — We look up by health card. If found, we add the prescription to their record. If not found, we create a new patient.
  • Health card null/blank — Cash-paying patient. We always create a new patient.

1. Create prescription (single call)

Requires a valid JWT (user logged in) or API key. Pharmacy must exist.

POST /rx-api/api/v1/prescriptions
Authorization: Bearer <your-jwt-or-api-key>
Content-Type: application/json

{
  "pharmacy_id": "uuid-of-pharmacy",
  "patient": {
    "first_name": "Jane",
    "last_name": "Doe",
    "date_of_birth": "1985-03-15",
    "gender": "female",
    "address": "123 Main St",
    "province": "ON",
    "postal_code": "M5V 1A1",
    "health_card_number": "1234-567-890-AB",
    "phone": "416-555-1234"
  },
  "drug_name": "Amoxicillin 500mg",
  "drug_code": "DIN-12345678",
  "dosage": "500mg",
  "route": "oral",
  "frequency": "every 8 hours",
  "duration": "7 days",
  "quantity": 21,
  "refills": 0,
  "instructions": "Take with food"
}

For cash-paying patients, omit health_card_number or set it to null.

1b. Create prescription via FHIR (MedicationRequest)

Submit a FHIR R4/R5 MedicationRequest. Patient must be a contained resource. Pass pharmacy_id as a query parameter. Invalid messages return FHIR OperationOutcome.

POST /rx-api/api/v1/fhir/MedicationRequest?pharmacy_id=uuid-of-pharmacy
Authorization: Bearer <your-jwt-or-api-key>
Content-Type: application/fhir+json

{
  "resourceType": "MedicationRequest",
  "status": "active",
  "intent": "order",
  "medicationCodeableConcept": {
    "text": "Amoxicillin 500mg",
    "coding": [{ "code": "DIN-12345678", "display": "Amoxicillin 500mg" }]
  },
  "subject": { "reference": "#patient-1" },
  "contained": [{
    "resourceType": "Patient",
    "id": "patient-1",
    "name": [{ "family": "Doe", "given": ["Jane"] }],
    "birthDate": "1985-03-15",
    "identifier": [{ "system": "http://hl7.org/fhir/sid/ca-ohin", "value": "1234-567-890-AB" }]
  }],
  "dosageInstruction": [{
    "doseAndRate": [{ "doseQuantity": { "value": 500, "unit": "mg" } }],
    "route": { "text": "oral" },
    "timing": { "repeat": { "frequency": 3, "period": 8, "periodUnit": "h" } },
    "patientInstruction": "Take with food"
  }],
  "dispenseRequest": {
    "quantity": { "value": 21, "unit": "tab" },
    "numberOfRepeatsAllowed": 0
  }
}

2. Send prescription to pharmacy

POST /rx-api/api/v1/prescriptions/{id}/send
Authorization: Bearer <your-jwt-or-api-key>

Retrieving data

List prescriptions

GET /rx-api/api/v1/prescriptions
Authorization: Bearer <your-jwt-or-api-key>

Get a single prescription

GET /rx-api/api/v1/prescriptions/{id}
Authorization: Bearer <your-jwt-or-api-key>

Search patients

Search by health card, last name, and/or date of birth. The POST /patients endpoint also exists for standalone patient creation if needed.

GET /rx-api/api/v1/patients/search?health_card=1234-567&last_name=Doe&dob=1985-03-15
Authorization: Bearer <your-jwt-or-api-key>

List pharmacies

GET /rx-api/api/v1/pharmacies
Authorization: Bearer <your-jwt-or-api-key>

Code examples

Login and create a prescription. Select your language:

# 1. Login to get JWT
TOKEN=$(curl -s -X POST https://prescribenow-auth.example.com/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email":"you@clinic.ca","password":"yourpassword"}' \
  | jq -r '.token')

# 2. Create prescription (patient inline; find-or-create by health card)
curl -X POST https://prescribenow-rx.example.com/api/v1/prescriptions \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "pharmacy_id": "uuid-of-pharmacy",
    "patient": {
      "first_name": "Jane",
      "last_name": "Doe",
      "date_of_birth": "1985-03-15",
      "health_card_number": "1234-567-890-AB"
    },
    "drug_name": "Amoxicillin 500mg",
    "dosage": "500mg",
    "quantity": 21,
    "instructions": "Take with food"
  }'

Base URLs

When integrating, use these base URLs (replace with your deployment if self-hosted):

  • Auth: /auth-api/ (login, register, organizations)
  • Prescription: /rx-api/ (prescriptions, patients, pharmacies)

The main app at https://prescribenow.icyrock-2519c9f7.canadacentral.azurecontainerapps.io proxies these under /auth-api/ and /rx-api/. For direct API access, use the service URLs from your deployment.

Ready to integrate?

Create an account and start building.

Create Account →