POST /v3/order/testkit request still requires a user_id. That user can be the intended patient if they are already known, or it can be a stock/inventory user that your system uses while the final patient is still unknown.
When the kit is registered with POST /v3/order/testkit/register, you can provide a different user_id. If that user exists on the same team as the order, Junction rebinds the order to that user during registration. If user_id is omitted, the order stays bound to the user from the original order request.
This workflow guide outlines recommended implementation patterns for two flows where the patient may not be the person or system initiating the order:
- A user orders a registrable testkit on behalf of another person.
- A clinic orders registrable testkits in bulk for on-hand inventory.
The
user_id on the create request is the current order owner. The user_id on the registration request is the final patient and result owner when it is supplied. Registration-time rebinding only works for an existing user on the same team as the order.Relevant API requests
These flows use the following Junction API requests:- Use
POST /v2/userto create a Junction user when the intended patient or stock/inventory user does not already exist in Junction. - Use
GET /v2/user/{user_id}when you already have the Junctionuser_idand need to retrieve that user. - Use
GET /v2/user/resolve/{client_user_id}when you have your ownclient_user_idand need to look up the corresponding Junction user. - Use
POST /v3/order/testkitto create a registrable testkit order. - Use
POST /v3/order/testkit/registerto register the kit when the final patient information is available.
In the flows below, “create or resolve a user” means: first look up the existing Junction user using
GET /v2/user/{user_id} if you already store the Junction user_id, or GET /v2/user/resolve/{client_user_id} if you store your own user identifier. If no Junction user exists, create one with POST /v2/user.Scenario 1: User A orders a testkit for User B
Example
User A places an unregistered testkit order for User B. User B is the intended patient and will register the kit using their own demographic information.Recommended flow
Junction does not model this as a separate proxy-ordering concept. From Junction’s perspective, this is still a normal registrable testkit order. Your application decides whether to bind the order to the final patient at order time or at registration time. If User B is known before the kit is ordered, create the Junction order directly for User B:- User A starts the order in your application.
- Your application determines that the intended patient and result owner is User B.
- Create or resolve User B in Junction.
- Place the registrable testkit order with
POST /v3/order/testkitusing User B’s Junctionuser_id. - Register the kit with
POST /v3/order/testkit/register. You can omituser_idbecause the order is already bound to User B. - Order and results are associated with User B.
If the final patient is not known yet
If User A orders the kit before the final patient is known, use the same pattern as the inventory workflow:- Create or resolve a stock, household, account, or orderer Junction user for the initial order.
- Place the registrable testkit order with that user’s
user_id. - When User B is known, create or resolve User B in Junction.
- Register the kit for that Junction order with User B’s Junction
user_idand User B’s patient information. - Junction rebinds the order to User B during registration.
Scenario 2: Bulk registrable kits for inventory
Example
Your clinic wants to order 100 registrable testkits and keep the physical kits in inventory or on site before the final patients are known. For example, you may need kits available at a location so they can be handed to patients later.Recommended flow
For inventory workflows, create one or more dedicated Junction users to represent stock inventory before patient assignment. These can be scoped however your application needs, such as one stock user per clinic location, program, warehouse, or inventory pool. For example, if you need 100 kits for one clinic location:- Create or resolve a Junction stock user for that location, such as
clinic_a_inventory. - Place 100 registrable testkit orders with
POST /v3/order/testkit, using that stock user’s Junctionuser_id. - Store the Junction order ID for each inventory order.
- When a final patient is assigned to a kit or claims a kit, create or resolve that patient in Junction.
- Register the kit with
POST /v3/order/testkit/register, using the Junction order ID, the patient’s Junctionuser_id, and the patient’s registration details. - Junction rebinds the order from the stock user to the patient user during registration. Results are associated with the patient user.
Example inventory mapping
Your inventory tracking may look like this. The only Junction identifier you need to keep for registration is the order ID. Any extra fields are application-specific.Webhook and event attribution
Before registration, order and shipping events are associated with the user from the originalPOST /v3/order/testkit request. In an inventory workflow, that is usually your stock user.
After registration-time rebinding, the registration event and later order lifecycle events are associated with the patient user supplied in POST /v3/order/testkit/register.
Because of this, your application should not treat pre-registration webhook user_id or client_user_id values as the final patient identity for inventory-held kits. Use your inventory mapping and the post-registration order state as the source of truth for final patient ownership.