POST
/
v3
/
order
from vital.client import Vital
from vital.environment import VitalEnvironment
from vital.types.gender import Gender
from vital.types.patient_address_compatible import PatientAddressCompatible
from vital.types.patient_details import PatientDetails
from datetime import datetime

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

data = client.lab_tests.create_order(
    user_id="63661a2b-2bb3-4125-bb1a-b590f64f057f",
    lab_test_id="5b41f610-ebc5-4803-8f0c-a61c3bdc7faf",
    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"
    ),
)
{
   "order": {
      "id": "ea7eae96-2c25-404f-b043-bfc08584610d",
      "team_id": "c26a9cc7-cdff-4f23-a5f6-74d40088c16a",
      "user_id": "63661a2b-2bb3-4125-bb1a-b590f64f057f",
      "patient_details": {
         "dob": "2020-01-01",
         "gender": "male"
      },
      "patient_address": {
         "receiver_name": "John Doe",
         "first_line": "123 Main St.",
         "second_line": "Apt. 208",
         "city": "San Francisco",
         "state": "CA",
         "zip": "91189",
         "country": "United States",
         "phone_number": "+1123456789"
      },
      "priority": false,
      "health_insurance_id": "33ec11aa-d8bf-4f46-950d-c9171be3c22f",
      "details": {
         "type": "testkit",
         "data": {
         "id": "a655f0e4-6405-4a1d-80b7-66f06c2108a7",
         "shipment": {
            "id": "d55210cc-3d9f-4115-8262-5013f700c7be",
            "outbound_tracking_number": "<outbound_tracking_number>",
            "outbound_tracking_url": "<outbound_tracking_url>",
            "inbound_tracking_number": "<inbound_tracking_number>",
            "inbound_tracking_url": "<inbound_tracking_url>",
            "outbound_courier": "usps",
            "inbound_courier": "usps",
            "notes": "<notes>",
            "created_at": "2020-01-01T00:00:00.000Z",
            "updated_at": "2020-01-01T00:00:00.000Z"
         },
         "created_at": "2020-01-01T00:00:00Z",
         "updated_at": "2020-01-01T00:00:00Z"
         }
      },
      "lab_test": {
         "name": "Lipids Panel",
         "description": "Cholesterol test",
         "method": "testkit"
      },
      "sample_id": "123456789",
      "notes": "This is a note",
      "created_at": "2020-01-01T00:00:00Z",
      "updated_at": "2020-01-01T00:00:00Z",
      "status": "collecting_sample",
      "events": [
         {
         "id": 1,
         "created_at": "2022-01-01T00:00:00Z",
         "status": "received.testkit.ordered"
         },
         {
         "id": 2,
         "created_at": "2022-01-02T00:00:00Z",
         "status": "received.testkit.requisition_created"
         },
         {
         "id": 3,
         "created_at": "2022-01-03T00:00:00Z",
         "status": "collecting_sample.testkit.transit_customer"
         }
      ]
   },
   "status": "string",
   "message": "string"
}

Authorizations

x-vital-api-key
string
headerrequired

Vital Team API Key

Body

application/json
user_id
string
required
lab_test_id
string
required
physician
object
health_insurance
object
priority
boolean
default: false

Defines whether order is priority or not. For some labs, this refers to a STAT order.

consents
object[]
activate_by
string

Schedule an Order to be processed in a future date.

aoe_answers
object[]
patient_details
object
required
patient_address
object
required

Response

200 - application/json
order
object
required
status
string
required
message
string
required