POST
/
v3
/
order
/
import
from vital.client import Vital
from vital.environment import VitalEnvironment
from vital.types.billing import Billing
from vital.types.gender import Gender
from vital.types.lab_test_collection_method import LabTestCollectionMethod
from vital.types.order_set_request import OrderSetRequest
from vital.types.patient_address_compatible import PatientAddressCompatible
from vital.types.patient_details import PatientDetails
from vital.types.physician_create_request import PhysicianCreateRequest
from datetime import datetime

client = Vital(
  api_key="YOUR_API_KEY",
  environment=VitalEnvironment.SANDBOX
)

data = client.lab_tests.import_order(
    user_id="63661a2b-2bb3-4125-bb1a-b590f64f057f",
    billing_type=Billing.CLIENT_BILL,
    order_set=OrderSetRequest(lab_test_ids=[]),
    collection_method=LabTestCollectionMethod.WALK_IN_TEST,
    physician=PhysicianCreateRequest(first_name="Jane", last_name="Doe", npi=""),
    patient_details=PatientDetails(
        first_name="John",
        last_name="Doe",
        dob=datetime.fromisoformat("2020-01-01"),
        gender=Gender.MALE,
        phone_number="+1123456789",
        email="email@email.com"
    ),
    patient_address=PatientAddressCompatible(
      receiver_name="John Doe",
      first_line="123 Main St.",
      second_line="Apt. 208",
      city="San Francisco",
      state="CA",
      zip="91189",
      country="US",
      phone_number="+1123456789"
    ),
    sample_id="1234567890",
)
{
    "order": {
        "user_id": "7ea94b27-a536-461f-ac4b-1c26c854d180",
        "id": "d3ec7ac7-2584-4254-9709-fc61d80635c4",
        "team_id": "59d4dfa1-e7c8-4d96-af15-74ca5ac5d189",
        "patient_details": {
            "first_name": "John",
            "last_name": "Doe",
            "dob": "1990-01-01T00:00:00+00:00",
            "gender": "male",
            "phone_number": "+11231234123",
            "email": "john@example.com"
        },
        "patient_address": {
            "receiver_name": "John Doe",
            "first_line": "123 Main Street",
            "second_line": null,
            "city": "New York",
            "state": "NY",
            "zip": "12345",
            "country": "US",
            "phone_number": "+11231234123"
        },
        "lab_test": {
            "id": "d0b479ec-afcc-4763-985c-4e23f17149f5",
            "slug": "59d4dfa1-testosterone",
            "name": "Testosterone",
            "sample_type": "serum",
            "method": "at_home_phlebotomy",
            "price": 0.0,
            "is_active": true,
            "status": "active",
            "fasting": false,
            "lab": null,
            "markers": null,
            "is_delegated": false,
            "auto_generated": false
        },
        "details": {
            "type": "at_home_phlebotomy",
            "data": {
                "id": "21cb5e3f-25e3-443d-9fee-272de1393310",
                "appointment_id": null,
                "created_at": "2025-03-20T13:07:32+00:00",
                "updated_at": "2025-03-20T13:07:32+00:00"
            }
        },
        "sample_id": "1234567890",
        "notes": null,
        "created_at": "2025-03-20T13:07:32+00:00",
        "updated_at": "2025-03-20T13:07:32+00:00",
        "events": [
            {
                "id": 74769,
                "created_at": "2025-03-20T13:07:32+00:00",
                "status": "received.at_home_phlebotomy.ordered"
            },
            {
                "id": 74770,
                "created_at": "2025-03-20T13:07:32+00:00",
                "status": "received.at_home_phlebotomy.requisition_bypassed"
            }
        ],
        "status": "received",
        "physician": {
            "first_name": "Jane",
            "last_name": "Doe",
            "npi": "123"
        },
        "health_insurance_id": null,
        "requisition_form_url": null,
        "priority": false,
        "shipping_details": null,
        "activate_by": null,
        "passthrough": null,
        "billing_type": "client_bill",
        "icd_codes": null
    },
    "status": "success",
    "message": "Order created successfully"
}

Importing orders is currently in closed beta.

from vital.client import Vital
from vital.environment import VitalEnvironment
from vital.types.billing import Billing
from vital.types.gender import Gender
from vital.types.lab_test_collection_method import LabTestCollectionMethod
from vital.types.order_set_request import OrderSetRequest
from vital.types.patient_address_compatible import PatientAddressCompatible
from vital.types.patient_details import PatientDetails
from vital.types.physician_create_request import PhysicianCreateRequest
from datetime import datetime

client = Vital(
  api_key="YOUR_API_KEY",
  environment=VitalEnvironment.SANDBOX
)

