Kit Ordering Integration Guide¶
Feature Availability
The Kit Ordering feature is enabled on demand. If you're interested in using this feature to enable direct-to-consumer genetic testing through your application, please contact Gencove support to have it enabled for your organization.
Overview¶
The Kit Ordering integration allows your application to programmatically order genetic testing kits for your end-users through Gencove's API.
Prefer not to build the order form?
If you'd rather have your end-users enter their own shipping details on a Gencove-hosted page instead of collecting the address in your application, see Gencove-Hosted Kit Ordering Form below.
Key Concepts¶
Before integrating, it's helpful to understand a few core Gencove concepts:
- Sample: Represents a single genetic sample in Gencove. In the kit ordering workflow, one kit order equals one sample. The kit is what physically carries a sample. Each sample has a unique ID and tracks the entire lifecycle from kit request through sequencing and analysis.
- Sample Status: Samples progress through various states (e.g.,
kit_requested,kit_ordered,running,succeeded). - Project: A container for organizing related samples in Gencove. All samples from kit orders must be assigned to a project.
How It Works¶
The kit ordering workflow involves four key parties:
- Your end-user: The person requesting a genetic testing kit
- Your application (consumer health company): Handles user requests and integrates with Gencove's API
- Gencove: Orchestrates the kit ordering and processes sequencing results
- Sequencing provider: Manufactures, ships, receives, and sequences the kits
sequenceDiagram
autonumber
actor EU as End-user
participant CC as Consumer company
participant GC as Gencove
participant SP as Sequencing provider
EU->>CC: Orders kit
CC->>CC: Accept request, store information
Note over CC,GC: CC uses Gencove API key for the request
CC->>GC: POST https://api.gencove.com/api/v2/sample-kit/
GC-->>CC: Return Gencove sample ID
GC->>SP: Pass order information
SP-->>EU: Ship kit to end-user
EU-->>SP: Return kit
SP->>SP: Process kit (sequencing)
SP->>GC: Send sequencing results
GC->>GC: Process results (Gencove analysis)
alt Delivery back to CC via webhook
GC-->>CC: POST results (webhook)
else Delivery back to CC via API pull
CC->>GC: Fetch results (API)
GC-->>CC: GET https://api.gencove.com/api/v2/samples/{sample id}
end
CC-->>EU: Display results in application
sequenceDiagram
autonumber
actor EU as End-user
participant CC as Consumer company
participant GC as Gencove
participant SP as Sequencing provider
EU->>CC: Orders kit
CC->>CC: Accept request, store information
Note over CC,GC: CC uses Gencove API key for the request
CC->>GC: POST https://api.gencove.com/api/v2/sample-kit/
GC-->>CC: Return Gencove sample ID
GC->>SP: Pass order information
SP-->>EU: Ship kit to end-user
EU-->>SP: Return kit
SP->>SP: Process kit (sequencing)
SP->>GC: Send sequencing results
GC->>GC: Process results (Gencove analysis)
alt Delivery back to CC via webhook
GC-->>CC: POST results (webhook)
else Delivery back to CC via API pull
CC->>GC: Fetch results (API)
GC-->>CC: GET https://api.gencove.com/api/v2/samples/{sample id}
end
CC-->>EU: Display results in application
Workflow Steps¶
- Kit Request: Your end-user clicks "Order kit" in your application
- Accept Request: Your application accepts the request and stores necessary information
- Create Order: Your application makes an authenticated request to Gencove's API to create the kit order
- Sample ID: Gencove returns a unique sample ID that you should store to track this kit/sample
- Order Processing: Gencove passes the order information to the sequencing provider
- Kit Shipment: The sequencing provider ships the kit directly to your end-user's address
- Kit Return: Your end-user collects their sample and returns the kit to the sequencing provider
- Sequencing: The sequencing provider processes and sequences the sample
- Results to Gencove: The sequencing provider sends raw sequencing data to Gencove
- Gencove Analysis: Gencove runs its analysis pipeline on the sequencing data
- Results Delivery via Webhook: (RECOMMENDED) Gencove delivers results to your application via webhook when they're ready
- Fetch results via API: Periodically ping Gencove API to get results
- Results response: Use response to check if samples are ready
- Display Results: Your application displays the results to your end-user
Integration Guide¶
Get Your API Key¶
To make requests to Gencove's API, you'll need an API key. This key authenticates your application and should be kept secure (treat it like a secret or a password).
To generate an API key:
- Log in to your Gencove account at web.gencove.com
- In the left sidebar, click on Account
- Navigate to the API Keys tab
- Click the Generate new API key button
- Copy the generated API key and store it securely
Security Best Practice: For production use, consider creating a separate Gencove user with
Analystlevel privileges specifically for API access, and use that user's API key. This follows the principle of least privilege and makes it easier to manage access if needed.
Keep Your API Key Secret
Your API key provides access to your Gencove account. Never commit it to version control, never share it publicly, never expose it in client-side code. Store it in a secure secrets management system. If your key gets exposed, make sure to revoke it immediately and generate a new one.
Create a Gencove Project¶
Before ordering kits, you need at least one project to assign samples to.
Gencove support should have created a properly configured project during onboarding, if not please contact our team.
Order a Kit¶
When your end-user requests a kit, your application should make a POST request to Gencove's kit ordering endpoint.
API Endpoint: POST https://api.gencove.com/api/v2/sample-kit/
Authentication: Include your API key in the Authorization header: Authorization: Api-Key $GENCOVE_API_KEY
Request Body:
{
"project_id": "<project-uuid>",
"recipient_address_name": "Jane Doe",
"recipient_address_line1": "123 Main Street",
"recipient_address_city": "San Francisco",
"recipient_address_state_region": "CA",
"recipient_address_postal_code": "94102",
"recipient_address_country_code": "US",
"recipient_email": "jane.doe@example.com",
"recipient_phone": "+14155551234",
"recipient_instructions": "Leave at front desk",
"metadata": {
"customer_id": "cust_12345",
"order_number": "ORD-2025-001"
}
}
Required Fields:
project_id: The UUID of the Gencove project to assign this sample torecipient_address_name: Full name of the kit recipientrecipient_address_line1: Street addressrecipient_address_city: City namerecipient_address_state_region: State or regionrecipient_address_postal_code: Postal/ZIP coderecipient_address_country_code: Two-letter ISO country code (e.g., "US", "GB", "CA")recipient_email: Email address for shipping notificationsrecipient_phone: Phone number (international format recommended)
Optional Fields:
recipient_address_line2: Additional address information (apartment, suite, etc.)recipient_address_line3: Additional address informationrecipient_instructions: Special delivery instructionsmetadata: Custom key-value pairs to store with the sample (useful for linking back to your system)test_mode: Boolean flag for development testing (see Test Mode below)
Response:
Important: Store the returned sample_id in your database. This is the unique identifier you'll use to track the kit's status and retrieve results. Alternatively, if you include information in the metadata field when creating the order, you can search for samples using that metadata to find the correct sample without storing the sample ID.
Test Mode¶
Use Test Mode During Development
When integrating with the Kit Ordering API, use test_mode: true to validate your integration without incurring kit ordering costs or triggering actual shipments.
Test mode allows you to create kit orders that go through the full API validation and workflow, but use a staging environment with the sequencing provider. No physical kit will be manufactured or shipped when test_mode is enabled.
When to use test mode:
- During initial integration development
- When testing your order creation flow
- When validating address formats and API responses
What happens in test mode:
- The API validates all fields exactly as in production
- A sample is created in your Gencove project with status
kit_requested - The order is sent to the provider's staging environment
- The sample will progress to
kit_orderedstatus - No physical kit is shipped and no kit ordering costs are incurred
- The sample will not receive sequencing results (since no kit is shipped)
To enable test mode, simply add "test_mode": true to your request body:
{
"project_id": "<project-uuid>",
"recipient_address_name": "Jane Doe",
"recipient_address_line1": "123 Main Street",
"recipient_address_city": "San Francisco",
"recipient_address_state_region": "CA",
"recipient_address_postal_code": "94102",
"recipient_address_country_code": "US",
"recipient_email": "jane.doe@example.com",
"recipient_phone": "+14155551234",
"test_mode": true
}
Test Mode Samples
Samples created with test_mode: true will never complete the full workflow since no physical kit is shipped. These samples are useful for testing your integration but should not be used for production tracking. Consider using a separate test project to keep test samples organized.
curl -X POST "https://api.gencove.com/api/v2/sample-kit/" \
-H "Authorization: Api-Key $GENCOVE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"project_id": "06a5d04b-526a-4471-83ba-fb54e0941758",
"recipient_address_name": "Jane Doe",
"recipient_address_line1": "123 Main Street",
"recipient_address_city": "San Francisco",
"recipient_address_state_region": "CA",
"recipient_address_postal_code": "94102",
"recipient_address_country_code": "US",
"recipient_email": "jane.doe@example.com",
"recipient_phone": "+14155551234",
"metadata": {
"customer_id": "cust_12345"
}
}'
# Use test_mode for development - no kit will be shipped
curl -X POST "https://api.gencove.com/api/v2/sample-kit/" \
-H "Authorization: Api-Key $GENCOVE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"project_id": "06a5d04b-526a-4471-83ba-fb54e0941758",
"recipient_address_name": "Jane Doe",
"recipient_address_line1": "123 Main Street",
"recipient_address_city": "San Francisco",
"recipient_address_state_region": "CA",
"recipient_address_postal_code": "94102",
"recipient_address_country_code": "US",
"recipient_email": "jane.doe@example.com",
"recipient_phone": "+14155551234",
"test_mode": true
}'
import os
import requests
API_KEY = os.getenv('GENCOVE_API_KEY')
PROJECT_ID = "67931e57-c374-4c0b-9616-8b809ad5b657"
headers = {
"Authorization": f"Api-Key {API_KEY}",
"Content-Type": "application/json"
}
payload = {
"project_id": PROJECT_ID,
"recipient_address_name": "Jane Doe",
"recipient_address_line1": "123 Main Street",
"recipient_address_city": "San Francisco",
"recipient_address_state_region": "CA",
"recipient_address_postal_code": "94102",
"recipient_address_country_code": "US",
"recipient_email": "jane.doe@example.com",
"recipient_phone": "+14155551234",
"metadata": {
"customer_id": "cust_12345"
}
}
response = requests.post(
"https://api.gencove.com/api/v2/sample-kit/",
headers=headers,
json=payload
)
sample_id = response.json()["sample_id"]
print(f"Kit ordered! Sample ID: {sample_id}")
import os
import requests
API_KEY = os.getenv('GENCOVE_API_KEY')
PROJECT_ID = "67931e57-c374-4c0b-9616-8b809ad5b657"
headers = {
"Authorization": f"Api-Key {API_KEY}",
"Content-Type": "application/json"
}
# Use test_mode=True for development - no kit will be shipped
payload = {
"project_id": PROJECT_ID,
"recipient_address_name": "Jane Doe",
"recipient_address_line1": "123 Main Street",
"recipient_address_city": "San Francisco",
"recipient_address_state_region": "CA",
"recipient_address_postal_code": "94102",
"recipient_address_country_code": "US",
"recipient_email": "jane.doe@example.com",
"recipient_phone": "+14155551234",
"test_mode": True, # Enable test mode
}
response = requests.post(
"https://api.gencove.com/api/v2/sample-kit/",
headers=headers,
json=payload
)
sample_id = response.json()["sample_id"]
print(f"Test kit ordered! Sample ID: {sample_id}")
Monitor Kit Status¶
After ordering a kit, you can monitor its progress through various stages. Each sample progresses through different statuses from kit request to final results.
Common Sample Statuses:
kit_requested: Kit has been requested through the APIkit_ordered: Gencove has placed the order with the sequencing providerrunning: Sequencing data is being analyzed by Gencovesucceeded: Analysis complete, results are readyfailed_qc: Analysis failed (rare, contact support if this occurs)
Check Status via API:
import os
import requests
API_KEY = os.getenv('GENCOVE_API_KEY')
SAMPLE_ID = "3fa85f64-5717-4562-b3fc-2c963f66afa6"
headers = {
"Authorization": f"Api-Key {API_KEY}"
}
response = requests.get(
f"https://api.gencove.com/api/v2/samples/{SAMPLE_ID}/",
headers=headers
)
sample_data = response.json()
print(f"Sample status: {sample_data['last_status']['status']}")
Simplified response:
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"client_id": "",
"last_status": {
"status": "running",
"created": "2025-10-31T12:34:56Z"
},
"project": "67931e57-c374-4c0b-9616-8b809ad5b657",
"metadata": {
"customer_id": "cust_12345"
}
}
Receive Results¶
Once sequencing and analysis are complete, you need to retrieve the results. Gencove offers two approaches:
Option 1: Webhooks (Recommended)¶
Webhooks allow Gencove to automatically notify your application when samples reach a final status (succeeded or failed_qc). This is more efficient than polling and provides real-time updates when results are ready.
To set up webhooks see our integration guide.
Option 2: API Polling¶
If webhooks aren't feasible for your infrastructure, you can periodically poll the samples API to check for status updates.
For polling it's better to use the /project-samples/{project_id} endpoint that can be used for querying many samples at once. See our API reference for a detailed list of endpoints.
Note: If using polling, we recommend checking no more frequently than every 1 hour. Typical turnaround time from order placed to results is measured in weeks.
Gencove-Hosted Kit Ordering Form¶
The Order a Kit flow above has your application collect the recipient's shipping address and submit it to POST /api/v2/sample-kit/. As an alternative, Gencove can host the order form for you: your backend requests a short-lived, tokenized URL and hands it to the end-user, who enters their own shipping details on a Gencove-hosted page and submits. The kit order is then placed automatically—with no payment step, billed by contract exactly like the API path above.
Use this when you'd rather not build and validate a shipping-address form yourself. Everything else in this guide applies unchanged—getting an API key, creating a project, monitoring status, and receiving results.
How the Hosted Form Works¶
- Your application calls
POST /api/v2/sample-kit-form/with aproject_id(no address). - Gencove returns a
sample_idand a short-livedurl. - You hand the
urlto your end-user, who opens it, fills in their shipping details, and submits onconsumer.gencove.com. - Gencove places the kit order automatically, and the sample proceeds through the same statuses as the API path.
Create an Order-Form Session¶
When your end-user is ready to order, your application makes a POST request to Gencove's kit-order-form endpoint.
API Endpoint: POST https://api.gencove.com/api/v2/sample-kit-form/
Authentication: Include your API key in the Authorization header: Authorization: Api-Key $GENCOVE_API_KEY
Request Body:
{
"project_id": "<project-uuid>",
"metadata": {
"customer_id": "cust_12345",
"order_number": "ORD-2025-001"
},
"redirect_on_success": "https://partner.example.com/order/done",
"redirect_on_failure": "https://partner.example.com/order/error",
"expires_in": 600
}
Required Fields:
project_id: The UUID of the Gencove project to assign this sample to
Optional Fields:
metadata: Custom key-value pairs stored on the sample (useful for linking back to your system)redirect_on_success: HTTPS URL to send the end-user to after they submit the order; omit to send them to a generic Gencove-hosted confirmation pageredirect_on_failure: HTTPS URL to send the end-user to if the order cannot be completed, with areasonquery parameter appended; omit to send them to Gencove's hosted error page instead. Only failures Gencove can tie back to this order link reach your URL—see Failure reasonstest_mode: Boolean flag for development testing (see Test Mode above); defaults tofalseexpires_in: How long the order-form link stays valid before the end-user opens it, in seconds (default600/ 10 minutes, minimum60, maximum3600)
The shipping address is not part of this request—your end-user enters it on the hosted form.
Response:
{
"sample_id": "6c3437b4-35fc-4224-9bb0-4623a16e6735",
"url": "https://consumer.gencove.com/sample-kit-form?token=<jwt>",
"expires_at": "2026-06-02T12:34:56Z"
}
Important: Store the returned sample_id in your database to track the sample's status and retrieve results. Hand the returned url to your end-user when they are ready to order, opening it as a top-level page (see Opening the Order Form). Create the session shortly before ordering—the link expires after expires_in seconds.
curl -X POST "https://api.gencove.com/api/v2/sample-kit-form/" \
-H "Authorization: Api-Key $GENCOVE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"project_id": "06a5d04b-526a-4471-83ba-fb54e0941758",
"metadata": {"customer_id": "cust_12345"},
"redirect_on_success": "https://partner.example.com/order/done",
"expires_in": 600
}'
import os
import requests
API_KEY = os.getenv("GENCOVE_API_KEY")
PROJECT_ID = "06a5d04b-526a-4471-83ba-fb54e0941758"
headers = {
"Authorization": f"Api-Key {API_KEY}",
"Content-Type": "application/json",
}
payload = {
"project_id": PROJECT_ID,
"metadata": {"customer_id": "cust_12345"},
"redirect_on_success": "https://partner.example.com/order/done",
"expires_in": 600,
}
response = requests.post(
"https://api.gencove.com/api/v2/sample-kit-form/",
headers=headers,
json=payload,
)
response.raise_for_status()
session = response.json()
print(f"Sample ID: {session['sample_id']}")
print(f"Order-form URL: {session['url']}")
test_mode works exactly as described in Test Mode above and is passed here at session-creation time; the resulting order goes to the provider's staging environment and no physical kit is shipped.
End-User Order Experience¶
After your end-user opens the url:
- Gencove validates the link and shows the order form on
consumer.gencove.com - The end-user enters their shipping details—recipient name, email, phone, address, and any delivery instructions—and submits
- Gencove places the kit order automatically; there is no payment step
- On success, they are redirected to
redirect_on_success, or to a generic Gencove-hosted confirmation page when you did not configure one - If the order cannot be placed, they are redirected to
redirect_on_failurewith areasonquery parameter appended; otherwise they are sent to Gencove's hosted error page (see Failure reasons)
Once the form is submitted, the kit order is placed automatically—you do not need to make a separate API call.
Session timing: The order-form link is valid for expires_in seconds before it is opened. After the end-user opens it, they have 15 minutes to complete and submit the form. If either window expires, create a new session.
Opening the Order Form¶
Open the returned url as a top-level page. Embedding the order form in an iframe is not supported.
| Surface | Notes |
|---|---|
| New browser tab or window | Simplest for web applications; open the url with target="_blank" |
iOS ASWebAuthenticationSession |
Returns control to your app when the end-user finishes |
| Android Custom Tabs | Same, on Android |
| Plain mobile WebView | Works, but behaviour varies by platform and configuration—prefer the surfaces above |
If you configure redirect_on_success or redirect_on_failure, the end-user lands on your page in that same context when the flow ends, so you can resume your own application's flow there.
Failure Reasons¶
When an order cannot be completed, the end-user lands on a page with a reason query parameter describing what went wrong. Branch on reason to show the right message in your own UI, and treat an unrecognised value as a generic failure—more may be added over time.
These reasons are sent to your redirect_on_failure:
reason |
Meaning |
|---|---|
link_replaced |
A newer order-form session was created for this sample, superseding this link |
already_ordered |
The kit for this sample has already been ordered |
project_locked |
The project is locked, so no new order can be placed |
These are always shown on Gencove's hosted error page, even if you configured redirect_on_failure:
reason |
Meaning |
|---|---|
link_invalid |
The order link could not be verified |
link_expired |
The link expired before the end-user opened it |
session_expired |
The end-user opened the link but did not submit within 15 minutes |
order_unavailable |
Kit ordering is no longer enabled for the organization that issued the link |
The hosted error page is at https://consumer.gencove.com/sample-kit-form/failure/ and accepts the same reason parameter, so you can open any row above directly—for example https://consumer.gencove.com/sample-kit-form/failure/?reason=already_ordered—to see exactly what your end-user would see, without creating an order-form session first. The confirmation page at /sample-kit-form/success/ works the same way.
Additional Sample Statuses¶
Hosted-form samples pass through two extra statuses before kit_requested (all other statuses match the Monitor Kit Status section above):
| Status | Meaning |
|---|---|
consumer awaiting kit order |
Order-form session created; waiting for the end-user to submit |
consumer session expired |
Order-form link expired before the end-user submitted |
Manual Testing¶
You can start an order-form session from the Gencove web UI:
- Open your consumer project
- Click Order a kit on the project page
- Open the returned link, fill in the shipping details, and submit
This uses the same endpoint as the integration described above.
System Responsibilities¶
Understanding what each system is responsible for helps clarify the integration:
Your Application's Responsibilities¶
- Handle end-user requests for kits
- Collect and validate shipping addresses
- Store the Gencove sample ID for each kit order
- Monitor sample status (via webhooks or polling)
- Retrieve and display results to your end-users
- Manage your end-users' accounts and permissions
- Keep the Gencove API Key secure
Gencove's Responsibilities¶
- Provide the API for kit ordering
- Coordinate with the sequencing provider
- Receive raw sequencing data from the provider
- Run analysis on the sequencing data
- Deliver results via webhooks or API
- Provide sample status tracking
Sequencing Provider's Responsibilities¶
- Manufacture and ship kits to end-user addresses
- Receive returned samples
- Perform sequencing on samples
- Deliver raw sequencing data to Gencove
Support¶
If you have questions about the Kit Ordering integration or encounter any issues: