> ## Documentation Index
> Fetch the complete documentation index at: https://docs.junction.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Ordering a Registrable Test Kit

> Use registrable test kits to ship kits without a bound patient, deferring patient registration until the test kit is activated.

Under the [standard test kit ordering flow](/api-reference/lab-testing/create-order), you place a test kit order for a specific patient. The resulting kit is bound to that patient and cannot be passed to someone else.

With registrable test kits, you can order a kit before it is bound to its final patient. Patient registration is deferred until someone is ready to use the kit.

For self-ordering, proxy ordering, and bulk inventory guidance, see [Proxy and Inventory Workflows for Registrable Test Kits](/lab/workflow/registrable-testkit-proxy-inventory-workflows).

<Warning>
  This workflow applies only to test kits, not walk-in or mobile phlebotomy orders.
</Warning>

This involves two steps:

1. Ordering the test kit.
2. Registering a patient.

After step 1, the order is sent to the requested address and generates all the same webhooks as a regular order would. However, it is stuck in the `received.testkit.awaiting_registration` state, meaning that no requisition form is generated for this order, and no results can be obtained until step 2 is done.

After step 2, the order flow resumes as normal, the patient sends the `testkit` to the lab, the order is progressed to the `received.testkit.testkit_registered` state and, again, all the same webhooks as in the regular order flow are dispatched.

### Example

To make an order, make a request to our [`POST /v3/order/testkit`](/api-reference/lab-testing/create-unregistered-order), to fulfill step 1.

<CodeGroup>
  ```python Python theme={null}
  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="<user_id>",
      lab_test_id="<lab_test_id>",
      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",
      ),
  )
  ```

  ```typescript TypeScript theme={null}
  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: "<user_id>",
      labTestId: "<lab_test_id>",
      shippingDetails: {
          receiverName: "John Doe",
          firstLine: "123 Main St.",
          secondLine: "Apt. 208",
          city: "San Francisco",
          state: "CA",
          zip: "91189",
          country: "US",
          phoneNumber: "+11234567890",
      },
  });
  ```

  ```java Java theme={null}
  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("<user_id>")
          .labTestId("<lab_test_id>")
          .shippingDetails(ShippingAddressWithValidation.builder()
              .receiverName("John Doe")
              .firstLine("123 Main St.")
              .city("San Francisco")
              .state("CA")
              .zip("91189")
              .country("US")
              .phoneNumber("+11234567890")
              .build())
          .build()
  );
  ```

  ```go Go theme={null}
  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:    "<user_id>",
      LabTestId: "<lab_test_id>",
      ShippingDetails: &junction.ShippingAddressWithValidation{
          ReceiverName: "John Doe",
          FirstLine:    "123 Main St.",
          City:         "San Francisco",
          State:        "CA",
          Zip:          "91189",
          Country:      "US",
          PhoneNumber:  "+11234567890",
      },
  })
  if err != nil {
      return err
  }
  fmt.Printf("Received data %s\n", response)
  ```
</CodeGroup>

The test kit is now ordered and will be sent to the specified address. Once delivered, it can be stored until its expiration date.

Once the test kit is with its intended patient, register it to continue the order workflow.

Registration requires the unique `sample_id` printed on the test kit.
Junction also requires the patient details and address.
Besides this, if using Junction's physician network, then supplying the consents field is required. If providing your own physician, then the physician information is required.

For this example, we will assume the use of your own physician.

Register the order with [`POST /v3/order/testkit/register`](/api-reference/lab-testing/register-order).

