/api/v1/prescriptions/electronic_prescriptions with either NCPDP SCRIPT XML (application/xml) or a JSON body. In JSON you supply a patient, a prescriber, and either a single medication or an array of medications. Blend then matches the prescription to a patient, a prescriber, and one of your products — you do not have to resolve those links yourself.
A prescription can be sent before or after the patient and the order exist. Blend matches whenever the data is available, so ordering is not a constraint.
Send one prescription
product_code— your own code for the prescription product. Send this orprescription_product_id(the Blend UUID); you don’t need both.units— an NCPDP quantity-unit code, not a word.C48480is Capsule,C48542is Tablet,C28253is Milligram. Pull the full list fromGET /prescriptions/quantity_units, which returns eachcodealongside itstermand definition.patient— reference an existing patient byidorexternal_id, or pass a full new-patient object to create one inline.medications— use the array form when one prescription carries several drugs; each becomes its own prescription in Blend.
Sending SCRIPT XML instead
If you already generate NCPDP SCRIPT, post the raw XML withContent-Type: application/xml. Blend parses <ProductCode>, <DrugDescription>, and <Note> looking for matches against your products’ product_code, sku, id, or name.
Attaching it to an order
An order can be created before or after the prescription. If the order already exists, pass itsid or order_number in the order object. If it doesn’t, create it afterwards with POST /orders and optionally list the prescription in electronic_prescription_ids to help matching along. To do all of it in one request, use the composite endpoint.
Create an electronic prescription
POST /prescriptions/electronic_prescriptions
Get quantity units
Valid NCPDP
units codesGet electronic prescription
Add
include_xml=true for raw SCRIPTComposite creation
Prescription + order in one call