data = client.lab_tests.import_order(
    user_id="63661a2b-2bb3-4125-bb1a-b590f64f057f",
    billing_type=Billing.CLIENT_BILL,
    order_set=OrderSetRequest(lab_test_ids=[]),
    collection_method=LabTestCollectionMethod.WALK_IN_TEST,
    physician=PhysicianCreateRequest(first_name="Jane", last_name="Doe", npi=""),
    patient_details=PatientDetails(
        first_name="John",
        last_name="Doe",
        dob=datetime.fromisoformat("2020-01-01"),
        gender=Gender.MALE,
        phone_number="+1123456789",
        email="email@email.com"
    ),
    patient_address=PatientAddressCompatible(
      receiver_name="John Doe",
      first_line="123 Main St.",
      second_line="Apt. 208",
      city="San Francisco",
      state="CA",
      zip="91189",
      country="US",
      phone_number="+1123456789"
    ),
    sample_id="1234567890",
)
{
    "order": {
        "user_id": "7ea94b27-a536-461f-ac4b-1c26c854d180",
        "id": "d3ec7ac7-2584-4254-9709-fc61d80635c4",
        "team_id": "59d4dfa1-e7c8-4d96-af15-74ca5ac5d189",
        "patient_details": {
            "first_name": "John",
            "last_name": "Doe",
            "dob": "1990-01-01T00:00:00+00:00",
            "gender": "male",
            "phone_number": "+11231234123",
            "email": "john@example.com"
        },
        "patient_address": {
            "receiver_name": "John Doe",
            "first_line": "123 Main Street",
            "second_line": null,
            "city": "New York",
            "state": "NY",
            "zip": "12345",
            "country": "US",
            "phone_number": "+11231234123"
        },
        "lab_test": {
            "id": "d0b479ec-afcc-4763-985c-4e23f17149f5",
            "slug": "59d4dfa1-testosterone",
            "name": "Testosterone",
            "sample_type": "serum",
            "method": "at_home_phlebotomy",
            "price": 0.0,
            "is_active": true,
            "status": "active",
            "fasting": false,
            "lab": null,
            "markers": null,
            "is_delegated": false,
            "auto_generated": false
        },
        "details": {
            "type": "at_home_phlebotomy",
            "data": {
                "id": "21cb5e3f-25e3-443d-9fee-272de1393310",
                "appointment_id": null,
                "created_at": "2025-03-20T13:07:32+00:00",
                "updated_at": "2025-03-20T13:07:32+00:00"
            }
        },
        "sample_id": "1234567890",
        "notes": null,
        "created_at": "2025-03-20T13:07:32+00:00",
        "updated_at": "2025-03-20T13:07:32+00:00",
        "events": [
            {
                "id": 74769,
                "created_at": "2025-03-20T13:07:32+00:00",
                "status": "received.at_home_phlebotomy.ordered"
            },
            {
                "id": 74770,
                "created_at": "2025-03-20T13:07:32+00:00",
                "status": "received.at_home_phlebotomy.requisition_bypassed"
            }
        ],
        "status": "received",
        "physician": {
            "first_name": "Jane",
            "last_name": "Doe",
            "npi": "123"
        },
        "health_insurance_id": null,
        "requisition_form_url": null,
        "priority": false,
        "shipping_details": null,
        "activate_by": null,
        "passthrough": null,
        "billing_type": "client_bill",
        "icd_codes": null
    },
    "status": "success",
    "message": "Order created successfully"
}

Authorizations

x-vital-api-key
string
header
required

Vital Team API Key

Body

application/json
user_id
string
required
billing_type
enum<string>
required

ℹ️ This enum is non-exhaustive.

Available options:
client_bill,
commercial_insurance,
patient_bill_passthrough,
patient_bill
order_set
object
required
collection_method
enum<string>
required

The method used to perform a lab test. ℹ️ This enum is non-exhaustive.

Available options:
testkit,
walk_in_test,
at_home_phlebotomy
patient_details
object
required

Patient details with validation for first_name, last_name, email, and dob.

patient_address
object
required
sample_id
string
required
physician
object | null

Response

200
application/json
Successful Response
order
object
required
Example:
{
  "activate_by": "2020-01-01",
  "created_at": "2020-01-01T00:00:00Z",
  "details": {
    "data": {
      "created_at": "2020-01-01T00:00:00Z",
      "id": "a655f0e4-6405-4a1d-80b7-66f06c2108a7",
      "shipment": {
        "created_at": "2020-01-01T00:00:00.000Z",
        "id": "d55210cc-3d9f-4115-8262-5013f700c7be",
        "inbound_courier": "usps",
        "inbound_tracking_number": "<inbound_tracking_number>",
        "inbound_tracking_url": "<inbound_tracking_url>",
        "notes": "<notes>",
        "outbound_courier": "usps",
        "outbound_tracking_number": "<outbound_tracking_number>",
        "outbound_tracking_url": "<outbound_tracking_url>",
        "updated_at": "2020-01-01T00:00:00.000Z"
      },
      "updated_at": "2020-01-01T00:00:00Z"
    },
    "type": "testkit"
  },
  "events": [
    {
      "created_at": "2022-01-01T00:00:00Z",
      "id": 1,
      "status": "received.testkit.ordered"
    },
    {
      "created_at": "2022-01-02T00:00:00Z",
      "id": 2,
      "status": "received.testkit.requisition_created"
    },
    {
      "created_at": "2022-01-03T00:00:00Z",
      "id": 3,
      "status": "collecting_sample.testkit.transit_customer"
    }
  ],
  "has_abn": false,
  "health_insurace_id": "6f39d44a-163e-4b74-a83a-be32ef837a0b",
  "id": "08c0b521-7b8c-404a-a5e3-3be3dee78668",
  "lab_test": {
    "description": "Cholesterol test",
    "method": "testkit",
    "name": "Lipids Panel"
  },
  "notes": "This is a note",
  "patient_address": {
    "city": "San Francisco",
    "country": "United States",
    "first_line": "123 Main St.",
    "phone_number": "+11234567890",
    "receiver_name": "John Doe",
    "second_line": "Apt. 208",
    "state": "CA",
    "zip": "91189"
  },
  "patient_details": { "dob": "2020-01-01", "gender": "male" },
  "requisition_form_url": "https://www.example.com",
  "sample_id": "123456789",
  "status": "collecting_sample",
  "team_id": "6f893421-e04f-4a33-8c17-7b95eafd48d7",
  "updated_at": "2020-01-01T00:00:00Z",
  "user_id": "adb8a4ec-ca18-4cd9-b29d-476bc70c2987"
}
status
string
required
message
string
required