<CodeGroup>
  ```python Python theme={null}
  from junction import Gender, Junction, PatientAddressWithValidation, PatientDetailsWithValidation, PhysicianCreateRequestBase
  from junction.environment import JunctionEnvironment

  client = Junction(
      api_key="YOUR_API_KEY",
      environment=JunctionEnvironment.SANDBOX,
  )

  data = client.testkit.register(
      user_id="<user_id>",
      sample_id="123123123",
      patient_details=PatientDetailsWithValidation(
          first_name="John",
          last_name="Doe",
          dob="2020-01-01",
          gender=Gender.MALE,
          phone_number="+1123456789",
          email="email@email.com",
      ),
      patient_address=PatientAddressWithValidation(
          first_line="123 Main St.",
          second_line="Apt. 208",
          city="San Francisco",
          state="CA",
          zip="91189",
          country="US",
      ),
      physician=PhysicianCreateRequestBase(
          first_name="Doctor",
          last_name="Doc",
          npi="123123123",
      ),
  )
  ```

  ```typescript TypeScript theme={null}
  import { JunctionClient, JunctionEnvironment } from "@junction-api/sdk";

  const client = new JunctionClient({
      apiKey: "YOUR_API_KEY",
      environment: JunctionEnvironment.Sandbox,
  });

  const data = await client.testkit.register({
      userId: "<user_id>",
      sampleId: "123123123",
      patientDetails: {
          firstName: "John",
          lastName: "Doe",
          dob: "2020-01-01",
          gender: "male",
          phoneNumber: "+1123456789",
          email: "email@email.com",
      },
      patientAddress: {
          firstLine: "123 Main St.",
          secondLine: "Apt. 208",
          city: "San Francisco",
          state: "CA",
          zip: "91189",
          country: "US",
      },
      physician: {
          firstName: "Doctor",
          lastName: "Doc",
          npi: "123123123",
      },
  });
  ```

  ```java Java theme={null}
  import com.junction.api.Junction;
  import com.junction.api.core.Environment;
  import com.junction.api.resources.testkit.requests.RegisterTestkitRequest;
  import com.junction.api.types.Gender;
  import com.junction.api.types.PatientAddressWithValidation;
  import com.junction.api.types.PatientDetailsWithValidation;
  import com.junction.api.types.PhysicianCreateRequestBase;

  Junction client = Junction.builder()
      .apiKey("YOUR_API_KEY")
      .environment(Environment.SANDBOX)
      .build();

  var data = client.testkit().register(
      RegisterTestkitRequest.builder()
          .sampleId("123123123")
          .patientDetails(PatientDetailsWithValidation.builder()
              .firstName("John")
              .lastName("Doe")
              .dob("2020-01-01")
              .gender(Gender.MALE)
              .phoneNumber("+1123456789")
              .email("email@email.com")
              .build())
          .patientAddress(PatientAddressWithValidation.builder()
              .firstLine("123 Main St.")
              .city("San Francisco")
              .state("CA")
              .zip("91189")
              .country("US")
              .build())
          .userId("<user_id>")
          .physician(PhysicianCreateRequestBase.builder()
              .firstName("Doctor")
              .lastName("Doc")
              .npi("123123123")
              .build())
          .build()
  );
  ```

  ```go Go theme={null}
  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),
  )

  userId := "<user_id>"
  response, err := c.Testkit.Register(context.TODO(), &junction.RegisterTestkitRequest{
      UserId:   &userId,
      SampleId: "123123123",
      PatientDetails: &junction.PatientDetailsWithValidation{
          FirstName:   "John",
          LastName:    "Doe",
          Dob:         "2020-01-01",
          Gender:      junction.GenderMale,
          PhoneNumber: "+1123456789",
          Email:       "email@email.com",
      },
      PatientAddress: &junction.PatientAddressWithValidation{
          FirstLine: "123 Main St.",
          City:      "San Francisco",
          State:     "CA",
          Zip:       "91189",
          Country:   "US",
      },
      Physician: &junction.PhysicianCreateRequestBase{
          FirstName: "Doctor",
          LastName:  "Doc",
          Npi:       "123123123",
      },
  })
  if err != nil {
      return err
  }
  fmt.Printf("Received data %s\n", response)
  ```
</CodeGroup>

After registration, the order resumes its normal lifecycle. See [Order Status and Lifecycle](/lab/workflow/lab-test-lifecycle).


## Related topics

- [Proxy Ordering Registrable Test Kits](/lab/workflow/registrable-testkit-proxy-inventory-workflows.md)
- [Order Lifecycle](/lab/testkits/order-lifecycle.md)
- [Cancelling an Order](/lab/workflow/cancelling-an-order.md)
- [Overview](/lab/testkits/overview.md)
- [Testing Modalities](/lab/overview/testing-modalities.md)
