curl --request POST \
--url https://api.byblend.com/api/v1/prescriptions/electronic_prescriptions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"medication": {
"days_supply": 30,
"drug_name": "Levothyroxine",
"prescription_product_id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
"product_code": "HC-RAPA31",
"quantity": 30,
"refills": 4,
"sig": "<string>",
"units": "C48480",
"written_at": "2025-04-25T00:00:00",
"description": "<string>",
"ndc": "12345678901",
"notes": "<string>",
"substitution_allowed": true
},
"medications": [
{
"days_supply": 30,
"drug_name": "Levothyroxine",
"prescription_product_id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
"product_code": "HC-RAPA31",
"quantity": 30,
"refills": 4,
"sig": "<string>",
"units": "C48480",
"written_at": "2025-04-25T00:00:00",
"description": "<string>",
"ndc": "12345678901",
"notes": "<string>",
"substitution_allowed": true
}
],
"patient": {
"first_name": "Willard",
"last_name": "Donnelly",
"email": "Harmon43@gmail.com",
"phone": "6417383445",
"date_of_birth": "1990-01-01",
"address": {
"address_1": "140 Lindgren Streets",
"city": "North Consueloburgh",
"state": "CA",
"zip_code": "02108",
"address_2": "Apt 227",
"country": "US"
},
"middle_name": "Moises",
"gender": "male",
"driver_license_number": "B49188319",
"driver_license_state": "CA",
"ssn": "123456789",
"primary_language": "en",
"guardian_name": "John Guardian",
"guardian_phone": "6417383445",
"guardian_email": "parent@example.com",
"guardian_relationship": "parent",
"height_inches": 72,
"weight_pounds": 180,
"external_id": "1234567890",
"is_smoker": false,
"is_diabetic": false,
"is_pregnant": false,
"receive_sms": true,
"receive_email": true,
"risk_factors": {
"allergies": "peanuts, tree nuts, shellfish",
"conditions": "asthma, hypertension",
"medications": "albuterol, levothyroxine"
}
},
"prescriber": {
"id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708"
},
"order": {
"id": "<string>",
"order_number": "<string>"
}
}
'import requests
url = "https://api.byblend.com/api/v1/prescriptions/electronic_prescriptions"
payload = {
"medication": {
"days_supply": 30,
"drug_name": "Levothyroxine",
"prescription_product_id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
"product_code": "HC-RAPA31",
"quantity": 30,
"refills": 4,
"sig": "<string>",
"units": "C48480",
"written_at": "2025-04-25T00:00:00",
"description": "<string>",
"ndc": "12345678901",
"notes": "<string>",
"substitution_allowed": True
},
"medications": [
{
"days_supply": 30,
"drug_name": "Levothyroxine",
"prescription_product_id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
"product_code": "HC-RAPA31",
"quantity": 30,
"refills": 4,
"sig": "<string>",
"units": "C48480",
"written_at": "2025-04-25T00:00:00",
"description": "<string>",
"ndc": "12345678901",
"notes": "<string>",
"substitution_allowed": True
}
],
"patient": {
"first_name": "Willard",
"last_name": "Donnelly",
"email": "Harmon43@gmail.com",
"phone": "6417383445",
"date_of_birth": "1990-01-01",
"address": {
"address_1": "140 Lindgren Streets",
"city": "North Consueloburgh",
"state": "CA",
"zip_code": "02108",
"address_2": "Apt 227",
"country": "US"
},
"middle_name": "Moises",
"gender": "male",
"driver_license_number": "B49188319",
"driver_license_state": "CA",
"ssn": "123456789",
"primary_language": "en",
"guardian_name": "John Guardian",
"guardian_phone": "6417383445",
"guardian_email": "parent@example.com",
"guardian_relationship": "parent",
"height_inches": 72,
"weight_pounds": 180,
"external_id": "1234567890",
"is_smoker": False,
"is_diabetic": False,
"is_pregnant": False,
"receive_sms": True,
"receive_email": True,
"risk_factors": {
"allergies": "peanuts, tree nuts, shellfish",
"conditions": "asthma, hypertension",
"medications": "albuterol, levothyroxine"
}
},
"prescriber": { "id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708" },
"order": {
"id": "<string>",
"order_number": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
medication: {
days_supply: 30,
drug_name: 'Levothyroxine',
prescription_product_id: '0227d1e5-ba9a-42b5-8fe2-38882aa65708',
product_code: 'HC-RAPA31',
quantity: 30,
refills: 4,
sig: '<string>',
units: 'C48480',
written_at: '2025-04-25T00:00:00',
description: '<string>',
ndc: '12345678901',
notes: '<string>',
substitution_allowed: true
},
medications: [
{
days_supply: 30,
drug_name: 'Levothyroxine',
prescription_product_id: '0227d1e5-ba9a-42b5-8fe2-38882aa65708',
product_code: 'HC-RAPA31',
quantity: 30,
refills: 4,
sig: '<string>',
units: 'C48480',
written_at: '2025-04-25T00:00:00',
description: '<string>',
ndc: '12345678901',
notes: '<string>',
substitution_allowed: true
}
],
patient: {
first_name: 'Willard',
last_name: 'Donnelly',
email: 'Harmon43@gmail.com',
phone: '6417383445',
date_of_birth: '1990-01-01',
address: {
address_1: '140 Lindgren Streets',
city: 'North Consueloburgh',
state: 'CA',
zip_code: '02108',
address_2: 'Apt 227',
country: 'US'
},
middle_name: 'Moises',
gender: 'male',
driver_license_number: 'B49188319',
driver_license_state: 'CA',
ssn: '123456789',
primary_language: 'en',
guardian_name: 'John Guardian',
guardian_phone: '6417383445',
guardian_email: 'parent@example.com',
guardian_relationship: 'parent',
height_inches: 72,
weight_pounds: 180,
external_id: '1234567890',
is_smoker: false,
is_diabetic: false,
is_pregnant: false,
receive_sms: true,
receive_email: true,
risk_factors: {
allergies: 'peanuts, tree nuts, shellfish',
conditions: 'asthma, hypertension',
medications: 'albuterol, levothyroxine'
}
},
prescriber: {id: '0227d1e5-ba9a-42b5-8fe2-38882aa65708'},
order: {id: '<string>', order_number: '<string>'}
})
};
fetch('https://api.byblend.com/api/v1/prescriptions/electronic_prescriptions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.byblend.com/api/v1/prescriptions/electronic_prescriptions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'medication' => [
'days_supply' => 30,
'drug_name' => 'Levothyroxine',
'prescription_product_id' => '0227d1e5-ba9a-42b5-8fe2-38882aa65708',
'product_code' => 'HC-RAPA31',
'quantity' => 30,
'refills' => 4,
'sig' => '<string>',
'units' => 'C48480',
'written_at' => '2025-04-25T00:00:00',
'description' => '<string>',
'ndc' => '12345678901',
'notes' => '<string>',
'substitution_allowed' => true
],
'medications' => [
[
'days_supply' => 30,
'drug_name' => 'Levothyroxine',
'prescription_product_id' => '0227d1e5-ba9a-42b5-8fe2-38882aa65708',
'product_code' => 'HC-RAPA31',
'quantity' => 30,
'refills' => 4,
'sig' => '<string>',
'units' => 'C48480',
'written_at' => '2025-04-25T00:00:00',
'description' => '<string>',
'ndc' => '12345678901',
'notes' => '<string>',
'substitution_allowed' => true
]
],
'patient' => [
'first_name' => 'Willard',
'last_name' => 'Donnelly',
'email' => 'Harmon43@gmail.com',
'phone' => '6417383445',
'date_of_birth' => '1990-01-01',
'address' => [
'address_1' => '140 Lindgren Streets',
'city' => 'North Consueloburgh',
'state' => 'CA',
'zip_code' => '02108',
'address_2' => 'Apt 227',
'country' => 'US'
],
'middle_name' => 'Moises',
'gender' => 'male',
'driver_license_number' => 'B49188319',
'driver_license_state' => 'CA',
'ssn' => '123456789',
'primary_language' => 'en',
'guardian_name' => 'John Guardian',
'guardian_phone' => '6417383445',
'guardian_email' => 'parent@example.com',
'guardian_relationship' => 'parent',
'height_inches' => 72,
'weight_pounds' => 180,
'external_id' => '1234567890',
'is_smoker' => false,
'is_diabetic' => false,
'is_pregnant' => false,
'receive_sms' => true,
'receive_email' => true,
'risk_factors' => [
'allergies' => 'peanuts, tree nuts, shellfish',
'conditions' => 'asthma, hypertension',
'medications' => 'albuterol, levothyroxine'
]
],
'prescriber' => [
'id' => '0227d1e5-ba9a-42b5-8fe2-38882aa65708'
],
'order' => [
'id' => '<string>',
'order_number' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.byblend.com/api/v1/prescriptions/electronic_prescriptions"
payload := strings.NewReader("{\n \"medication\": {\n \"days_supply\": 30,\n \"drug_name\": \"Levothyroxine\",\n \"prescription_product_id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\",\n \"product_code\": \"HC-RAPA31\",\n \"quantity\": 30,\n \"refills\": 4,\n \"sig\": \"<string>\",\n \"units\": \"C48480\",\n \"written_at\": \"2025-04-25T00:00:00\",\n \"description\": \"<string>\",\n \"ndc\": \"12345678901\",\n \"notes\": \"<string>\",\n \"substitution_allowed\": true\n },\n \"medications\": [\n {\n \"days_supply\": 30,\n \"drug_name\": \"Levothyroxine\",\n \"prescription_product_id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\",\n \"product_code\": \"HC-RAPA31\",\n \"quantity\": 30,\n \"refills\": 4,\n \"sig\": \"<string>\",\n \"units\": \"C48480\",\n \"written_at\": \"2025-04-25T00:00:00\",\n \"description\": \"<string>\",\n \"ndc\": \"12345678901\",\n \"notes\": \"<string>\",\n \"substitution_allowed\": true\n }\n ],\n \"patient\": {\n \"first_name\": \"Willard\",\n \"last_name\": \"Donnelly\",\n \"email\": \"Harmon43@gmail.com\",\n \"phone\": \"6417383445\",\n \"date_of_birth\": \"1990-01-01\",\n \"address\": {\n \"address_1\": \"140 Lindgren Streets\",\n \"city\": \"North Consueloburgh\",\n \"state\": \"CA\",\n \"zip_code\": \"02108\",\n \"address_2\": \"Apt 227\",\n \"country\": \"US\"\n },\n \"middle_name\": \"Moises\",\n \"gender\": \"male\",\n \"driver_license_number\": \"B49188319\",\n \"driver_license_state\": \"CA\",\n \"ssn\": \"123456789\",\n \"primary_language\": \"en\",\n \"guardian_name\": \"John Guardian\",\n \"guardian_phone\": \"6417383445\",\n \"guardian_email\": \"parent@example.com\",\n \"guardian_relationship\": \"parent\",\n \"height_inches\": 72,\n \"weight_pounds\": 180,\n \"external_id\": \"1234567890\",\n \"is_smoker\": false,\n \"is_diabetic\": false,\n \"is_pregnant\": false,\n \"receive_sms\": true,\n \"receive_email\": true,\n \"risk_factors\": {\n \"allergies\": \"peanuts, tree nuts, shellfish\",\n \"conditions\": \"asthma, hypertension\",\n \"medications\": \"albuterol, levothyroxine\"\n }\n },\n \"prescriber\": {\n \"id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\"\n },\n \"order\": {\n \"id\": \"<string>\",\n \"order_number\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.byblend.com/api/v1/prescriptions/electronic_prescriptions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"medication\": {\n \"days_supply\": 30,\n \"drug_name\": \"Levothyroxine\",\n \"prescription_product_id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\",\n \"product_code\": \"HC-RAPA31\",\n \"quantity\": 30,\n \"refills\": 4,\n \"sig\": \"<string>\",\n \"units\": \"C48480\",\n \"written_at\": \"2025-04-25T00:00:00\",\n \"description\": \"<string>\",\n \"ndc\": \"12345678901\",\n \"notes\": \"<string>\",\n \"substitution_allowed\": true\n },\n \"medications\": [\n {\n \"days_supply\": 30,\n \"drug_name\": \"Levothyroxine\",\n \"prescription_product_id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\",\n \"product_code\": \"HC-RAPA31\",\n \"quantity\": 30,\n \"refills\": 4,\n \"sig\": \"<string>\",\n \"units\": \"C48480\",\n \"written_at\": \"2025-04-25T00:00:00\",\n \"description\": \"<string>\",\n \"ndc\": \"12345678901\",\n \"notes\": \"<string>\",\n \"substitution_allowed\": true\n }\n ],\n \"patient\": {\n \"first_name\": \"Willard\",\n \"last_name\": \"Donnelly\",\n \"email\": \"Harmon43@gmail.com\",\n \"phone\": \"6417383445\",\n \"date_of_birth\": \"1990-01-01\",\n \"address\": {\n \"address_1\": \"140 Lindgren Streets\",\n \"city\": \"North Consueloburgh\",\n \"state\": \"CA\",\n \"zip_code\": \"02108\",\n \"address_2\": \"Apt 227\",\n \"country\": \"US\"\n },\n \"middle_name\": \"Moises\",\n \"gender\": \"male\",\n \"driver_license_number\": \"B49188319\",\n \"driver_license_state\": \"CA\",\n \"ssn\": \"123456789\",\n \"primary_language\": \"en\",\n \"guardian_name\": \"John Guardian\",\n \"guardian_phone\": \"6417383445\",\n \"guardian_email\": \"parent@example.com\",\n \"guardian_relationship\": \"parent\",\n \"height_inches\": 72,\n \"weight_pounds\": 180,\n \"external_id\": \"1234567890\",\n \"is_smoker\": false,\n \"is_diabetic\": false,\n \"is_pregnant\": false,\n \"receive_sms\": true,\n \"receive_email\": true,\n \"risk_factors\": {\n \"allergies\": \"peanuts, tree nuts, shellfish\",\n \"conditions\": \"asthma, hypertension\",\n \"medications\": \"albuterol, levothyroxine\"\n }\n },\n \"prescriber\": {\n \"id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\"\n },\n \"order\": {\n \"id\": \"<string>\",\n \"order_number\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.byblend.com/api/v1/prescriptions/electronic_prescriptions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"medication\": {\n \"days_supply\": 30,\n \"drug_name\": \"Levothyroxine\",\n \"prescription_product_id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\",\n \"product_code\": \"HC-RAPA31\",\n \"quantity\": 30,\n \"refills\": 4,\n \"sig\": \"<string>\",\n \"units\": \"C48480\",\n \"written_at\": \"2025-04-25T00:00:00\",\n \"description\": \"<string>\",\n \"ndc\": \"12345678901\",\n \"notes\": \"<string>\",\n \"substitution_allowed\": true\n },\n \"medications\": [\n {\n \"days_supply\": 30,\n \"drug_name\": \"Levothyroxine\",\n \"prescription_product_id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\",\n \"product_code\": \"HC-RAPA31\",\n \"quantity\": 30,\n \"refills\": 4,\n \"sig\": \"<string>\",\n \"units\": \"C48480\",\n \"written_at\": \"2025-04-25T00:00:00\",\n \"description\": \"<string>\",\n \"ndc\": \"12345678901\",\n \"notes\": \"<string>\",\n \"substitution_allowed\": true\n }\n ],\n \"patient\": {\n \"first_name\": \"Willard\",\n \"last_name\": \"Donnelly\",\n \"email\": \"Harmon43@gmail.com\",\n \"phone\": \"6417383445\",\n \"date_of_birth\": \"1990-01-01\",\n \"address\": {\n \"address_1\": \"140 Lindgren Streets\",\n \"city\": \"North Consueloburgh\",\n \"state\": \"CA\",\n \"zip_code\": \"02108\",\n \"address_2\": \"Apt 227\",\n \"country\": \"US\"\n },\n \"middle_name\": \"Moises\",\n \"gender\": \"male\",\n \"driver_license_number\": \"B49188319\",\n \"driver_license_state\": \"CA\",\n \"ssn\": \"123456789\",\n \"primary_language\": \"en\",\n \"guardian_name\": \"John Guardian\",\n \"guardian_phone\": \"6417383445\",\n \"guardian_email\": \"parent@example.com\",\n \"guardian_relationship\": \"parent\",\n \"height_inches\": 72,\n \"weight_pounds\": 180,\n \"external_id\": \"1234567890\",\n \"is_smoker\": false,\n \"is_diabetic\": false,\n \"is_pregnant\": false,\n \"receive_sms\": true,\n \"receive_email\": true,\n \"risk_factors\": {\n \"allergies\": \"peanuts, tree nuts, shellfish\",\n \"conditions\": \"asthma, hypertension\",\n \"medications\": \"albuterol, levothyroxine\"\n }\n },\n \"prescriber\": {\n \"id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\"\n },\n \"order\": {\n \"id\": \"<string>\",\n \"order_number\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
"created_at": "2025-03-15T12:00:00Z",
"updated_at": "2025-03-15T12:00:00Z",
"customer_id": "b658f16f-819c-4503-aede-bd555fc4ebfb",
"patient_id": "<string>",
"prescriber_id": "<string>",
"source": "api_json",
"type": "NewRx",
"medications": [
{
"id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
"customer_id": "b658f16f-819c-4503-aede-bd555fc4ebfb",
"electronic_prescription_id": "b658f16f-819c-4503-aede-bd555fc4ebfb",
"patient_id": "<string>",
"prescriber_id": "<string>",
"prescription_product_id": "<string>",
"days_supply": 30,
"description": "<string>",
"directions": "<string>",
"drug_name": "<string>",
"expires_at": "2026-04-25T00:00:00",
"fills_remaining": 3,
"transfer_fills": 0,
"name": "Topical Rapamycin",
"notes": "Please dispense 30 days supply",
"product_code": "<string>",
"product_code_type": "<string>",
"quantity": 30,
"refills": 2,
"serial_number": "100721",
"sig": "<string>",
"status": "new",
"strength": "<string>",
"substitution_allowed": true,
"units": "C48480",
"written_at": "2025-04-25T00:00:00"
}
],
"reference_number": "<string>"
}Create a new electronic prescription
Deliver an electronic prescription to Blend either in SCRIPT XML or JSON.
curl --request POST \
--url https://api.byblend.com/api/v1/prescriptions/electronic_prescriptions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"medication": {
"days_supply": 30,
"drug_name": "Levothyroxine",
"prescription_product_id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
"product_code": "HC-RAPA31",
"quantity": 30,
"refills": 4,
"sig": "<string>",
"units": "C48480",
"written_at": "2025-04-25T00:00:00",
"description": "<string>",
"ndc": "12345678901",
"notes": "<string>",
"substitution_allowed": true
},
"medications": [
{
"days_supply": 30,
"drug_name": "Levothyroxine",
"prescription_product_id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
"product_code": "HC-RAPA31",
"quantity": 30,
"refills": 4,
"sig": "<string>",
"units": "C48480",
"written_at": "2025-04-25T00:00:00",
"description": "<string>",
"ndc": "12345678901",
"notes": "<string>",
"substitution_allowed": true
}
],
"patient": {
"first_name": "Willard",
"last_name": "Donnelly",
"email": "Harmon43@gmail.com",
"phone": "6417383445",
"date_of_birth": "1990-01-01",
"address": {
"address_1": "140 Lindgren Streets",
"city": "North Consueloburgh",
"state": "CA",
"zip_code": "02108",
"address_2": "Apt 227",
"country": "US"
},
"middle_name": "Moises",
"gender": "male",
"driver_license_number": "B49188319",
"driver_license_state": "CA",
"ssn": "123456789",
"primary_language": "en",
"guardian_name": "John Guardian",
"guardian_phone": "6417383445",
"guardian_email": "parent@example.com",
"guardian_relationship": "parent",
"height_inches": 72,
"weight_pounds": 180,
"external_id": "1234567890",
"is_smoker": false,
"is_diabetic": false,
"is_pregnant": false,
"receive_sms": true,
"receive_email": true,
"risk_factors": {
"allergies": "peanuts, tree nuts, shellfish",
"conditions": "asthma, hypertension",
"medications": "albuterol, levothyroxine"
}
},
"prescriber": {
"id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708"
},
"order": {
"id": "<string>",
"order_number": "<string>"
}
}
'import requests
url = "https://api.byblend.com/api/v1/prescriptions/electronic_prescriptions"
payload = {
"medication": {
"days_supply": 30,
"drug_name": "Levothyroxine",
"prescription_product_id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
"product_code": "HC-RAPA31",
"quantity": 30,
"refills": 4,
"sig": "<string>",
"units": "C48480",
"written_at": "2025-04-25T00:00:00",
"description": "<string>",
"ndc": "12345678901",
"notes": "<string>",
"substitution_allowed": True
},
"medications": [
{
"days_supply": 30,
"drug_name": "Levothyroxine",
"prescription_product_id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
"product_code": "HC-RAPA31",
"quantity": 30,
"refills": 4,
"sig": "<string>",
"units": "C48480",
"written_at": "2025-04-25T00:00:00",
"description": "<string>",
"ndc": "12345678901",
"notes": "<string>",
"substitution_allowed": True
}
],
"patient": {
"first_name": "Willard",
"last_name": "Donnelly",
"email": "Harmon43@gmail.com",
"phone": "6417383445",
"date_of_birth": "1990-01-01",
"address": {
"address_1": "140 Lindgren Streets",
"city": "North Consueloburgh",
"state": "CA",
"zip_code": "02108",
"address_2": "Apt 227",
"country": "US"
},
"middle_name": "Moises",
"gender": "male",
"driver_license_number": "B49188319",
"driver_license_state": "CA",
"ssn": "123456789",
"primary_language": "en",
"guardian_name": "John Guardian",
"guardian_phone": "6417383445",
"guardian_email": "parent@example.com",
"guardian_relationship": "parent",
"height_inches": 72,
"weight_pounds": 180,
"external_id": "1234567890",
"is_smoker": False,
"is_diabetic": False,
"is_pregnant": False,
"receive_sms": True,
"receive_email": True,
"risk_factors": {
"allergies": "peanuts, tree nuts, shellfish",
"conditions": "asthma, hypertension",
"medications": "albuterol, levothyroxine"
}
},
"prescriber": { "id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708" },
"order": {
"id": "<string>",
"order_number": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
medication: {
days_supply: 30,
drug_name: 'Levothyroxine',
prescription_product_id: '0227d1e5-ba9a-42b5-8fe2-38882aa65708',
product_code: 'HC-RAPA31',
quantity: 30,
refills: 4,
sig: '<string>',
units: 'C48480',
written_at: '2025-04-25T00:00:00',
description: '<string>',
ndc: '12345678901',
notes: '<string>',
substitution_allowed: true
},
medications: [
{
days_supply: 30,
drug_name: 'Levothyroxine',
prescription_product_id: '0227d1e5-ba9a-42b5-8fe2-38882aa65708',
product_code: 'HC-RAPA31',
quantity: 30,
refills: 4,
sig: '<string>',
units: 'C48480',
written_at: '2025-04-25T00:00:00',
description: '<string>',
ndc: '12345678901',
notes: '<string>',
substitution_allowed: true
}
],
patient: {
first_name: 'Willard',
last_name: 'Donnelly',
email: 'Harmon43@gmail.com',
phone: '6417383445',
date_of_birth: '1990-01-01',
address: {
address_1: '140 Lindgren Streets',
city: 'North Consueloburgh',
state: 'CA',
zip_code: '02108',
address_2: 'Apt 227',
country: 'US'
},
middle_name: 'Moises',
gender: 'male',
driver_license_number: 'B49188319',
driver_license_state: 'CA',
ssn: '123456789',
primary_language: 'en',
guardian_name: 'John Guardian',
guardian_phone: '6417383445',
guardian_email: 'parent@example.com',
guardian_relationship: 'parent',
height_inches: 72,
weight_pounds: 180,
external_id: '1234567890',
is_smoker: false,
is_diabetic: false,
is_pregnant: false,
receive_sms: true,
receive_email: true,
risk_factors: {
allergies: 'peanuts, tree nuts, shellfish',
conditions: 'asthma, hypertension',
medications: 'albuterol, levothyroxine'
}
},
prescriber: {id: '0227d1e5-ba9a-42b5-8fe2-38882aa65708'},
order: {id: '<string>', order_number: '<string>'}
})
};
fetch('https://api.byblend.com/api/v1/prescriptions/electronic_prescriptions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.byblend.com/api/v1/prescriptions/electronic_prescriptions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'medication' => [
'days_supply' => 30,
'drug_name' => 'Levothyroxine',
'prescription_product_id' => '0227d1e5-ba9a-42b5-8fe2-38882aa65708',
'product_code' => 'HC-RAPA31',
'quantity' => 30,
'refills' => 4,
'sig' => '<string>',
'units' => 'C48480',
'written_at' => '2025-04-25T00:00:00',
'description' => '<string>',
'ndc' => '12345678901',
'notes' => '<string>',
'substitution_allowed' => true
],
'medications' => [
[
'days_supply' => 30,
'drug_name' => 'Levothyroxine',
'prescription_product_id' => '0227d1e5-ba9a-42b5-8fe2-38882aa65708',
'product_code' => 'HC-RAPA31',
'quantity' => 30,
'refills' => 4,
'sig' => '<string>',
'units' => 'C48480',
'written_at' => '2025-04-25T00:00:00',
'description' => '<string>',
'ndc' => '12345678901',
'notes' => '<string>',
'substitution_allowed' => true
]
],
'patient' => [
'first_name' => 'Willard',
'last_name' => 'Donnelly',
'email' => 'Harmon43@gmail.com',
'phone' => '6417383445',
'date_of_birth' => '1990-01-01',
'address' => [
'address_1' => '140 Lindgren Streets',
'city' => 'North Consueloburgh',
'state' => 'CA',
'zip_code' => '02108',
'address_2' => 'Apt 227',
'country' => 'US'
],
'middle_name' => 'Moises',
'gender' => 'male',
'driver_license_number' => 'B49188319',
'driver_license_state' => 'CA',
'ssn' => '123456789',
'primary_language' => 'en',
'guardian_name' => 'John Guardian',
'guardian_phone' => '6417383445',
'guardian_email' => 'parent@example.com',
'guardian_relationship' => 'parent',
'height_inches' => 72,
'weight_pounds' => 180,
'external_id' => '1234567890',
'is_smoker' => false,
'is_diabetic' => false,
'is_pregnant' => false,
'receive_sms' => true,
'receive_email' => true,
'risk_factors' => [
'allergies' => 'peanuts, tree nuts, shellfish',
'conditions' => 'asthma, hypertension',
'medications' => 'albuterol, levothyroxine'
]
],
'prescriber' => [
'id' => '0227d1e5-ba9a-42b5-8fe2-38882aa65708'
],
'order' => [
'id' => '<string>',
'order_number' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.byblend.com/api/v1/prescriptions/electronic_prescriptions"
payload := strings.NewReader("{\n \"medication\": {\n \"days_supply\": 30,\n \"drug_name\": \"Levothyroxine\",\n \"prescription_product_id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\",\n \"product_code\": \"HC-RAPA31\",\n \"quantity\": 30,\n \"refills\": 4,\n \"sig\": \"<string>\",\n \"units\": \"C48480\",\n \"written_at\": \"2025-04-25T00:00:00\",\n \"description\": \"<string>\",\n \"ndc\": \"12345678901\",\n \"notes\": \"<string>\",\n \"substitution_allowed\": true\n },\n \"medications\": [\n {\n \"days_supply\": 30,\n \"drug_name\": \"Levothyroxine\",\n \"prescription_product_id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\",\n \"product_code\": \"HC-RAPA31\",\n \"quantity\": 30,\n \"refills\": 4,\n \"sig\": \"<string>\",\n \"units\": \"C48480\",\n \"written_at\": \"2025-04-25T00:00:00\",\n \"description\": \"<string>\",\n \"ndc\": \"12345678901\",\n \"notes\": \"<string>\",\n \"substitution_allowed\": true\n }\n ],\n \"patient\": {\n \"first_name\": \"Willard\",\n \"last_name\": \"Donnelly\",\n \"email\": \"Harmon43@gmail.com\",\n \"phone\": \"6417383445\",\n \"date_of_birth\": \"1990-01-01\",\n \"address\": {\n \"address_1\": \"140 Lindgren Streets\",\n \"city\": \"North Consueloburgh\",\n \"state\": \"CA\",\n \"zip_code\": \"02108\",\n \"address_2\": \"Apt 227\",\n \"country\": \"US\"\n },\n \"middle_name\": \"Moises\",\n \"gender\": \"male\",\n \"driver_license_number\": \"B49188319\",\n \"driver_license_state\": \"CA\",\n \"ssn\": \"123456789\",\n \"primary_language\": \"en\",\n \"guardian_name\": \"John Guardian\",\n \"guardian_phone\": \"6417383445\",\n \"guardian_email\": \"parent@example.com\",\n \"guardian_relationship\": \"parent\",\n \"height_inches\": 72,\n \"weight_pounds\": 180,\n \"external_id\": \"1234567890\",\n \"is_smoker\": false,\n \"is_diabetic\": false,\n \"is_pregnant\": false,\n \"receive_sms\": true,\n \"receive_email\": true,\n \"risk_factors\": {\n \"allergies\": \"peanuts, tree nuts, shellfish\",\n \"conditions\": \"asthma, hypertension\",\n \"medications\": \"albuterol, levothyroxine\"\n }\n },\n \"prescriber\": {\n \"id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\"\n },\n \"order\": {\n \"id\": \"<string>\",\n \"order_number\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.byblend.com/api/v1/prescriptions/electronic_prescriptions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"medication\": {\n \"days_supply\": 30,\n \"drug_name\": \"Levothyroxine\",\n \"prescription_product_id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\",\n \"product_code\": \"HC-RAPA31\",\n \"quantity\": 30,\n \"refills\": 4,\n \"sig\": \"<string>\",\n \"units\": \"C48480\",\n \"written_at\": \"2025-04-25T00:00:00\",\n \"description\": \"<string>\",\n \"ndc\": \"12345678901\",\n \"notes\": \"<string>\",\n \"substitution_allowed\": true\n },\n \"medications\": [\n {\n \"days_supply\": 30,\n \"drug_name\": \"Levothyroxine\",\n \"prescription_product_id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\",\n \"product_code\": \"HC-RAPA31\",\n \"quantity\": 30,\n \"refills\": 4,\n \"sig\": \"<string>\",\n \"units\": \"C48480\",\n \"written_at\": \"2025-04-25T00:00:00\",\n \"description\": \"<string>\",\n \"ndc\": \"12345678901\",\n \"notes\": \"<string>\",\n \"substitution_allowed\": true\n }\n ],\n \"patient\": {\n \"first_name\": \"Willard\",\n \"last_name\": \"Donnelly\",\n \"email\": \"Harmon43@gmail.com\",\n \"phone\": \"6417383445\",\n \"date_of_birth\": \"1990-01-01\",\n \"address\": {\n \"address_1\": \"140 Lindgren Streets\",\n \"city\": \"North Consueloburgh\",\n \"state\": \"CA\",\n \"zip_code\": \"02108\",\n \"address_2\": \"Apt 227\",\n \"country\": \"US\"\n },\n \"middle_name\": \"Moises\",\n \"gender\": \"male\",\n \"driver_license_number\": \"B49188319\",\n \"driver_license_state\": \"CA\",\n \"ssn\": \"123456789\",\n \"primary_language\": \"en\",\n \"guardian_name\": \"John Guardian\",\n \"guardian_phone\": \"6417383445\",\n \"guardian_email\": \"parent@example.com\",\n \"guardian_relationship\": \"parent\",\n \"height_inches\": 72,\n \"weight_pounds\": 180,\n \"external_id\": \"1234567890\",\n \"is_smoker\": false,\n \"is_diabetic\": false,\n \"is_pregnant\": false,\n \"receive_sms\": true,\n \"receive_email\": true,\n \"risk_factors\": {\n \"allergies\": \"peanuts, tree nuts, shellfish\",\n \"conditions\": \"asthma, hypertension\",\n \"medications\": \"albuterol, levothyroxine\"\n }\n },\n \"prescriber\": {\n \"id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\"\n },\n \"order\": {\n \"id\": \"<string>\",\n \"order_number\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.byblend.com/api/v1/prescriptions/electronic_prescriptions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"medication\": {\n \"days_supply\": 30,\n \"drug_name\": \"Levothyroxine\",\n \"prescription_product_id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\",\n \"product_code\": \"HC-RAPA31\",\n \"quantity\": 30,\n \"refills\": 4,\n \"sig\": \"<string>\",\n \"units\": \"C48480\",\n \"written_at\": \"2025-04-25T00:00:00\",\n \"description\": \"<string>\",\n \"ndc\": \"12345678901\",\n \"notes\": \"<string>\",\n \"substitution_allowed\": true\n },\n \"medications\": [\n {\n \"days_supply\": 30,\n \"drug_name\": \"Levothyroxine\",\n \"prescription_product_id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\",\n \"product_code\": \"HC-RAPA31\",\n \"quantity\": 30,\n \"refills\": 4,\n \"sig\": \"<string>\",\n \"units\": \"C48480\",\n \"written_at\": \"2025-04-25T00:00:00\",\n \"description\": \"<string>\",\n \"ndc\": \"12345678901\",\n \"notes\": \"<string>\",\n \"substitution_allowed\": true\n }\n ],\n \"patient\": {\n \"first_name\": \"Willard\",\n \"last_name\": \"Donnelly\",\n \"email\": \"Harmon43@gmail.com\",\n \"phone\": \"6417383445\",\n \"date_of_birth\": \"1990-01-01\",\n \"address\": {\n \"address_1\": \"140 Lindgren Streets\",\n \"city\": \"North Consueloburgh\",\n \"state\": \"CA\",\n \"zip_code\": \"02108\",\n \"address_2\": \"Apt 227\",\n \"country\": \"US\"\n },\n \"middle_name\": \"Moises\",\n \"gender\": \"male\",\n \"driver_license_number\": \"B49188319\",\n \"driver_license_state\": \"CA\",\n \"ssn\": \"123456789\",\n \"primary_language\": \"en\",\n \"guardian_name\": \"John Guardian\",\n \"guardian_phone\": \"6417383445\",\n \"guardian_email\": \"parent@example.com\",\n \"guardian_relationship\": \"parent\",\n \"height_inches\": 72,\n \"weight_pounds\": 180,\n \"external_id\": \"1234567890\",\n \"is_smoker\": false,\n \"is_diabetic\": false,\n \"is_pregnant\": false,\n \"receive_sms\": true,\n \"receive_email\": true,\n \"risk_factors\": {\n \"allergies\": \"peanuts, tree nuts, shellfish\",\n \"conditions\": \"asthma, hypertension\",\n \"medications\": \"albuterol, levothyroxine\"\n }\n },\n \"prescriber\": {\n \"id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\"\n },\n \"order\": {\n \"id\": \"<string>\",\n \"order_number\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
"created_at": "2025-03-15T12:00:00Z",
"updated_at": "2025-03-15T12:00:00Z",
"customer_id": "b658f16f-819c-4503-aede-bd555fc4ebfb",
"patient_id": "<string>",
"prescriber_id": "<string>",
"source": "api_json",
"type": "NewRx",
"medications": [
{
"id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
"customer_id": "b658f16f-819c-4503-aede-bd555fc4ebfb",
"electronic_prescription_id": "b658f16f-819c-4503-aede-bd555fc4ebfb",
"patient_id": "<string>",
"prescriber_id": "<string>",
"prescription_product_id": "<string>",
"days_supply": 30,
"description": "<string>",
"directions": "<string>",
"drug_name": "<string>",
"expires_at": "2026-04-25T00:00:00",
"fills_remaining": 3,
"transfer_fills": 0,
"name": "Topical Rapamycin",
"notes": "Please dispense 30 days supply",
"product_code": "<string>",
"product_code_type": "<string>",
"quantity": 30,
"refills": 2,
"serial_number": "100721",
"sig": "<string>",
"status": "new",
"strength": "<string>",
"substitution_allowed": true,
"units": "C48480",
"written_at": "2025-04-25T00:00:00"
}
],
"reference_number": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
By default, electronic prescriptions reference existing Blend patients.
A single medication prescribed. If you need to prescribe multiple medications, use the medications array instead. One of medication or medications is required.
Show child attributes
Show child attributes
An array of medications prescribed. One of medication or medications is required.
Show child attributes
Show child attributes
A patient object. If you pass new patient data, a new patient will be created. Or you may reference an existing patient by id or external_id.
- New Patient
- ID
- External ID
Show child attributes
Show child attributes
Reference to an already-created Blend prescriber.
Show child attributes
Show child attributes
An order can be created before or after a prescription is submitted. If created in advance, you may supply the order ID in your prescription.
Show child attributes
Show child attributes
Response
Successful response with electronic prescription
Unique identifier
"0227d1e5-ba9a-42b5-8fe2-38882aa65708"
Date and time of creation
"2025-03-15T12:00:00Z"
Date and time of last update
"2025-03-15T12:00:00Z"
Once identified, Blend ID of the customer associated with the patient
"b658f16f-819c-4503-aede-bd555fc4ebfb"
Once identified, Blend ID of the patient
Once identified, Blend ID of the prescriber
Source of the prescription, e.g. api_json
"api_json"
Type of electronic prescription, e.g. NewRx
"NewRx"
Individual medication details from the electronic prescription
Show child attributes
Show child attributes
As imported directly from electronic prescription XML