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"
}

This feature is in closed beta.

Interested in this feature? Get in touch with your Customer Success Manager.

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

Response

200
application/json
Successful Response

The response is of type object.