Orders
At-home Phlebotomy
Patient Service Center (PSC)
Tests
Health Insurance
Cancel Order
POST cancel order
from vital import Client
client = Client(
api_key=<API_KEY>,
environment="sandbox",
region="us"
)
data = client.LabTests.cancel_order(order_id='<order_id>');
[
{
"order": {
"title": "ClientFacingOrder",
"required": [
"user_id",
"id",
"team_id",
"patient_details",
"patient_address",
"lab_test",
"details",
"created_at",
"updated_at",
"events"
],
"type": "object",
"properties": {
"user_id": {
"title": "User Id",
"type": "string",
"description": "User id returned by vital create user request. This id should be stored in your database against the user and used for all interactions with the vital api.",
"format": "uuid"
},
"user_key": {
"title": "User Key",
"type": "string",
"description": "User key returned by vital create user key request. This key should be stored in your database against the user and used for all interactions with the vital api.",
"format": "uuid",
"deprecated": true
},
"id": {
"title": "Id",
"type": "string",
"description": "The Vital Order ID",
"format": "uuid"
},
"team_id": {
"title": "Team Id",
"type": "string",
"description": "Your team id.",
"format": "uuid"
},
"patient_details": {
"title": "Patient Details",
"allOf": [
{
"title": "PatientDetails",
"required": ["dob", "gender"],
"type": "object",
"properties": {
"dob": {
"title": "Dob",
"type": "string",
"format": "date-time"
},
"gender": {
"title": "Gender",
"type": "string"
},
"email": {
"title": "Email",
"type": "string"
}
}
}
],
"description": "Patient Details"
},
"patient_address": {
"title": "Patient Address",
"allOf": [
{
"title": "PatientAddress",
"required": [
"receiver_name",
"street",
"city",
"state",
"zip",
"country",
"phone_number"
],
"type": "object",
"properties": {
"receiver_name": {
"title": "Receiver Name",
"type": "string"
},
"street": {
"title": "Street",
"type": "string"
},
"street_number": {
"title": "Street Number",
"type": "string"
},
"city": {
"title": "City",
"type": "string"
},
"state": {
"title": "State",
"type": "string"
},
"zip": {
"title": "Zip",
"type": "string"
},
"country": {
"title": "Country",
"type": "string"
},
"phone_number": {
"title": "Phone Number",
"type": "string"
}
}
}
],
"description": "Patient Address"
},
"lab_test": {
"title": "Lab Test",
"allOf": [
{
"title": "LabTestInDB",
"required": [
"slug",
"name",
"sample_type",
"method",
"lab_id",
"price",
"is_active",
"created_at",
"updated_at",
"id"
],
"type": "object",
"properties": {
"slug": {
"title": "Slug",
"type": "string"
},
"name": {
"title": "Name",
"type": "string"
},
"description": {
"title": "Description",
"type": "string"
},
"sample_type": {
"title": "LabTestSampleType",
"enum": ["dried_blood_spot"],
"type": "string",
"description": "The type of sample used to perform a lab test."
},
"method": {
"title": "LabTestMethod",
"enum": ["testkit", "walk_in_test"],
"type": "string",
"description": "The method used to perform a lab test."
},
"lab_id": {
"title": "Lab Id",
"type": "integer"
},
"skus": {
"title": "Skus",
"type": "array",
"items": {
"type": "object"
}
},
"price": {
"title": "Price",
"type": "number"
},
"is_active": {
"title": "Is Active",
"type": "boolean"
},
"turnaround_time_lower": {
"title": "Turnaround Time Lower",
"type": "integer"
},
"turnaround_time_upper": {
"title": "Turnaround Time Upper",
"type": "integer"
},
"created_at": {
"title": "Created At",
"type": "string",
"format": "date-time"
},
"updated_at": {
"title": "Updated At",
"type": "string",
"format": "date-time"
},
"id": {
"title": "Id",
"type": "string",
"format": "uuid"
},
"lab": {
"title": "LabInDB",
"required": [
"slug",
"name",
"first_line_address",
"city",
"zipcode",
"id"
],
"type": "object",
"properties": {
"slug": {
"title": "Slug",
"type": "string"
},
"name": {
"title": "Name",
"type": "string"
},
"first_line_address": {
"title": "First Line Address",
"type": "string"
},
"city": {
"title": "City",
"type": "string"
},
"zipcode": {
"title": "Zipcode",
"type": "string"
},
"clia": {
"title": "Clia",
"type": "string"
},
"created_at": {
"title": "Created At",
"type": "string",
"format": "date-time"
},
"updated_at": {
"title": "Updated At",
"type": "string",
"format": "date-time"
},
"id": {
"title": "Id",
"type": "integer"
}
}
},
"markers": {
"title": "Markers",
"type": "array",
"items": {
"title": "MarkerInDB",
"required": ["name", "slug", "description", "id"],
"type": "object",
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"slug": {
"title": "Slug",
"type": "string"
},
"description": {
"title": "Description",
"type": "string"
},
"created_at": {
"title": "Created At",
"type": "string",
"format": "date-time"
},
"updated_at": {
"title": "Updated At",
"type": "string",
"format": "date-time"
},
"id": {
"title": "Id",
"type": "integer"
}
}
}
}
},
"description": "Schema for a LabTest in the database."
}
],
"description": "The Vital Test associated with the order"
},
"details": {
"title": "Details",
"anyOf": [
{
"title": "ClientFacingWalkInOrderDetails",
"required": ["type"],
"type": "object",
"properties": {
"type": {
"title": "Type",
"enum": ["walk_in_test"],
"type": "string"
},
"data": {
"title": "ClientFacingWalkInTestOrder",
"required": ["id", "created_at", "updated_at"],
"type": "object",
"properties": {
"id": {
"title": "Id",
"type": "string",
"description": "The Vital walk-in test Order ID",
"format": "uuid"
},
"created_at": {
"title": "Created At",
"type": "string",
"format": "date-time"
},
"updated_at": {
"title": "Updated At",
"type": "string",
"format": "date-time"
}
},
"description": "Schema for a walk-in test order in the client facing API.\n\nTo be used as part of a ClientFacingOrder.",
"example": {
"id": "0651ee15-31a1-461b-9c10-86aa960da6c9",
"created_at": "2020-01-01T00:00:00Z",
"updated_at": "2020-01-01T00:00:00Z"
}
}
}
},
{
"title": "ClientFacingTestKitOrderDetails",
"required": ["type"],
"type": "object",
"properties": {
"type": {
"title": "Type",
"enum": ["testkit"],
"type": "string"
},
"data": {
"title": "ClientFacingTestkitOrder",
"required": ["id", "created_at", "updated_at"],
"type": "object",
"properties": {
"id": {
"title": "Id",
"type": "string",
"description": "The Vital TestKit Order ID",
"format": "uuid"
},
"shipment": {
"title": "Shipment",
"allOf": [
{
"title": "ClientFacingShipment",
"required": [
"id",
"outbound_tracking_number",
"outbound_tracking_url",
"inbound_tracking_number",
"inbound_tracking_url",
"outbound_courier",
"inbound_courier",
"notes"
],
"type": "object",
"properties": {
"id": {
"title": "Id",
"type": "string",
"description": "The Vital Shipment ID",
"format": "uuid"
},
"outbound_tracking_number": {
"title": "Outbound Tracking Number",
"type": "string",
"description": "Tracking number for delivery to customer"
},
"outbound_tracking_url": {
"title": "Outbound Tracking Url",
"type": "string",
"description": "Tracking url for delivery to customer"
},
"inbound_tracking_number": {
"title": "Inbound Tracking Number",
"type": "string",
"description": "Tracking number for delivery to lab"
},
"inbound_tracking_url": {
"title": "Inbound Tracking Url",
"type": "string",
"description": "Tracking url for delivery to lab"
},
"outbound_courier": {
"title": "Outbound Courier",
"type": "string",
"description": "Courier used for delivery to customer"
},
"inbound_courier": {
"title": "Inbound Courier",
"type": "string",
"description": "Courier used for delivery to lab"
},
"notes": {
"title": "Notes",
"type": "string",
"description": "Notes associated to the Vital shipment"
}
},
"description": "Schema for a Shipment in the client facing API.\n\nTo be used as part of a ClientFacingTestkitOrder.",
"example": {
"id": "dcab86c6-a315-493d-97aa-2fd0fa649130",
"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>"
}
}
],
"description": "Shipment object"
},
"created_at": {
"title": "Created At",
"type": "string",
"format": "date-time"
},
"updated_at": {
"title": "Updated At",
"type": "string",
"format": "date-time"
}
},
"description": "Schema for a testkit order in the client facing API.\n\nTo be used as part of a ClientFacingOrder.",
"example": {
"id": "43697a79-298f-43db-9703-e4cf16006c66",
"shipment": {
"id": "51caeb91-cc5c-4f82-a4c2-6f23b68e54c5",
"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"
}
}
}
}
]
},
"sample_id": {
"title": "Sample Id",
"type": "string",
"description": "Sample ID"
},
"notes": {
"title": "Notes",
"type": "string",
"description": "Notes associated with the order"
},
"created_at": {
"title": "Created At",
"type": "string",
"description": "When your order was created",
"format": "date-time"
},
"updated_at": {
"title": "Updated At",
"type": "string",
"description": "When your order was last updated",
"format": "date-time"
},
"events": {
"title": "Events",
"type": "array",
"items": {
"title": "ClientFacingOrderEvent",
"required": ["id", "created_at", "status"],
"type": "object",
"properties": {
"id": {
"title": "Id",
"type": "integer"
},
"created_at": {
"title": "Created At",
"type": "string",
"format": "date-time"
},
"status": {
"title": "OrderV2Status",
"enum": [
"received.walk_in_test.requisition_created",
"completed.walk_in_test.order_completed",
"failed.walk_in_test.sample_error",
"received.testkit.ordered",
"received.testkit.requisition_created",
"collecting_sample.testkit.transit_customer",
"collecting_sample.testkit.out_for_delivery",
"collecting_sample.testkit.with_customer",
"collecting_sample.testkit.transit_lab",
"collecting_sample.testkit.problem_in_transit_customer",
"collecting_sample.testkit.problem_in_transit_lab",
"sample_with_lab.testkit.delivered_to_lab",
"completed.testkit.completed",
"failed.testkit.failure_to_deliver_to_customer",
"failed.testkit.failure_to_deliver_to_lab",
"failed.testkit.sample_error",
"failed.testkit.lost",
"cancelled.testkit.cancelled",
"cancelled.testkit.do_not_process"
],
"type": "string",
"description": "An enumeration."
}
}
}
},
"status": {
"title": "OrderV2TopLevelStatus",
"enum": [
"received",
"collecting_sample",
"sample_with_lab",
"completed",
"cancelled",
"failed"
],
"type": "string",
"description": "An enumeration."
}
},
"example": {
"id": "0ee312e2-6773-4a21-a6e1-506882cd98ed",
"team_id": "cbb64555-af07-46c1-be09-ef89308e9b60",
"user_id": "94e2d9f2-d600-4a23-9f08-536df378e2c7",
"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"
},
"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": {
"title": "Status",
"type": "string"
},
"message": {
"title": "Message",
"type": "string"
}
}
]
from vital import Client
client = Client(
api_key=<API_KEY>,
environment="sandbox",
region="us"
)
data = client.LabTests.cancel_order(order_id='<order_id>');
[
{
"order": {
"title": "ClientFacingOrder",
"required": [
"user_id",
"id",
"team_id",
"patient_details",
"patient_address",
"lab_test",
"details",
"created_at",
"updated_at",
"events"
],
"type": "object",
"properties": {
"user_id": {
"title": "User Id",
"type": "string",
"description": "User id returned by vital create user request. This id should be stored in your database against the user and used for all interactions with the vital api.",
"format": "uuid"
},
"user_key": {
"title": "User Key",
"type": "string",
"description": "User key returned by vital create user key request. This key should be stored in your database against the user and used for all interactions with the vital api.",
"format": "uuid",
"deprecated": true
},
"id": {
"title": "Id",
"type": "string",
"description": "The Vital Order ID",
"format": "uuid"
},
"team_id": {
"title": "Team Id",
"type": "string",
"description": "Your team id.",
"format": "uuid"
},
"patient_details": {
"title": "Patient Details",
"allOf": [
{
"title": "PatientDetails",
"required": ["dob", "gender"],
"type": "object",
"properties": {
"dob": {
"title": "Dob",
"type": "string",
"format": "date-time"
},
"gender": {
"title": "Gender",
"type": "string"
},
"email": {
"title": "Email",
"type": "string"
}
}
}
],
"description": "Patient Details"
},
"patient_address": {
"title": "Patient Address",
"allOf": [
{
"title": "PatientAddress",
"required": [
"receiver_name",
"street",
"city",
"state",
"zip",
"country",
"phone_number"
],
"type": "object",
"properties": {
"receiver_name": {
"title": "Receiver Name",
"type": "string"
},
"street": {
"title": "Street",
"type": "string"
},
"street_number": {
"title": "Street Number",
"type": "string"
},
"city": {
"title": "City",
"type": "string"
},
"state": {
"title": "State",
"type": "string"
},
"zip": {
"title": "Zip",
"type": "string"
},
"country": {
"title": "Country",
"type": "string"
},
"phone_number": {
"title": "Phone Number",
"type": "string"
}
}
}
],
"description": "Patient Address"
},
"lab_test": {
"title": "Lab Test",
"allOf": [
{
"title": "LabTestInDB",
"required": [
"slug",
"name",
"sample_type",
"method",
"lab_id",
"price",
"is_active",
"created_at",
"updated_at",
"id"
],
"type": "object",
"properties": {
"slug": {
"title": "Slug",
"type": "string"
},
"name": {
"title": "Name",
"type": "string"
},
"description": {
"title": "Description",
"type": "string"
},
"sample_type": {
"title": "LabTestSampleType",
"enum": ["dried_blood_spot"],
"type": "string",
"description": "The type of sample used to perform a lab test."
},
"method": {
"title": "LabTestMethod",
"enum": ["testkit", "walk_in_test"],
"type": "string",
"description": "The method used to perform a lab test."
},
"lab_id": {
"title": "Lab Id",
"type": "integer"
},
"skus": {
"title": "Skus",
"type": "array",
"items": {
"type": "object"
}
},
"price": {
"title": "Price",
"type": "number"
},
"is_active": {
"title": "Is Active",
"type": "boolean"
},
"turnaround_time_lower": {
"title": "Turnaround Time Lower",
"type": "integer"
},
"turnaround_time_upper": {
"title": "Turnaround Time Upper",
"type": "integer"
},
"created_at": {
"title": "Created At",
"type": "string",
"format": "date-time"
},
"updated_at": {
"title": "Updated At",
"type": "string",
"format": "date-time"
},
"id": {
"title": "Id",
"type": "string",
"format": "uuid"
},
"lab": {
"title": "LabInDB",
"required": [
"slug",
"name",
"first_line_address",
"city",
"zipcode",
"id"
],
"type": "object",
"properties": {
"slug": {
"title": "Slug",
"type": "string"
},
"name": {
"title": "Name",
"type": "string"
},
"first_line_address": {
"title": "First Line Address",
"type": "string"
},
"city": {
"title": "City",
"type": "string"
},
"zipcode": {
"title": "Zipcode",
"type": "string"
},
"clia": {
"title": "Clia",
"type": "string"
},
"created_at": {
"title": "Created At",
"type": "string",
"format": "date-time"
},
"updated_at": {
"title": "Updated At",
"type": "string",
"format": "date-time"
},
"id": {
"title": "Id",
"type": "integer"
}
}
},
"markers": {
"title": "Markers",
"type": "array",
"items": {
"title": "MarkerInDB",
"required": ["name", "slug", "description", "id"],
"type": "object",
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"slug": {
"title": "Slug",
"type": "string"
},
"description": {
"title": "Description",
"type": "string"
},
"created_at": {
"title": "Created At",
"type": "string",
"format": "date-time"
},
"updated_at": {
"title": "Updated At",
"type": "string",
"format": "date-time"
},
"id": {
"title": "Id",
"type": "integer"
}
}
}
}
},
"description": "Schema for a LabTest in the database."
}
],
"description": "The Vital Test associated with the order"
},
"details": {
"title": "Details",
"anyOf": [
{
"title": "ClientFacingWalkInOrderDetails",
"required": ["type"],
"type": "object",
"properties": {
"type": {
"title": "Type",
"enum": ["walk_in_test"],
"type": "string"
},
"data": {
"title": "ClientFacingWalkInTestOrder",
"required": ["id", "created_at", "updated_at"],
"type": "object",
"properties": {
"id": {
"title": "Id",
"type": "string",
"description": "The Vital walk-in test Order ID",
"format": "uuid"
},
"created_at": {
"title": "Created At",
"type": "string",
"format": "date-time"
},
"updated_at": {
"title": "Updated At",
"type": "string",
"format": "date-time"
}
},
"description": "Schema for a walk-in test order in the client facing API.\n\nTo be used as part of a ClientFacingOrder.",
"example": {
"id": "0651ee15-31a1-461b-9c10-86aa960da6c9",
"created_at": "2020-01-01T00:00:00Z",
"updated_at": "2020-01-01T00:00:00Z"
}
}
}
},
{
"title": "ClientFacingTestKitOrderDetails",
"required": ["type"],
"type": "object",
"properties": {
"type": {
"title": "Type",
"enum": ["testkit"],
"type": "string"
},
"data": {
"title": "ClientFacingTestkitOrder",
"required": ["id", "created_at", "updated_at"],
"type": "object",
"properties": {
"id": {
"title": "Id",
"type": "string",
"description": "The Vital TestKit Order ID",
"format": "uuid"
},
"shipment": {
"title": "Shipment",
"allOf": [
{
"title": "ClientFacingShipment",
"required": [
"id",
"outbound_tracking_number",
"outbound_tracking_url",
"inbound_tracking_number",
"inbound_tracking_url",
"outbound_courier",
"inbound_courier",
"notes"
],
"type": "object",
"properties": {
"id": {
"title": "Id",
"type": "string",
"description": "The Vital Shipment ID",
"format": "uuid"
},
"outbound_tracking_number": {
"title": "Outbound Tracking Number",
"type": "string",
"description": "Tracking number for delivery to customer"
},
"outbound_tracking_url": {
"title": "Outbound Tracking Url",
"type": "string",
"description": "Tracking url for delivery to customer"
},
"inbound_tracking_number": {
"title": "Inbound Tracking Number",
"type": "string",
"description": "Tracking number for delivery to lab"
},
"inbound_tracking_url": {
"title": "Inbound Tracking Url",
"type": "string",
"description": "Tracking url for delivery to lab"
},
"outbound_courier": {
"title": "Outbound Courier",
"type": "string",
"description": "Courier used for delivery to customer"
},
"inbound_courier": {
"title": "Inbound Courier",
"type": "string",
"description": "Courier used for delivery to lab"
},
"notes": {
"title": "Notes",
"type": "string",
"description": "Notes associated to the Vital shipment"
}
},
"description": "Schema for a Shipment in the client facing API.\n\nTo be used as part of a ClientFacingTestkitOrder.",
"example": {
"id": "dcab86c6-a315-493d-97aa-2fd0fa649130",
"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>"
}
}
],
"description": "Shipment object"
},
"created_at": {
"title": "Created At",
"type": "string",
"format": "date-time"
},
"updated_at": {
"title": "Updated At",
"type": "string",
"format": "date-time"
}
},
"description": "Schema for a testkit order in the client facing API.\n\nTo be used as part of a ClientFacingOrder.",
"example": {
"id": "43697a79-298f-43db-9703-e4cf16006c66",
"shipment": {
"id": "51caeb91-cc5c-4f82-a4c2-6f23b68e54c5",
"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"
}
}
}
}
]
},
"sample_id": {
"title": "Sample Id",
"type": "string",
"description": "Sample ID"
},
"notes": {
"title": "Notes",
"type": "string",
"description": "Notes associated with the order"
},
"created_at": {
"title": "Created At",
"type": "string",
"description": "When your order was created",
"format": "date-time"
},
"updated_at": {
"title": "Updated At",
"type": "string",
"description": "When your order was last updated",
"format": "date-time"
},
"events": {
"title": "Events",
"type": "array",
"items": {
"title": "ClientFacingOrderEvent",
"required": ["id", "created_at", "status"],
"type": "object",
"properties": {
"id": {
"title": "Id",
"type": "integer"
},
"created_at": {
"title": "Created At",
"type": "string",
"format": "date-time"
},
"status": {
"title": "OrderV2Status",
"enum": [
"received.walk_in_test.requisition_created",
"completed.walk_in_test.order_completed",
"failed.walk_in_test.sample_error",
"received.testkit.ordered",
"received.testkit.requisition_created",
"collecting_sample.testkit.transit_customer",
"collecting_sample.testkit.out_for_delivery",
"collecting_sample.testkit.with_customer",
"collecting_sample.testkit.transit_lab",
"collecting_sample.testkit.problem_in_transit_customer",
"collecting_sample.testkit.problem_in_transit_lab",
"sample_with_lab.testkit.delivered_to_lab",
"completed.testkit.completed",
"failed.testkit.failure_to_deliver_to_customer",
"failed.testkit.failure_to_deliver_to_lab",
"failed.testkit.sample_error",
"failed.testkit.lost",
"cancelled.testkit.cancelled",
"cancelled.testkit.do_not_process"
],
"type": "string",
"description": "An enumeration."
}
}
}
},
"status": {
"title": "OrderV2TopLevelStatus",
"enum": [
"received",
"collecting_sample",
"sample_with_lab",
"completed",
"cancelled",
"failed"
],
"type": "string",
"description": "An enumeration."
}
},
"example": {
"id": "0ee312e2-6773-4a21-a6e1-506882cd98ed",
"team_id": "cbb64555-af07-46c1-be09-ef89308e9b60",
"user_id": "94e2d9f2-d600-4a23-9f08-536df378e2c7",
"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"
},
"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": {
"title": "Status",
"type": "string"
},
"message": {
"title": "Message",
"type": "string"
}
}
]
Authorizations
Vital Team API Key
Path Parameters
Your Order ID.
Response
User id returned by vital create user request. This id should be stored in your database against the user and used for all interactions with the vital api.
The Vital Order ID
Your team id.
Patient Details
Parent/medical_proxy details. Required if patient is a minor.
If not provided, will be set to 'Not Specified'
african_american_or_black
, asian
, indigenous_native_american_alaska_native
, other
, pacific_islander_or_hawaiian
, white_caucasian
If not provided, will be set to 'Not Specified'
hispanic
, non_hispanic
, ashkenazi_jewish
, other
If not provided, will be set to 'Not Specified'
lesbian_gay_or_homosexual
, heterosexual_or_straight
, bisexual
, dont_know
, other
If not provided, will be set to 'Not Specified'
male
, female
, female_to_male_ftm_transgender_male_trans_man
, male_to_female_mtf_transgender_female_trans_woman
, genderqueer
, other
Patient Address
The Vital Test associated with the order
dried_blood_spot
, arm_collector
, serum
, saliva
, urine
testkit
, walk_in_test
, at_home_phlebotomy
Deprecated. Use status instead.
active
, pending_approval
, inactive
The method used to perform a lab test. ℹ️ This enum is non-exhaustive.
testkit
, walk_in_test
, at_home_phlebotomy
The type of sample used to perform a lab test. ℹ️ This enum is non-exhaustive.
dried_blood_spot
, arm_collector
, serum
, saliva
, urine
{
"city": "San Francisco",
"collection_methods": ["testkit"],
"first_line_address": "123 Main St",
"id": 1,
"name": "LabCorp",
"sample_types": ["saliva"],
"slug": "labcorp",
"zipcode": "91789"
}
ℹ️ This enum is non-exhaustive.
biomarker
, panel
Defines whether a lab test requires fasting.
Denotes whether a lab test requires using non-Vital physician networks. If it does then it's delegated - no otherwise.
Whether the lab test was auto-generated by Vital
{
"lab_test": {
"description": "Cholesterol test",
"fasting": false,
"is_delegated": false,
"lab": {
"city": "New York",
"first_line_address": "123 Main St",
"name": "US Specialty Lab",
"slug": "USSL",
"zipcode": "10001"
},
"markers": [
{
"description": "Hemoglobin A1c is a form of hemoglobin that is measured identify your average blood sugar levels over the past 3 months.",
"id": 1,
"lab_id": 1,
"name": "Hemoglobin A1c",
"price": "10.00",
"provider_id": "1234",
"slug": "hemoglobin-a1c",
"type": "biomarker",
"unit": "%"
}
],
"method": "testkit",
"name": "Lipids Panel",
"price": 10,
"sample_type": "dried blood spot",
"status": "active"
}
}
"walk_in_test"
Schema for a walk-in test order in the client facing API.
To be used as part of a ClientFacingOrder.
{
"appointment_id": "ba72deb6-74dd-4db7-99c2-e57c969c7c16",
"created_at": "2020-01-01T00:00:00Z",
"id": "1f69ce6a-e21c-445a-91f7-9803c8460495",
"updated_at": "2020-01-01T00:00:00Z"
}
Sample ID
Notes associated with the order
When your order was created
When your order was last updated.
ℹ️ This enum is non-exhaustive.
received.walk_in_test.ordered
, received.walk_in_test.requisition_created
, received.walk_in_test.requisition_bypassed
, completed.walk_in_test.completed
, sample_with_lab.walk_in_test.partial_results
, failed.walk_in_test.sample_error
, cancelled.walk_in_test.cancelled
, collecting_sample.walk_in_test.appointment_pending
, collecting_sample.walk_in_test.appointment_scheduled
, collecting_sample.walk_in_test.appointment_cancelled
, received.at_home_phlebotomy.ordered
, received.at_home_phlebotomy.requisition_created
, received.at_home_phlebotomy.requisition_bypassed
, collecting_sample.at_home_phlebotomy.appointment_pending
, collecting_sample.at_home_phlebotomy.appointment_scheduled
, collecting_sample.at_home_phlebotomy.draw_completed
, collecting_sample.at_home_phlebotomy.appointment_cancelled
, completed.at_home_phlebotomy.completed
, sample_with_lab.at_home_phlebotomy.partial_results
, cancelled.at_home_phlebotomy.cancelled
, failed.at_home_phlebotomy.sample_error
, received.testkit.ordered
, received.testkit.awaiting_registration
, received.testkit.requisition_created
, received.testkit.requisition_bypassed
, received.testkit.registered
, collecting_sample.testkit.transit_customer
, collecting_sample.testkit.out_for_delivery
, collecting_sample.testkit.with_customer
, collecting_sample.testkit.transit_lab
, sample_with_lab.testkit.delivered_to_lab
, completed.testkit.completed
, failed.testkit.failure_to_deliver_to_customer
, failed.testkit.failure_to_deliver_to_lab
, failed.testkit.sample_error
, failed.testkit.lost
, cancelled.testkit.cancelled
, cancelled.testkit.do_not_process
, collecting_sample.testkit.problem_in_transit_customer
, collecting_sample.testkit.problem_in_transit_lab
Vital ID of the health insurance.
DEPRECATED. Requistion form url.
Shipping Details. For unregistered testkit orders.
Defines whether the order has an Advanced Beneficiary Notice (ABN) form or not.
ℹ️ This enum is non-exhaustive.
received
, collecting_sample
, sample_with_lab
, completed
, cancelled
, failed
Defines whether order is priority or not. For some labs, this refers to a STAT order.
Schedule an Order to be processed in a future date.
ℹ️ This enum is non-exhaustive.
client_bill
, commercial_insurance
, patient_bill_passthrough
, patient_bill
{
"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": "588f338a-9472-47fa-8ba8-76fa6bc5f648",
"id": "d54f0790-452d-4238-a55e-ca0b7970b25e",
"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": "7d0a12e8-3442-4d32-a2f8-08ce0b022f12",
"updated_at": "2020-01-01T00:00:00Z",
"user_id": "d41dce42-e16a-43d2-b2f1-f1eb032d75c9"
}
from vital import Client
client = Client(
api_key=<API_KEY>,
environment="sandbox",
region="us"
)
data = client.LabTests.cancel_order(order_id='<order_id>');
[
{
"order": {
"title": "ClientFacingOrder",
"required": [
"user_id",
"id",
"team_id",
"patient_details",
"patient_address",
"lab_test",
"details",
"created_at",
"updated_at",
"events"
],
"type": "object",
"properties": {
"user_id": {
"title": "User Id",
"type": "string",
"description": "User id returned by vital create user request. This id should be stored in your database against the user and used for all interactions with the vital api.",
"format": "uuid"
},
"user_key": {
"title": "User Key",
"type": "string",
"description": "User key returned by vital create user key request. This key should be stored in your database against the user and used for all interactions with the vital api.",
"format": "uuid",
"deprecated": true
},
"id": {
"title": "Id",
"type": "string",
"description": "The Vital Order ID",
"format": "uuid"
},
"team_id": {
"title": "Team Id",
"type": "string",
"description": "Your team id.",
"format": "uuid"
},
"patient_details": {
"title": "Patient Details",
"allOf": [
{
"title": "PatientDetails",
"required": ["dob", "gender"],
"type": "object",
"properties": {
"dob": {
"title": "Dob",
"type": "string",
"format": "date-time"
},
"gender": {
"title": "Gender",
"type": "string"
},
"email": {
"title": "Email",
"type": "string"
}
}
}
],
"description": "Patient Details"
},
"patient_address": {
"title": "Patient Address",
"allOf": [
{
"title": "PatientAddress",
"required": [
"receiver_name",
"street",
"city",
"state",
"zip",
"country",
"phone_number"
],
"type": "object",
"properties": {
"receiver_name": {
"title": "Receiver Name",
"type": "string"
},
"street": {
"title": "Street",
"type": "string"
},
"street_number": {
"title": "Street Number",
"type": "string"
},
"city": {
"title": "City",
"type": "string"
},
"state": {
"title": "State",
"type": "string"
},
"zip": {
"title": "Zip",
"type": "string"
},
"country": {
"title": "Country",
"type": "string"
},
"phone_number": {
"title": "Phone Number",
"type": "string"
}
}
}
],
"description": "Patient Address"
},
"lab_test": {
"title": "Lab Test",
"allOf": [
{
"title": "LabTestInDB",
"required": [
"slug",
"name",
"sample_type",
"method",
"lab_id",
"price",
"is_active",
"created_at",
"updated_at",
"id"
],
"type": "object",
"properties": {
"slug": {
"title": "Slug",
"type": "string"
},
"name": {
"title": "Name",
"type": "string"
},
"description": {
"title": "Description",
"type": "string"
},
"sample_type": {
"title": "LabTestSampleType",
"enum": ["dried_blood_spot"],
"type": "string",
"description": "The type of sample used to perform a lab test."
},
"method": {
"title": "LabTestMethod",
"enum": ["testkit", "walk_in_test"],
"type": "string",
"description": "The method used to perform a lab test."
},
"lab_id": {
"title": "Lab Id",
"type": "integer"
},
"skus": {
"title": "Skus",
"type": "array",
"items": {
"type": "object"
}
},
"price": {
"title": "Price",
"type": "number"
},
"is_active": {
"title": "Is Active",
"type": "boolean"
},
"turnaround_time_lower": {
"title": "Turnaround Time Lower",
"type": "integer"
},
"turnaround_time_upper": {
"title": "Turnaround Time Upper",
"type": "integer"
},
"created_at": {
"title": "Created At",
"type": "string",
"format": "date-time"
},
"updated_at": {
"title": "Updated At",
"type": "string",
"format": "date-time"
},
"id": {
"title": "Id",
"type": "string",
"format": "uuid"
},
"lab": {
"title": "LabInDB",
"required": [
"slug",
"name",
"first_line_address",
"city",
"zipcode",
"id"
],
"type": "object",
"properties": {
"slug": {
"title": "Slug",
"type": "string"
},
"name": {
"title": "Name",
"type": "string"
},
"first_line_address": {
"title": "First Line Address",
"type": "string"
},
"city": {
"title": "City",
"type": "string"
},
"zipcode": {
"title": "Zipcode",
"type": "string"
},
"clia": {
"title": "Clia",
"type": "string"
},
"created_at": {
"title": "Created At",
"type": "string",
"format": "date-time"
},
"updated_at": {
"title": "Updated At",
"type": "string",
"format": "date-time"
},
"id": {
"title": "Id",
"type": "integer"
}
}
},
"markers": {
"title": "Markers",
"type": "array",
"items": {
"title": "MarkerInDB",
"required": ["name", "slug", "description", "id"],
"type": "object",
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"slug": {
"title": "Slug",
"type": "string"
},
"description": {
"title": "Description",
"type": "string"
},
"created_at": {
"title": "Created At",
"type": "string",
"format": "date-time"
},
"updated_at": {
"title": "Updated At",
"type": "string",
"format": "date-time"
},
"id": {
"title": "Id",
"type": "integer"
}
}
}
}
},
"description": "Schema for a LabTest in the database."
}
],
"description": "The Vital Test associated with the order"
},
"details": {
"title": "Details",
"anyOf": [
{
"title": "ClientFacingWalkInOrderDetails",
"required": ["type"],
"type": "object",
"properties": {
"type": {
"title": "Type",
"enum": ["walk_in_test"],
"type": "string"
},
"data": {
"title": "ClientFacingWalkInTestOrder",
"required": ["id", "created_at", "updated_at"],
"type": "object",
"properties": {
"id": {
"title": "Id",
"type": "string",
"description": "The Vital walk-in test Order ID",
"format": "uuid"
},
"created_at": {
"title": "Created At",
"type": "string",
"format": "date-time"
},
"updated_at": {
"title": "Updated At",
"type": "string",
"format": "date-time"
}
},
"description": "Schema for a walk-in test order in the client facing API.\n\nTo be used as part of a ClientFacingOrder.",
"example": {
"id": "0651ee15-31a1-461b-9c10-86aa960da6c9",
"created_at": "2020-01-01T00:00:00Z",
"updated_at": "2020-01-01T00:00:00Z"
}
}
}
},
{
"title": "ClientFacingTestKitOrderDetails",
"required": ["type"],
"type": "object",
"properties": {
"type": {
"title": "Type",
"enum": ["testkit"],
"type": "string"
},
"data": {
"title": "ClientFacingTestkitOrder",
"required": ["id", "created_at", "updated_at"],
"type": "object",
"properties": {
"id": {
"title": "Id",
"type": "string",
"description": "The Vital TestKit Order ID",
"format": "uuid"
},
"shipment": {
"title": "Shipment",
"allOf": [
{
"title": "ClientFacingShipment",
"required": [
"id",
"outbound_tracking_number",
"outbound_tracking_url",
"inbound_tracking_number",
"inbound_tracking_url",
"outbound_courier",
"inbound_courier",
"notes"
],
"type": "object",
"properties": {
"id": {
"title": "Id",
"type": "string",
"description": "The Vital Shipment ID",
"format": "uuid"
},
"outbound_tracking_number": {
"title": "Outbound Tracking Number",
"type": "string",
"description": "Tracking number for delivery to customer"
},
"outbound_tracking_url": {
"title": "Outbound Tracking Url",
"type": "string",
"description": "Tracking url for delivery to customer"
},
"inbound_tracking_number": {
"title": "Inbound Tracking Number",
"type": "string",
"description": "Tracking number for delivery to lab"
},
"inbound_tracking_url": {
"title": "Inbound Tracking Url",
"type": "string",
"description": "Tracking url for delivery to lab"
},
"outbound_courier": {
"title": "Outbound Courier",
"type": "string",
"description": "Courier used for delivery to customer"
},
"inbound_courier": {
"title": "Inbound Courier",
"type": "string",
"description": "Courier used for delivery to lab"
},
"notes": {
"title": "Notes",
"type": "string",
"description": "Notes associated to the Vital shipment"
}
},
"description": "Schema for a Shipment in the client facing API.\n\nTo be used as part of a ClientFacingTestkitOrder.",
"example": {
"id": "dcab86c6-a315-493d-97aa-2fd0fa649130",
"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>"
}
}
],
"description": "Shipment object"
},
"created_at": {
"title": "Created At",
"type": "string",
"format": "date-time"
},
"updated_at": {
"title": "Updated At",
"type": "string",
"format": "date-time"
}
},
"description": "Schema for a testkit order in the client facing API.\n\nTo be used as part of a ClientFacingOrder.",
"example": {
"id": "43697a79-298f-43db-9703-e4cf16006c66",
"shipment": {
"id": "51caeb91-cc5c-4f82-a4c2-6f23b68e54c5",
"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"
}
}
}
}
]
},
"sample_id": {
"title": "Sample Id",
"type": "string",
"description": "Sample ID"
},
"notes": {
"title": "Notes",
"type": "string",
"description": "Notes associated with the order"
},
"created_at": {
"title": "Created At",
"type": "string",
"description": "When your order was created",
"format": "date-time"
},
"updated_at": {
"title": "Updated At",
"type": "string",
"description": "When your order was last updated",
"format": "date-time"
},
"events": {
"title": "Events",
"type": "array",
"items": {
"title": "ClientFacingOrderEvent",
"required": ["id", "created_at", "status"],
"type": "object",
"properties": {
"id": {
"title": "Id",
"type": "integer"
},
"created_at": {
"title": "Created At",
"type": "string",
"format": "date-time"
},
"status": {
"title": "OrderV2Status",
"enum": [
"received.walk_in_test.requisition_created",
"completed.walk_in_test.order_completed",
"failed.walk_in_test.sample_error",
"received.testkit.ordered",
"received.testkit.requisition_created",
"collecting_sample.testkit.transit_customer",
"collecting_sample.testkit.out_for_delivery",
"collecting_sample.testkit.with_customer",
"collecting_sample.testkit.transit_lab",
"collecting_sample.testkit.problem_in_transit_customer",
"collecting_sample.testkit.problem_in_transit_lab",
"sample_with_lab.testkit.delivered_to_lab",
"completed.testkit.completed",
"failed.testkit.failure_to_deliver_to_customer",
"failed.testkit.failure_to_deliver_to_lab",
"failed.testkit.sample_error",
"failed.testkit.lost",
"cancelled.testkit.cancelled",
"cancelled.testkit.do_not_process"
],
"type": "string",
"description": "An enumeration."
}
}
}
},
"status": {
"title": "OrderV2TopLevelStatus",
"enum": [
"received",
"collecting_sample",
"sample_with_lab",
"completed",
"cancelled",
"failed"
],
"type": "string",
"description": "An enumeration."
}
},
"example": {
"id": "0ee312e2-6773-4a21-a6e1-506882cd98ed",
"team_id": "cbb64555-af07-46c1-be09-ef89308e9b60",
"user_id": "94e2d9f2-d600-4a23-9f08-536df378e2c7",
"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"
},
"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": {
"title": "Status",
"type": "string"
},
"message": {
"title": "Message",
"type": "string"
}
}
]