Skip to main content
WIP — coming soon. This page describes the planned simulator; the endpoint, fields, and values may change. It is not available yet.
Orders you place in sandbox create no real samples, so their kits, lab receipt, and reports do not progress the way they do in production. The order simulator moves an order you placed with POST /orders to the state you choose. Get orders, the Report endpoint, and webhooks then all show that state, so you can test your whole integration: place an order, react to its events, query it, and fetch its report.

Simulator or webhook simulate

The webhooks API already has simulate, and it stays available. The two test different things:

Move an order

The simulator accepts the request and moves the order asynchronously. Read the result from Get orders, the Report endpoint, or the webhook events; there is no separate progress endpoint. Authenticate with an access token from your sandbox client credentials, requested with algorithm=RS256 as for the webhook management API.

States

Set any state later than the order’s current one. Each state includes the ones before it: moving a new order straight to report_final also fills in kit shipping and lab receipt. Get orders and webhooks use different status values; see Status values.
  • Forward only. An earlier state is rejected. To run a flow again, place a new order. The report count can go up or down.
  • The current state changes nothing and sends no event. To change only the issues or the report count, send the current state with issues or generatedReportCount.
  • A jump over several states produces one webhook event; its changes lists every field that changed.

Scenarios

A scenario plays several steps on the order, stepIntervalSeconds apart, and each step is delivered as its own webhook event. Run a scenario on a newly placed order. Scenarios use the names of webhook simulate: The steps follow webhook simulate without its partial-results steps, because how many reports an order produces depends on its panels. To test partial results, set the report count.

Issues

issues sets the order’s open issues with the webhook issue codes, for example ["billing"]. List every issue the order should have: omit issues to keep the current ones, and send [] to clear them all. Issues behave as in production. Get orders and the Report endpoint show them with their report-blocking flags, a blocking issue withholds result content until you clear it, and each change sends an order.status_changed with issues in changes. See Exceptions.

Report counts

Get orders returns how many reports the order has in report.totalReportCount (the Report endpoint’s total_report_count, webhook reports.total). The simulator does not change it. generatedReportCount sets how many of them are generated: any number from 0 to totalReportCount. Unlike the state, it can go up or down, so you can test 1 of 3, then 3 of 3, then 2 of 3. A number below 0 or above totalReportCount is rejected. Set it on an order at analyzing or later, or in the request that moves the order there.
  • Default. Moving to report_final generates every report, unless you send generatedReportCount with it.
  • Where it shows. Get orders report.generatedReportCount, the Report endpoint’s total_generated_report_count, and webhook reports.generated.
  • Events. Each change sends an order.status_changed with reports in changes. Webhook unifiedStatus follows the count as in production: for example, results_partial at 1 of 3 and results_ready at 3 of 3.
  • To be confirmed: which reports are generated first, and Get orders status and report.status while only some reports are generated.

Reports

Reports with results come back from the Report endpoint as demo data: a FHIR DiagnosticReport with made-up values, and a PDF watermarked SANDBOX. Generated reports have final results. The others have preliminary results at report_preliminary, and none otherwise. The structure is the same as in production, so you can test how you parse and store results; the values have no clinical meaning.

Webhooks

Simulated changes are delivered like real ones: to every endpoint of your clinic that subscribes to the event type, by the normal trigger rules. You do not need a webhook endpoint to use the simulator; an integration that only polls reads the same states from Get orders and the Report endpoint.

Cancellation

Cancel a simulated order with POST /orders/cancel, as in production. The cancellation policy applies to the simulated state, so you can test each case: before the kit ships, after it ships, and after lab receipt (not_cancellable). After cancellation, you can still move the kit (kit_shipped, kit_in_transit, kit_delivered); other states are rejected.

Access and limits

  • Sandbox only: in production, the endpoint returns 404.
  • Only orders your clinic placed through this API. An order of another clinic, or an unknown order, returns 404. An order placed in the Vibrant Portal returns not_placed_via_api, as for looking up an order by accessionId.
  • Rate limits will be listed here.

Example: a report held up by an issue

1

Place an order

Place an order in sandbox with POST /orders and save its accessionId, for example 2607216002.
2

Move it to final with a billing issue

You receive one order.status_changed. The Report endpoint returns status: "final" and lists the billing issue; while it blocks the report, the results are withheld.
3

Clear the issue

You receive an order.status_changed with issues in changes. Once the reportReady reason is available (coming soon), the same event can also carry it. Fetch the report again: with no blocking issue left, the demo results and PDF are included.