from junction import Junction, ShippingAddressWithValidation
from junction.environment import JunctionEnvironment
client = Junction(
api_key="YOUR_API_KEY",
environment=JunctionEnvironment.SANDBOX,
)
data = client.testkit.create_order(
user_id="63661a2b-2bb3-4125-bb1a-b590f64f057f",
lab_test_id="5b41f610-ebc5-4803-8f0c-a61c3bdc7faf",
shipping_details=ShippingAddressWithValidation(
receiver_name="John Doe",
first_line="123 Main St.",
second_line="Apt. 208",
city="San Francisco",
state="CA",
zip="91189",
country="US",
phone_number="+11234567890",
),
)
import { JunctionClient, JunctionEnvironment } from "@junction-api/sdk";
const client = new JunctionClient({
apiKey: "YOUR_API_KEY",
environment: JunctionEnvironment.Sandbox,
});
const data = await client.testkit.createOrder({
userId: "63661a2b-2bb3-4125-bb1a-b590f64f057f",
labTestId: "5b41f610-ebc5-4803-8f0c-a61c3bdc7faf",
shippingDetails: {
receiverName: "John Doe",
firstLine: "123 Main St.",
secondLine: "Apt. 208",
city: "San Francisco",
state: "CA",
zip: "91189",
country: "US",
phoneNumber: "+11234567890",
},
});
import com.junction.api.Junction;
import com.junction.api.core.Environment;
import com.junction.api.resources.testkit.requests.CreateRegistrableTestkitOrderRequest;
import com.junction.api.types.ShippingAddressWithValidation;
Junction client = Junction.builder()
.apiKey("YOUR_API_KEY")
.environment(Environment.SANDBOX)
.build();
var data = client.testkit().createOrder(
CreateRegistrableTestkitOrderRequest.builder()
.userId("63661a2b-2bb3-4125-bb1a-b590f64f057f")
.labTestId("5b41f610-ebc5-4803-8f0c-a61c3bdc7faf")
.shippingDetails(
ShippingAddressWithValidation.builder()
.receiverName("John Doe")
.firstLine("123 Main St.")
.city("San Francisco")
.state("CA")
.zip("91189")
.country("US")
.phoneNumber("+11234567890")
.build()
)
.build()
);
import (
"context"
junction "github.com/junction-api/junction-go"
"github.com/junction-api/junction-go/client"
"github.com/junction-api/junction-go/option"
)
c := client.NewClient(
option.WithApiKey("YOUR_API_KEY"),
option.WithBaseURL(junction.Environments.Sandbox),
)
response, err := c.Testkit.CreateOrder(context.TODO(), &junction.CreateRegistrableTestkitOrderRequest{
UserId: "63661a2b-2bb3-4125-bb1a-b590f64f057f",
LabTestId: "5b41f610-ebc5-4803-8f0c-a61c3bdc7faf",
ShippingDetails: &junction.ShippingAddressWithValidation{
ReceiverName: "John Doe",
FirstLine: "123 Main St.",
SecondLine: junction.String("Apt. 208"),
City: "San Francisco",
State: "CA",
Zip: "91189",
Country: "US",
PhoneNumber: "+11234567890",
},
})
if err != nil {
return err
}
fmt.Printf("Received data %s\n", response)
curl --request POST \
--url '{{BASE_URL}}/v3/order/testkit' \
--header 'Accept: application/json' \
--header 'x-vital-api-key: YOUR_API_KEY' \
--data '
{
"user_id": "63661a2b-2bb3-4125-bb1a-b590f64f057f",
"lab_test_id": "5b41f610-ebc5-4803-8f0c-a61c3bdc7faf",
"shipping_details": {
"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": "96edc6ef-3b2c-412b-b9e5-96f361f93aec",
"team_id": "b080b20c-e162-4cf1-9c7d-8faee72ee08e",
"user_id": "9f1e094e-1641-466b-b668-d4d3300e569f",
"shipping_details": {
"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": "+11234567890"
},
"details": {
"type": "testkit",
"data": {
"id": "a655f0e4-6405-4a1d-80b7-66f06c2108a7",
"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",
"health_insurance_id": "7695cc28-f9e5-400d-95d2-ec7d9ec580df",
"notes": "This is a note",
"created_at": "2020-01-01T00:00:00Z",
"updated_at": "2020-01-01T00:00:00Z",
"status": "received",
"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.awaiting_registration"
}
]
},
"status": "string",
"message": "string"
}
Orders
Create Unregistered Testkit Order
Create or submit order testkit via the Junction API. Requires authentication with your team API key.
POST
/
v3
/
order
/
testkit
from junction import Junction, ShippingAddressWithValidation
from junction.environment import JunctionEnvironment
client = Junction(
api_key="YOUR_API_KEY",
environment=JunctionEnvironment.SANDBOX,
)
data = client.testkit.create_order(
user_id="63661a2b-2bb3-4125-bb1a-b590f64f057f",
lab_test_id="5b41f610-ebc5-4803-8f0c-a61c3bdc7faf",
shipping_details=ShippingAddressWithValidation(
receiver_name="John Doe",
first_line="123 Main St.",
second_line="Apt. 208",
city="San Francisco",
state="CA",
zip="91189",
country="US",
phone_number="+11234567890",
),
)
import { JunctionClient, JunctionEnvironment } from "@junction-api/sdk";
const client = new JunctionClient({
apiKey: "YOUR_API_KEY",
environment: JunctionEnvironment.Sandbox,
});
const data = await client.testkit.createOrder({
userId: "63661a2b-2bb3-4125-bb1a-b590f64f057f",
labTestId: "5b41f610-ebc5-4803-8f0c-a61c3bdc7faf",
shippingDetails: {
receiverName: "John Doe",
firstLine: "123 Main St.",
secondLine: "Apt. 208",
city: "San Francisco",
state: "CA",
zip: "91189",
country: "US",
phoneNumber: "+11234567890",
},
});
import com.junction.api.Junction;
import com.junction.api.core.Environment;
import com.junction.api.resources.testkit.requests.CreateRegistrableTestkitOrderRequest;
import com.junction.api.types.ShippingAddressWithValidation;
Junction client = Junction.builder()
.apiKey("YOUR_API_KEY")
.environment(Environment.SANDBOX)
.build();
var data = client.testkit().createOrder(
CreateRegistrableTestkitOrderRequest.builder()
.userId("63661a2b-2bb3-4125-bb1a-b590f64f057f")
.labTestId("5b41f610-ebc5-4803-8f0c-a61c3bdc7faf")
.shippingDetails(
ShippingAddressWithValidation.builder()
.receiverName("John Doe")
.firstLine("123 Main St.")
.city("San Francisco")
.state("CA")
.zip("91189")
.country("US")
.phoneNumber("+11234567890")
.build()
)
.build()
);
import (
"context"
junction "github.com/junction-api/junction-go"
"github.com/junction-api/junction-go/client"
"github.com/junction-api/junction-go/option"
)
c := client.NewClient(
option.WithApiKey("YOUR_API_KEY"),
option.WithBaseURL(junction.Environments.Sandbox),
)
response, err := c.Testkit.CreateOrder(context.TODO(), &junction.CreateRegistrableTestkitOrderRequest{
UserId: "63661a2b-2bb3-4125-bb1a-b590f64f057f",
LabTestId: "5b41f610-ebc5-4803-8f0c-a61c3bdc7faf",
ShippingDetails: &junction.ShippingAddressWithValidation{
ReceiverName: "John Doe",
FirstLine: "123 Main St.",
SecondLine: junction.String("Apt. 208"),
City: "San Francisco",
State: "CA",
Zip: "91189",
Country: "US",
PhoneNumber: "+11234567890",
},
})
if err != nil {
return err
}
fmt.Printf("Received data %s\n", response)
curl --request POST \
--url '{{BASE_URL}}/v3/order/testkit' \
--header 'Accept: application/json' \
--header 'x-vital-api-key: YOUR_API_KEY' \
--data '
{
"user_id": "63661a2b-2bb3-4125-bb1a-b590f64f057f",
"lab_test_id": "5b41f610-ebc5-4803-8f0c-a61c3bdc7faf",
"shipping_details": {
"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": "96edc6ef-3b2c-412b-b9e5-96f361f93aec",
"team_id": "b080b20c-e162-4cf1-9c7d-8faee72ee08e",
"user_id": "9f1e094e-1641-466b-b668-d4d3300e569f",
"shipping_details": {
"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": "+11234567890"
},
"details": {
"type": "testkit",
"data": {
"id": "a655f0e4-6405-4a1d-80b7-66f06c2108a7",
"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",
"health_insurance_id": "7695cc28-f9e5-400d-95d2-ec7d9ec580df",
"notes": "This is a note",
"created_at": "2020-01-01T00:00:00Z",
"updated_at": "2020-01-01T00:00:00Z",
"status": "received",
"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.awaiting_registration"
}
]
},
"status": "string",
"message": "string"
}
from junction import Junction, ShippingAddressWithValidation
from junction.environment import JunctionEnvironment
client = Junction(
api_key="YOUR_API_KEY",
environment=JunctionEnvironment.SANDBOX,
)
data = client.testkit.create_order(
user_id="63661a2b-2bb3-4125-bb1a-b590f64f057f",
lab_test_id="5b41f610-ebc5-4803-8f0c-a61c3bdc7faf",
shipping_details=ShippingAddressWithValidation(
receiver_name="John Doe",
first_line="123 Main St.",
second_line="Apt. 208",
city="San Francisco",
state="CA",
zip="91189",
country="US",
phone_number="+11234567890",
),
)
import { JunctionClient, JunctionEnvironment } from "@junction-api/sdk";
const client = new JunctionClient({
apiKey: "YOUR_API_KEY",
environment: JunctionEnvironment.Sandbox,
});
const data = await client.testkit.createOrder({
userId: "63661a2b-2bb3-4125-bb1a-b590f64f057f",
labTestId: "5b41f610-ebc5-4803-8f0c-a61c3bdc7faf",
shippingDetails: {
receiverName: "John Doe",
firstLine: "123 Main St.",
secondLine: "Apt. 208",
city: "San Francisco",
state: "CA",
zip: "91189",
country: "US",
phoneNumber: "+11234567890",
},
});
import com.junction.api.Junction;
import com.junction.api.core.Environment;
import com.junction.api.resources.testkit.requests.CreateRegistrableTestkitOrderRequest;
import com.junction.api.types.ShippingAddressWithValidation;
Junction client = Junction.builder()
.apiKey("YOUR_API_KEY")
.environment(Environment.SANDBOX)
.build();
var data = client.testkit().createOrder(
CreateRegistrableTestkitOrderRequest.builder()
.userId("63661a2b-2bb3-4125-bb1a-b590f64f057f")
.labTestId("5b41f610-ebc5-4803-8f0c-a61c3bdc7faf")
.shippingDetails(
ShippingAddressWithValidation.builder()
.receiverName("John Doe")
.firstLine("123 Main St.")
.city("San Francisco")
.state("CA")
.zip("91189")
.country("US")
.phoneNumber("+11234567890")
.build()
)
.build()
);
import (
"context"
junction "github.com/junction-api/junction-go"
"github.com/junction-api/junction-go/client"
"github.com/junction-api/junction-go/option"
)
c := client.NewClient(
option.WithApiKey("YOUR_API_KEY"),
option.WithBaseURL(junction.Environments.Sandbox),
)
response, err := c.Testkit.CreateOrder(context.TODO(), &junction.CreateRegistrableTestkitOrderRequest{
UserId: "63661a2b-2bb3-4125-bb1a-b590f64f057f",
LabTestId: "5b41f610-ebc5-4803-8f0c-a61c3bdc7faf",
ShippingDetails: &junction.ShippingAddressWithValidation{
ReceiverName: "John Doe",
FirstLine: "123 Main St.",
SecondLine: junction.String("Apt. 208"),
City: "San Francisco",
State: "CA",
Zip: "91189",
Country: "US",
PhoneNumber: "+11234567890",
},
})
if err != nil {
return err
}
fmt.Printf("Received data %s\n", response)
curl --request POST \
--url '{{BASE_URL}}/v3/order/testkit' \
--header 'Accept: application/json' \
--header 'x-vital-api-key: YOUR_API_KEY' \
--data '
{
"user_id": "63661a2b-2bb3-4125-bb1a-b590f64f057f",
"lab_test_id": "5b41f610-ebc5-4803-8f0c-a61c3bdc7faf",
"shipping_details": {
"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": "96edc6ef-3b2c-412b-b9e5-96f361f93aec",
"team_id": "b080b20c-e162-4cf1-9c7d-8faee72ee08e",
"user_id": "9f1e094e-1641-466b-b668-d4d3300e569f",
"shipping_details": {
"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": "+11234567890"
},
"details": {
"type": "testkit",
"data": {
"id": "a655f0e4-6405-4a1d-80b7-66f06c2108a7",
"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",
"health_insurance_id": "7695cc28-f9e5-400d-95d2-ec7d9ec580df",
"notes": "This is a note",
"created_at": "2020-01-01T00:00:00Z",
"updated_at": "2020-01-01T00:00:00Z",
"status": "received",
"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.awaiting_registration"
}
]
},
"status": "string",
"message": "string"
}
Authorizations
Vital Team API Key
Body
application/json
Response
Successful Response
Show child attributes
Show child attributes
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": "67f14813-2762-4a6e-8b6a-82e45502671c",
"id": "6982d7b2-b36c-4781-8e76-9c6858e648a7",
"lab_test": {
"description": "Cholesterol test",
"method": "testkit",
"name": "Lipids Panel"
},
"last_event": {
"created_at": "2022-01-03T00:00:00Z",
"id": 3,
"status": "collecting_sample.testkit.transit_customer"
},
"notes": "This is a note",
"order_transaction": {
"id": "a655f0e4-6405-4a1d-80b7-66f06c2108a7",
"orders": [
{
"created_at": "2020-01-01T00:00:00Z",
"id": "d55210cc-3d9f-4115-8262-5013f700c7be",
"low_level_status": "transit_customer",
"low_level_status_created_at": "2020-01-05T00:00:00Z",
"origin": "initial",
"updated_at": "2020-01-05T00:00:00Z"
},
{
"created_at": "2020-01-05T01:00:00Z",
"id": "e66321dd-4e0g-5226-9373-6124g811d8cf",
"low_level_status": "requisition_created",
"low_level_status_created_at": "2020-01-05T01:00:00Z",
"origin": "redraw",
"updated_at": "2020-01-05T01:00:00Z"
}
],
"status": "active"
},
"origin": "initial",
"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": "85b88076-494d-4801-a81f-b5f7893c482e",
"updated_at": "2020-01-01T00:00:00Z",
"user_id": "880f9f9f-2818-414b-9baa-ef36ded302c2"
}
Was this page helpful?
⌘I