Skip to main content

Patient Prescriptions via API

Create, view, update, and delete patient prescriptions so they're on file before you create orders.

Prescriptions can also be created inline when you create an order. See Creating an Order via API. Use this article when you want to manage prescriptions on their own.


Before You Start: Lookups

What you need

Endpoint

Example

Treating provider and location

GET /v1/referring-providers

RP01d8eb00863baa596d54c7ab32b5a2d8 / RL01d8eb00863b3ff9aef47dd9f5309dfa

Product IDs

GET /v1/products

P31SM48ZK95CX72GA60R

Patient's diagnosis codes

GET /v1/patients/{id}/diagnoses

G47.33

The treating provider is a referring provider record in NikoHealth. If they don't exist yet, create them first. See Referring Providers via API.


Create a Prescription

POST /v1/patients/{patientId}/prescriptions

Fields

Field

Required

Notes

EffectiveDate

✅

YYYY-MM-DD

TreatingProviderId

✅

The referring provider's ID

TreatingProviderLocationId

The referring provider's location ID

Products

Prescribe specific products (see below)

Hcpcs

Prescribe by HCPCS code instead of product (see below)

Use Products, Hcpcs, or both.

Prescribing by Product

Each entry in Products is either a Primitive (a single product) or a Bundle (a bundle product and its components).

Primitive field

Required

Notes

ProductId

✅

Exactly 20 characters, from GET /v1/products

Count

✅

Quantity

LengthOfNeed

✅

In months

DiagnosisCodes

ICD-10 codes, with the dot, e.g. G47.33

Description

Free text

Bundle field

Required

Notes

ProductId

✅

The bundle product's ID (20 characters)

Count

✅

Quantity

Components

✅

One Primitive entry per component, each with its own LengthOfNeed

Description

Free text

Prescribing by HCPCS Code

Hcpcs field

Required

Notes

Code

✅

Exactly 5 characters, e.g. E0601

Count

✅

Quantity

LengthOfNeed

✅

In months

DiagnosisCodes

ICD-10 codes

Description

Free text

Example: prescribe a product

POST /v1/patients/10000105/prescriptions
{
"EffectiveDate": "2026-11-10",
"TreatingProviderId": "RP01d8eb00863baa596d54c7ab32b5a2d8",
"TreatingProviderLocationId": "RL01d8eb00863b3ff9aef47dd9f5309dfa",
"Products": [
{
"Primitive": {
"ProductId": "P31SM48ZK95CX72GA60R",
"Count": 1,
"LengthOfNeed": 12,
"DiagnosisCodes": ["G47.33"]
}
}
]
}

Example: prescribe by HCPCS code

{
"EffectiveDate": "2026-11-10",
"TreatingProviderId": "RP01d8eb00863baa596d54c7ab32b5a2d8",
"TreatingProviderLocationId": "RL01d8eb00863b3ff9aef47dd9f5309dfa",
"Hcpcs": [
{
"Code": "E0601",
"Count": 1,
"LengthOfNeed": 99,
"DiagnosisCodes": ["G47.33"]
}
]
}

Response: 201 Created

{ "Id": "PP94adce00ef4bd958ee946025a6fe86a7" }

Use this prescription ID when creating an order (Prescription.Id).


Get a Patient's Prescriptions

GET /v1/patients/{patientId}/prescriptions

Filters

Filter

Notes

status

New, Active, or Expired. Repeat for more than one.

hcpcs

One or more HCPCS codes

effectiveDateFrom / effectiveDateTo

Effective date range

expiryDateFrom / expiryDateTo

Expiry date range

includeArchived

Include archived prescriptions

pageIndex / pageSize

Paging

GET /v1/patients/10000056/prescriptions?status=Active
{
"Count": 1,
"Items": [
{
"Id": "PP0fb7ac00c60b0b2869f4813259744956",
"Hcpcs": ["E1390"],
"Status": "Active",
"Archived": false,
"EffectiveDate": "2026-08-28T00:00:00",
"TreatingProvider": {
"Id": "RP8241cb00160b4e88ee1480cf43ace12c",
"Npi": "1356316996",
"Practice": "Example Sleep Center",
"PhysicianName": { "First": "Jack", "Last": "Johnson", "FullName": "Jack Johnson" },
"Location": {
"Id": "RLd831cb00160b24fa59146a6aadda96c0",
"Address": "123 Main St, Denver, CO 80203"
}
}
}
]
}

💡 Expired prescriptions have Status: "Expired" and an ExpiryDate. Filter by status=Active to find prescriptions you can use for a new order.

Get One Prescription

GET /v1/patients/{patientId}/prescriptions/{id}

Returns the full prescription, including Products (with product details, LengthOfNeed, and DiagnosisCodes), HcpcsCodes, BundleProducts, TreatingProvider, and signature information (SignInfo) when signed.


Update a Prescription

PUT /v1/patients/{patientId}/prescriptions/{id}

Send the full prescription, using the same fields as creating one.

PUT /v1/patients/10000105/prescriptions/PP94adce00ef4bd958ee946025a6fe86a7

Response: 200 OK


Delete a Prescription

DELETE /v1/patients/{patientId}/prescriptions/{id}

Response: 200 OK


Common Errors

Code

Meaning

400

Invalid request, e.g. missing EffectiveDate or TreatingProviderId, a ProductId that isn't 20 characters, or a HCPCS Code that isn't 5 characters

401

Token missing, expired, or invalid

403

You don't have permission to access this resource

404

Patient, prescription, provider, or product not found

429

Too many requests


Related articles

Did this answer your question?