Skip to main content

Creating an Order via API

Use the NikoHealth External API to create a new order for an existing patient.

Use the NikoHealth External API to create a new order for an existing patient. You can see every endpoint below in Swagger.


Before You Start: Lookups

What you need

Endpoint

Example ID

Service Location ID

GET /v1/organization/locations

OL3b309d00aceae09bd4544bef2658410e

Referring Provider ID and Location ID

GET /v1/referring-providers

RP01d8eb00863baa596d54c7ab32b5a2d8 / RL01d8eb00863b3ff9aef47dd9f5309dfa

Product ID

GET /v1/products

A05MW34SX96ZF71QT28K

Existing prescription (optional)

GET /v1/patients/{patientId}/prescriptions

PP94adce00ef4bd958ee946025a6fe86a7

Patient diagnoses (optional)

GET /v1/patients/{id}/diagnoses

The Service Location is the location in your organization that the order belongs to. If you have only one location, use the same ID for every order.

The referring provider’s location ID is the PrimaryLocation.Id returned by GET /v1/referring-providers.


Create the Order

POST /v1/patients/{patientId}/orders

Put the patient’s ID in the path of the URL.

Required Fields

Field

Notes

General.ServiceLocationId

From GET /v1/organization/locations

General.StartDate

YYYY-MM-DD

General.Priority

High, Normal, Low or SameDay

General.Delivery.Type

HomeDelivery, InStorePickup, Facility or HospitalDischarge

Common Optional Fields

Field

Notes

General.ReferringProviderId

From GET /v1/referring-providers

General.ReferringProviderLocationId

The referring provider’s location ID

General.ReferralDate

YYYY-MM-DD

General.Items

The products on the order (see below)

General.Delivery.Address / ShipTo

For home deliveries

General.PatientDocumentIds

Attach existing patient documents (numeric IDs)

General.TagIds

From GET /v1/order-tags

General.Description

Free text

Diagnoses

[{ "DiagnosisId": 123 }], from the patient’s diagnoses

General.Products is deprecated. Use General.Items instead.

Items

Field

Notes

Type

Product or Generic

ProductId

Required when Type is Product

GenericHcpcs

Required when Type is Generic

QuantityInBaseUnits

Must be greater than 0. Count is deprecated.

UomId

Optional unit of measure, from GET /v1/uoms

FulfillmentMethod.Method

Optional: Inventory, Manually or DropShip

Notes

Optional, up to 4,000 characters


Prescriptions

⚠️ If you include a referring provider on the order, the Prescription section becomes required. You can either:

  • Reference an existing prescription by passing its Id (from GET /v1/patients/{patientId}/prescriptions), or

  • Create a new prescription by passing the prescription details. It is created along with the order in the same POST.

Prescription Fields

Field

Notes

Id

The existing prescription’s ID, when you’re referencing one

EffectiveDate

The prescription’s effective date, YYYY-MM-DD

TreatingProviderId

The same value as General.ReferringProviderId

TreatingProviderLocationId

The same value as General.ReferringProviderLocationId

Products

The products this prescription covers, with length of need and diagnosis codes

Hcpcs

An alternative to Products: prescribe by 5-character HCPCS code

Prescription Products

Each entry is either a Primitive (a single product) or a Bundle (a parent product with Components).

Field

Notes

ProductId

20 characters, from GET /v1/products

Count

Greater than 0

LengthOfNeed

From 1 to 99

DiagnosisCodes

An array of diagnosis codes

Example: Order With a Referring Provider and a New Prescription

POST /v1/patients/10000105/orders
{
"General": {
"ServiceLocationId": "OL3b309d00aceae09bd4544bef2658410e",
"StartDate": "2026-11-10",
"Priority": "Normal",
"ReferralDate": "2026-11-10",
"ReferringProviderId": "RP01d8eb00863baa596d54c7ab32b5a2d8",
"ReferringProviderLocationId": "RL01d8eb00863b3ff9aef47dd9f5309dfa",
"Delivery": {
"Type": "HomeDelivery",
"ShipTo": "Jane Doe",
"Address": {
"AddressLine": "123 Main St",
"City": "Birmingham",
"State": "AL",
"Zip": "35203"
}
},
"Items": [
{
"Type": "Product",
"ProductId": "A05MW34SX96ZF71QT28K",
"QuantityInBaseUnits": 1
}
]
},
"Prescription": {
"EffectiveDate": "2026-11-10",
"TreatingProviderId": "RP01d8eb00863baa596d54c7ab32b5a2d8",
"TreatingProviderLocationId": "RL01d8eb00863b3ff9aef47dd9f5309dfa",
"Products": [
{
"Primitive": {
"ProductId": "A05MW34SX96ZF71QT28K",
"Count": 1,
"LengthOfNeed": 12,
"DiagnosisCodes": ["Z39.1"]
}
}
]
}
}

Example: Order Referencing an Existing Prescription

{
"General": {
"ServiceLocationId": "OL3b309d00aceae09bd4544bef2658410e",
"StartDate": "2026-11-10",
"Priority": "Normal",
"ReferringProviderId": "RP01d8eb00863baa596d54c7ab32b5a2d8",
"ReferringProviderLocationId": "RL01d8eb00863b3ff9aef47dd9f5309dfa",
"Delivery": { "Type": "HomeDelivery" },
"Items": [
{ "Type": "Product", "ProductId": "A05MW34SX96ZF71QT28K", "QuantityInBaseUnits": 1 }
]
},
"Prescription": {
"Id": "PP94adce00ef4bd958ee946025a6fe86a7",
"TreatingProviderId": "RP01d8eb00863baa596d54c7ab32b5a2d8",
"TreatingProviderLocationId": "RL01d8eb00863b3ff9aef47dd9f5309dfa"
}
}

Response: 201 Created

{ "Id": "SO05adce00ef4b092b90f42f97b2ec3e36" }


Common Errors

Code

Meaning

400

Invalid request, such as a missing required field, a missing prescription when a referring provider is included, or a bad enum value

401

The token is missing, expired or invalid

403

You don’t have permission to access this resource

404

The patient, or a referenced ID, wasn’t found

429

Too many requests

Did this answer your question?