Skip to main content
This guide creates a patient and places a lab order in the sandbox environment.

Prerequisites

The examples use {{BASE_URL}} for your sandbox base URL and YOUR_API_KEY for your Team API key. The API key header remains x-vital-api-key.

1. Create a patient

In the Junction API, a user represents a patient. Set client_user_id to the stable identifier your system uses for that patient.
Save the returned user id. You will provide it as user_id when creating the order. See Create User for the complete request and response.

2. Select a lab test

Retrieve the lab tests available to your sandbox Team:
Select a test that supports the collection method you want to exercise and save its id. See Get Available Tests for filters and pagination.
Sandbox Teams include tests for the standard collection modalities. You can also create a custom lab test when you need a specific marker set.

3. Create the order

Provide the patient ID, select the lab test in order_set, and include the patient’s demographics and collection address. Patient names must meet the patient name requirements.
The response contains the new order under order. Creating this initial order also creates an order transaction representing the full testing journey. Save order.id and order_transaction.id: use the order ID for order-specific operations and the transaction ID to group the initial order with any related orders and retrieve their combined results. Inspect order.status and order.events as the individual order progresses. See Create Order for all ordering options.

4. Test the order workflow

Sandbox orders remain in their initial state until you simulate their progression. Use the Junction Dashboard or the Simulate Order endpoint, then verify that your integration receives the expected webhook events. See Testing in Sandbox for supported simulations, modality-specific test data, and result customization.

Next steps