Lab Testing
Create Order
POST

/v3/order

x-vital-api-key*
curl --request POST \
  --url https://api.tryvital.io/v3/order \
  --header 'x-vital-api-key: <x-vital-api-key>' \
  --data '{
  "user_id": "<user_id>",
  "lab_test_id": "<lab_test_id>",
  "patient_details": {
    "dob": "<dob>",
    "gender": "<gender>"
  },
  "patient_address": {
    "street": "<street>",
    "city": "<city>",
    "state": "<state>",
    "zip": "<zip>",
    "country": "<country>"
  }
}'
from vital import Client

client = Client(api_key, "sandbox")

data = client.LabTests.create_order(
    user_id="63661a2b-2bb3-4125-bb1a-b590f64f057f",
    lab_test_id="5b41f610-ebc5-4803-8f0c-a61c3bdc7faf",
    patient_details={
        "first_name": "John",
        "last_name": "Doe",
        "dob": "2020-01-01",
        "gender": "male",
        "phone_number": "+1123456789",
        "email": "string"
    },
    patient_address={
      "receiver_name": "john Doe",
      "street": "123 Main St.",
      "street_number": "Apt. 208",
      "city": "San Francisco",
      "state": "CA",
      "zip": "91189",
      "country": "US"
    },
    health_insurance={
      "front_image": {
         "content": "base64-encoded insurance front image binary content",
         "content_type": "image/png | image/jpg | image/jpeg",
      },
      "back_image": {
         "content": "base64-encoded insurance back image binary content",
         "content_type": "image/png",
      },
    },
    consents=[
      {"consentType": "terms-of-use"},
      {"consentType": "telehealth-informed-consent"},
      {"consentType": "notice-of-privacy-practices"},
    ],
    intakes=[
      {
         "linkId": "red-flag-attestation",
         "answer": [
            {"valueBoolean": True}
         ]
      }
    ]
)

[
   {
   "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"
      },
      "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"
   }
]

​
Body

user_idrequired
string

User Id

lab_test_idrequired
string

Lab Test Id

physician
object

PhysicianBase

health_insurance
object

HealthInsuranceCreateRequest

consents
array
intakes
array
related_person
array
patient_detailsrequired
object

PatientDetailsCompatible

patient_addressrequired
object

PatientAddressCompatible

​
Response

orderrequired
object

ClientFacingOrder

statusrequired
string

Status

messagerequired
string

Message