Skip to main content
POST
/
api
/
v1
/
orders
Create an order
curl --request POST \
  --url https://api.byblend.com/api/v1/orders \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "address": {
    "address_1": "140 Lindgren Streets",
    "address_2": "Apt 227",
    "city": "North Consueloburgh",
    "state": "CA",
    "country": "US",
    "zip_code": "02108"
  },
  "custom_shipping": {
    "label_url": "https://example.com/label.pdf",
    "tracking_number": "TEST123456",
    "tracking_url": "https://example.com/track/TEST123456",
    "carrier": "UPS"
  },
  "electronic_prescription_ids": [
    [
      "BFCB96C9-F866-405E-A1B3-3ED031DFB423",
      "3CBEED4B-695B-4E61-A71A-7E7FB22330EF"
    ]
  ],
  "external_id": "my-system-128318AA2",
  "patient_id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
  "patient": {
    "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",
    "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,
    "address": {
      "address_1": "140 Lindgren Streets",
      "address_2": "Apt 227",
      "city": "North Consueloburgh",
      "state": "CA",
      "country": "US",
      "zip_code": "02108"
    },
    "risk_factors": {
      "allergies": "peanuts, tree nuts, shellfish",
      "conditions": "asthma, hypertension",
      "medications": "albuterol, levothyroxine"
    }
  },
  "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_materials": [
      {
        "id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
        "quantity": 1
      }
    ]
  }
}'
{
  "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",
  "order_number": "ORD250312003548IAU4",
  "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",
    "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,
    "address": {
      "address_1": "140 Lindgren Streets",
      "address_2": "Apt 227",
      "city": "North Consueloburgh",
      "state": "CA",
      "country": "US",
      "zip_code": "02108"
    }
  },
  "products": {
    "prescription": [
      {
        "id": "0227d1e5-ba9a-42b5-8fe2-38882aa65708",
        "created_at": "2025-03-15T12:00:00Z",
        "updated_at": "2025-03-15T12:00:00Z",
        "current_stock": 927,
        "reorder_threshold": 100,
        "has_inventory": true,
        "sku": "1234567890",
        "name": "Mupirocin",
        "description": "A topical cream that is used to treat skin infections.",
        "product_code": "SUPERSPRAY15",
        "category": "topicals",
        "form": "cream",
        "formula_id": 826271167,
        "is_active": true,
        "strength": "1%",
        "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",
        "current_stock": 927,
        "reorder_threshold": 100,
        "has_inventory": true,
        "sku": "1234567890",
        "name": "Krill Farms Fish Oil",
        "description": "A fish oil supplement complementary to prescribed products.",
        "category": "nutrition",
        "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",
        "current_stock": 927,
        "reorder_threshold": 100,
        "has_inventory": true,
        "sku": "1234567890",
        "name": "Referral Brochure",
        "description": "Customer brochure included in every shipment.",
        "category": "marketing",
        "is_global": false,
        "quantity": 1
      }
    ]
  },
  "status": "received"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
patient_id
string<uuid>
required

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.

Example:

"0227d1e5-ba9a-42b5-8fe2-38882aa65708"

patient
object
required

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
address
object

Order shipping address, if different from the patient's address

custom_shipping
object

Custom shipping details for the order. Your account must have custom shipping enabled to use this field; all subfields are required.

electronic_prescription_ids
string<uuid>[]

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_id
string

External (your own system's) ID to associate with the order.

Example:

"my-system-128318AA2"

products
object

You may supply product references using a Blend id or your own sku; or, for prescription products, a product code.

Response

201 - application/json

Order created successfully

id
string<uuid>

Unique identifier

Example:

"0227d1e5-ba9a-42b5-8fe2-38882aa65708"

created_at
string<date-time>

Date and time of creation

Example:

"2025-03-15T12:00:00Z"

updated_at
string<date-time>

Date and time of last update

Example:

"2025-03-15T12:00:00Z"

address
object
custom_shipping
object

Custom shipping details for the order if your account has custom shipping enabled, and you have provided prepaid label details.

customer_id
string<uuid>
Example:

"b658f16f-819c-4503-aede-bd555fc4ebfb"

external_id
string

External (your own system's) ID associated with the order.

Example:

"my-system-128318AA2"

order_number
string

Friendlier identifier for the order. Auto-generated.

Example:

"ORD250312003548IAU4"

patient
object
products
object
status
string
Example:

"received"

I