curl --request POST \
--url https://api.byblend.com/api/v1/orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"patient_id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
"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"
}
},
"electronic_prescription_ids": [
[
"BFCB96C9-F866-405E-A1B3-3ED031DFB423",
"3CBEED4B-695B-4E61-A71A-7E7FB22330EF"
]
],
"external_id": "my-system-128318AA2",
"products": {
"prescription": [
{
"id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
"quantity": 1,
"reasons": [
{
"id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708"
}
]
}
],
"non_prescription": [
{
"id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
"quantity": 1
}
],
"order_material": [
{
"id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
"quantity": 1
}
]
},
"shipping": {
"carrier": "usps",
"service_level": "usps_ground_advantage"
}
}
'import requests
url = "https://api.byblend.com/api/v1/orders"
payload = {
"patient_id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
"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"
}
},
"electronic_prescription_ids": [["BFCB96C9-F866-405E-A1B3-3ED031DFB423", "3CBEED4B-695B-4E61-A71A-7E7FB22330EF"]],
"external_id": "my-system-128318AA2",
"products": {
"prescription": [
{
"id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
"quantity": 1,
"reasons": [{ "id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708" }]
}
],
"non_prescription": [
{
"id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
"quantity": 1
}
],
"order_material": [
{
"id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
"quantity": 1
}
]
},
"shipping": {
"carrier": "usps",
"service_level": "usps_ground_advantage"
}
}
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({
patient_id: '0227d1e5-ba9a-42b5-8fe2-38882aa65708',
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'
}
},
electronic_prescription_ids: [
['BFCB96C9-F866-405E-A1B3-3ED031DFB423', '3CBEED4B-695B-4E61-A71A-7E7FB22330EF']
],
external_id: 'my-system-128318AA2',
products: {
prescription: [
{
id: '0227d1e5-ba9a-42b5-8fe2-38882aa65708',
quantity: 1,
reasons: [{id: '0227d1e5-ba9a-42b5-8fe2-38882aa65708'}]
}
],
non_prescription: [{id: '0227d1e5-ba9a-42b5-8fe2-38882aa65708', quantity: 1}],
order_material: [{id: '0227d1e5-ba9a-42b5-8fe2-38882aa65708', quantity: 1}]
},
shipping: {carrier: 'usps', service_level: 'usps_ground_advantage'}
})
};
fetch('https://api.byblend.com/api/v1/orders', 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/orders",
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([
'patient_id' => '0227d1e5-ba9a-42b5-8fe2-38882aa65708',
'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'
]
],
'electronic_prescription_ids' => [
[
'BFCB96C9-F866-405E-A1B3-3ED031DFB423',
'3CBEED4B-695B-4E61-A71A-7E7FB22330EF'
]
],
'external_id' => 'my-system-128318AA2',
'products' => [
'prescription' => [
[
'id' => '0227d1e5-ba9a-42b5-8fe2-38882aa65708',
'quantity' => 1,
'reasons' => [
[
'id' => '0227d1e5-ba9a-42b5-8fe2-38882aa65708'
]
]
]
],
'non_prescription' => [
[
'id' => '0227d1e5-ba9a-42b5-8fe2-38882aa65708',
'quantity' => 1
]
],
'order_material' => [
[
'id' => '0227d1e5-ba9a-42b5-8fe2-38882aa65708',
'quantity' => 1
]
]
],
'shipping' => [
'carrier' => 'usps',
'service_level' => 'usps_ground_advantage'
]
]),
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/orders"
payload := strings.NewReader("{\n \"patient_id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\",\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 \"electronic_prescription_ids\": [\n [\n \"BFCB96C9-F866-405E-A1B3-3ED031DFB423\",\n \"3CBEED4B-695B-4E61-A71A-7E7FB22330EF\"\n ]\n ],\n \"external_id\": \"my-system-128318AA2\",\n \"products\": {\n \"prescription\": [\n {\n \"id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\",\n \"quantity\": 1,\n \"reasons\": [\n {\n \"id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\"\n }\n ]\n }\n ],\n \"non_prescription\": [\n {\n \"id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\",\n \"quantity\": 1\n }\n ],\n \"order_material\": [\n {\n \"id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\",\n \"quantity\": 1\n }\n ]\n },\n \"shipping\": {\n \"carrier\": \"usps\",\n \"service_level\": \"usps_ground_advantage\"\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/orders")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"patient_id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\",\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 \"electronic_prescription_ids\": [\n [\n \"BFCB96C9-F866-405E-A1B3-3ED031DFB423\",\n \"3CBEED4B-695B-4E61-A71A-7E7FB22330EF\"\n ]\n ],\n \"external_id\": \"my-system-128318AA2\",\n \"products\": {\n \"prescription\": [\n {\n \"id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\",\n \"quantity\": 1,\n \"reasons\": [\n {\n \"id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\"\n }\n ]\n }\n ],\n \"non_prescription\": [\n {\n \"id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\",\n \"quantity\": 1\n }\n ],\n \"order_material\": [\n {\n \"id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\",\n \"quantity\": 1\n }\n ]\n },\n \"shipping\": {\n \"carrier\": \"usps\",\n \"service_level\": \"usps_ground_advantage\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.byblend.com/api/v1/orders")
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 \"patient_id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\",\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 \"electronic_prescription_ids\": [\n [\n \"BFCB96C9-F866-405E-A1B3-3ED031DFB423\",\n \"3CBEED4B-695B-4E61-A71A-7E7FB22330EF\"\n ]\n ],\n \"external_id\": \"my-system-128318AA2\",\n \"products\": {\n \"prescription\": [\n {\n \"id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\",\n \"quantity\": 1,\n \"reasons\": [\n {\n \"id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\"\n }\n ]\n }\n ],\n \"non_prescription\": [\n {\n \"id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\",\n \"quantity\": 1\n }\n ],\n \"order_material\": [\n {\n \"id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\",\n \"quantity\": 1\n }\n ]\n },\n \"shipping\": {\n \"carrier\": \"usps\",\n \"service_level\": \"usps_ground_advantage\"\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",
"address": {
"id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
"address_1": "140 Lindgren Streets",
"address_2": "Apt 227",
"city": "North Consueloburgh",
"state": "CA",
"country": "US",
"type": "shipping",
"zip_code": "02108"
},
"custom_shipping": {
"label_url": "https://example.com/label.pdf",
"tracking_number": "TEST123456",
"tracking_url": "https://example.com/track/TEST123456",
"carrier": "UPS"
},
"customer_id": "b658f16f-819c-4503-aede-bd555fc4ebfb",
"external_id": "my-system-128318AA2",
"is_replacement": false,
"order_number": "ORD250312003548IAU4",
"original_order_id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
"patient": {
"id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
"created_at": "2025-03-15T12:00:00Z",
"updated_at": "2025-03-15T12:00:00Z",
"first_name": "Willard",
"middle_name": "Moises",
"last_name": "Donnelly",
"gender": "male",
"email": "Harmon43@gmail.com",
"phone": "6417383445",
"date_of_birth": "1990-01-01",
"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,
"address": {
"address_1": "140 Lindgren Streets",
"city": "North Consueloburgh",
"state": "CA",
"zip_code": "02108",
"address_2": "Apt 227",
"country": "US"
}
},
"prescription_count": 1,
"priority_requested": false,
"cancellation_requested": false,
"replacement_order_ids": [
"0227d1e5-ba9a-42b5-8fe2-38882aa65708"
],
"replacement_reason": "Product arrived damaged",
"replacement_requested": false,
"replacement_request_status": "pending",
"replacement_requested_at": "2025-01-01T00:00:00Z",
"replacement_requested_reason": "Product arrived damaged",
"shipments": [
{
"carrier": "USPS",
"created_at": "2026-04-17T18:31:05.175498",
"delivered_at": "2026-04-17T18:31:05.175498",
"id": "0239CA06-9A71-4FFE-8A8D-5403540A19E7",
"service_level": "Ground Advantage",
"status": "shipped",
"tracking_number": "9200190347375200467807",
"tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?origTrackNum=9200190347375200467807"
}
],
"shipping": {
"carrier": "usps",
"service_level": "usps_ground_advantage"
},
"status": "received",
"products": {
"prescription": [
{
"id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
"created_at": "2025-03-15T12:00:00Z",
"updated_at": "2025-03-15T12:00:00Z",
"sku": "1234567890",
"name": "Mupirocin",
"description": "A topical cream that is used to treat skin infections.",
"product_code": "SUPERSPRAY15",
"form": "cream",
"is_active": true,
"label_orientation": "portrait",
"strength": "1%",
"has_prescription": true,
"quantity": 2,
"reasons": [
{
"id": "00000000-0000-0000-0000-000000000201",
"name": "Palatability",
"description": "Commercial formulation has an unpleasant taste, texture, or odor."
}
]
}
],
"non_prescription": [
{
"id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
"created_at": "2025-03-15T12:00:00Z",
"updated_at": "2025-03-15T12:00:00Z",
"sku": "1234567890",
"name": "Krill Farms Fish Oil",
"description": "A fish oil supplement complementary to prescribed products.",
"form": "liquid",
"is_active": true,
"quantity": 1
}
],
"order_material": [
{
"id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
"created_at": "2025-03-15T12:00:00Z",
"updated_at": "2025-03-15T12:00:00Z",
"sku": "1234567890",
"name": "Referral Brochure",
"description": "Customer brochure included in every shipment.",
"category": "marketing",
"current_stock": 927,
"reorder_threshold": 100,
"has_inventory": true,
"is_global": false,
"quantity": 1
}
]
},
"merged_into_existing": true
}Create an order
Create a new order.
If a mergeable order exists for the provided patient, a new order request will be merged into the existing order, unless force_new=true is specified. Please see Order Merging for more details.
curl --request POST \
--url https://api.byblend.com/api/v1/orders \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"patient_id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
"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"
}
},
"electronic_prescription_ids": [
[
"BFCB96C9-F866-405E-A1B3-3ED031DFB423",
"3CBEED4B-695B-4E61-A71A-7E7FB22330EF"
]
],
"external_id": "my-system-128318AA2",
"products": {
"prescription": [
{
"id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
"quantity": 1,
"reasons": [
{
"id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708"
}
]
}
],
"non_prescription": [
{
"id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
"quantity": 1
}
],
"order_material": [
{
"id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
"quantity": 1
}
]
},
"shipping": {
"carrier": "usps",
"service_level": "usps_ground_advantage"
}
}
'import requests
url = "https://api.byblend.com/api/v1/orders"
payload = {
"patient_id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
"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"
}
},
"electronic_prescription_ids": [["BFCB96C9-F866-405E-A1B3-3ED031DFB423", "3CBEED4B-695B-4E61-A71A-7E7FB22330EF"]],
"external_id": "my-system-128318AA2",
"products": {
"prescription": [
{
"id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
"quantity": 1,
"reasons": [{ "id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708" }]
}
],
"non_prescription": [
{
"id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
"quantity": 1
}
],
"order_material": [
{
"id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
"quantity": 1
}
]
},
"shipping": {
"carrier": "usps",
"service_level": "usps_ground_advantage"
}
}
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({
patient_id: '0227d1e5-ba9a-42b5-8fe2-38882aa65708',
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'
}
},
electronic_prescription_ids: [
['BFCB96C9-F866-405E-A1B3-3ED031DFB423', '3CBEED4B-695B-4E61-A71A-7E7FB22330EF']
],
external_id: 'my-system-128318AA2',
products: {
prescription: [
{
id: '0227d1e5-ba9a-42b5-8fe2-38882aa65708',
quantity: 1,
reasons: [{id: '0227d1e5-ba9a-42b5-8fe2-38882aa65708'}]
}
],
non_prescription: [{id: '0227d1e5-ba9a-42b5-8fe2-38882aa65708', quantity: 1}],
order_material: [{id: '0227d1e5-ba9a-42b5-8fe2-38882aa65708', quantity: 1}]
},
shipping: {carrier: 'usps', service_level: 'usps_ground_advantage'}
})
};
fetch('https://api.byblend.com/api/v1/orders', 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/orders",
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([
'patient_id' => '0227d1e5-ba9a-42b5-8fe2-38882aa65708',
'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'
]
],
'electronic_prescription_ids' => [
[
'BFCB96C9-F866-405E-A1B3-3ED031DFB423',
'3CBEED4B-695B-4E61-A71A-7E7FB22330EF'
]
],
'external_id' => 'my-system-128318AA2',
'products' => [
'prescription' => [
[
'id' => '0227d1e5-ba9a-42b5-8fe2-38882aa65708',
'quantity' => 1,
'reasons' => [
[
'id' => '0227d1e5-ba9a-42b5-8fe2-38882aa65708'
]
]
]
],
'non_prescription' => [
[
'id' => '0227d1e5-ba9a-42b5-8fe2-38882aa65708',
'quantity' => 1
]
],
'order_material' => [
[
'id' => '0227d1e5-ba9a-42b5-8fe2-38882aa65708',
'quantity' => 1
]
]
],
'shipping' => [
'carrier' => 'usps',
'service_level' => 'usps_ground_advantage'
]
]),
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/orders"
payload := strings.NewReader("{\n \"patient_id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\",\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 \"electronic_prescription_ids\": [\n [\n \"BFCB96C9-F866-405E-A1B3-3ED031DFB423\",\n \"3CBEED4B-695B-4E61-A71A-7E7FB22330EF\"\n ]\n ],\n \"external_id\": \"my-system-128318AA2\",\n \"products\": {\n \"prescription\": [\n {\n \"id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\",\n \"quantity\": 1,\n \"reasons\": [\n {\n \"id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\"\n }\n ]\n }\n ],\n \"non_prescription\": [\n {\n \"id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\",\n \"quantity\": 1\n }\n ],\n \"order_material\": [\n {\n \"id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\",\n \"quantity\": 1\n }\n ]\n },\n \"shipping\": {\n \"carrier\": \"usps\",\n \"service_level\": \"usps_ground_advantage\"\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/orders")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"patient_id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\",\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 \"electronic_prescription_ids\": [\n [\n \"BFCB96C9-F866-405E-A1B3-3ED031DFB423\",\n \"3CBEED4B-695B-4E61-A71A-7E7FB22330EF\"\n ]\n ],\n \"external_id\": \"my-system-128318AA2\",\n \"products\": {\n \"prescription\": [\n {\n \"id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\",\n \"quantity\": 1,\n \"reasons\": [\n {\n \"id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\"\n }\n ]\n }\n ],\n \"non_prescription\": [\n {\n \"id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\",\n \"quantity\": 1\n }\n ],\n \"order_material\": [\n {\n \"id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\",\n \"quantity\": 1\n }\n ]\n },\n \"shipping\": {\n \"carrier\": \"usps\",\n \"service_level\": \"usps_ground_advantage\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.byblend.com/api/v1/orders")
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 \"patient_id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\",\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 \"electronic_prescription_ids\": [\n [\n \"BFCB96C9-F866-405E-A1B3-3ED031DFB423\",\n \"3CBEED4B-695B-4E61-A71A-7E7FB22330EF\"\n ]\n ],\n \"external_id\": \"my-system-128318AA2\",\n \"products\": {\n \"prescription\": [\n {\n \"id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\",\n \"quantity\": 1,\n \"reasons\": [\n {\n \"id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\"\n }\n ]\n }\n ],\n \"non_prescription\": [\n {\n \"id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\",\n \"quantity\": 1\n }\n ],\n \"order_material\": [\n {\n \"id\": \"0227d1e5-ba9a-42b5-8fe2-38882aa65708\",\n \"quantity\": 1\n }\n ]\n },\n \"shipping\": {\n \"carrier\": \"usps\",\n \"service_level\": \"usps_ground_advantage\"\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",
"address": {
"id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
"address_1": "140 Lindgren Streets",
"address_2": "Apt 227",
"city": "North Consueloburgh",
"state": "CA",
"country": "US",
"type": "shipping",
"zip_code": "02108"
},
"custom_shipping": {
"label_url": "https://example.com/label.pdf",
"tracking_number": "TEST123456",
"tracking_url": "https://example.com/track/TEST123456",
"carrier": "UPS"
},
"customer_id": "b658f16f-819c-4503-aede-bd555fc4ebfb",
"external_id": "my-system-128318AA2",
"is_replacement": false,
"order_number": "ORD250312003548IAU4",
"original_order_id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
"patient": {
"id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
"created_at": "2025-03-15T12:00:00Z",
"updated_at": "2025-03-15T12:00:00Z",
"first_name": "Willard",
"middle_name": "Moises",
"last_name": "Donnelly",
"gender": "male",
"email": "Harmon43@gmail.com",
"phone": "6417383445",
"date_of_birth": "1990-01-01",
"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,
"address": {
"address_1": "140 Lindgren Streets",
"city": "North Consueloburgh",
"state": "CA",
"zip_code": "02108",
"address_2": "Apt 227",
"country": "US"
}
},
"prescription_count": 1,
"priority_requested": false,
"cancellation_requested": false,
"replacement_order_ids": [
"0227d1e5-ba9a-42b5-8fe2-38882aa65708"
],
"replacement_reason": "Product arrived damaged",
"replacement_requested": false,
"replacement_request_status": "pending",
"replacement_requested_at": "2025-01-01T00:00:00Z",
"replacement_requested_reason": "Product arrived damaged",
"shipments": [
{
"carrier": "USPS",
"created_at": "2026-04-17T18:31:05.175498",
"delivered_at": "2026-04-17T18:31:05.175498",
"id": "0239CA06-9A71-4FFE-8A8D-5403540A19E7",
"service_level": "Ground Advantage",
"status": "shipped",
"tracking_number": "9200190347375200467807",
"tracking_url": "https://tools.usps.com/go/TrackConfirmAction_input?origTrackNum=9200190347375200467807"
}
],
"shipping": {
"carrier": "usps",
"service_level": "usps_ground_advantage"
},
"status": "received",
"products": {
"prescription": [
{
"id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
"created_at": "2025-03-15T12:00:00Z",
"updated_at": "2025-03-15T12:00:00Z",
"sku": "1234567890",
"name": "Mupirocin",
"description": "A topical cream that is used to treat skin infections.",
"product_code": "SUPERSPRAY15",
"form": "cream",
"is_active": true,
"label_orientation": "portrait",
"strength": "1%",
"has_prescription": true,
"quantity": 2,
"reasons": [
{
"id": "00000000-0000-0000-0000-000000000201",
"name": "Palatability",
"description": "Commercial formulation has an unpleasant taste, texture, or odor."
}
]
}
],
"non_prescription": [
{
"id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
"created_at": "2025-03-15T12:00:00Z",
"updated_at": "2025-03-15T12:00:00Z",
"sku": "1234567890",
"name": "Krill Farms Fish Oil",
"description": "A fish oil supplement complementary to prescribed products.",
"form": "liquid",
"is_active": true,
"quantity": 1
}
],
"order_material": [
{
"id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
"created_at": "2025-03-15T12:00:00Z",
"updated_at": "2025-03-15T12:00:00Z",
"sku": "1234567890",
"name": "Referral Brochure",
"description": "Customer brochure included in every shipment.",
"category": "marketing",
"current_stock": 927,
"reorder_threshold": 100,
"has_inventory": true,
"is_global": false,
"quantity": 1
}
]
},
"merged_into_existing": true
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
If 'true', creates a new order even if a mergeable order exists for the patient. Default is 'false', which merges into existing open orders when available.
true
Body
Blend ID of an existing patient to associate with the order. (You may pass this here or within the patient object.) One of a patient_id or patient object must be provided.
"0227d1e5-ba9a-42b5-8fe2-38882aa65708"
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
Order shipping address, if different from the patient's address
Show child attributes
Show child attributes
Custom shipping details for the order. Your account must have custom shipping enabled to use this field; all subfields are required.
Show child attributes
Show child attributes
If you have created electronic prescription(s) using the Electronic Prescriptions endpoint, you may optionally supply a list of electronic prescription id values to associate. This is an optional convenience field to assist with prescription matching.
List of electronic prescription IDs to associate with the order.
External (your own system's) ID to associate with the order.
"my-system-128318AA2"
You may supply product references using a Blend id or your own sku; or, for prescription products, a product code.
Show child attributes
Show child attributes
Shipping preferences for the order. Please ensure you have established the ability to use this feature with Blend administrators before using.
You may provide one or both fields. If you provide a "generic" service_level only, we will use the most appropriate carrier to match the service level. If you provide both, your service_level prefix ("usps_") must match your carrier.
Available carriers and service levels can be found in the Shipping Options endpoint.
Show child attributes
Show child attributes
Response
Order created successfully
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"
Show child attributes
Show child attributes
Custom shipping details for the order if your account has custom shipping enabled, and you have provided prepaid label details.
Show child attributes
Show child attributes
"b658f16f-819c-4503-aede-bd555fc4ebfb"
External (your own system's) ID associated with the order.
"my-system-128318AA2"
Whether the order is a replacement order
false
Friendlier identifier for the order. Auto-generated.
"ORD250312003548IAU4"
ID of the original order, if this is a replacement order
"0227d1e5-ba9a-42b5-8fe2-38882aa65708"
Show child attributes
Show child attributes
Number of prescriptions associated with the order (expected to be the same as the number of prescription products in the products object)
1
Whether the order has a priority request
false
Whether the customer has requested cancellation for an order in picked or verified status
false
IDs of any replacement orders, if they have been created from this order
If this is a replacement order, reason for the replacement
"Product arrived damaged"
Whether the order has a replacement request. This field is deprecated and will be removed in a future version. Please use replacement_request_status instead.
false
Status of the replacement request
pending, fulfilled, declined, cancelled "pending"
Date and time a replacement request was made
"2025-01-01T00:00:00Z"
Reason for the replacement request
"Product arrived damaged"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
"received"
Show child attributes
Show child attributes
Indicates if the order was merged into an existing order. If so, the existing order details will have populated the response.
true