Skip to main content

Quickstart

This walkthrough runs the complete Vita Clinic loop — patient, intake, order, webhooks — against a vr_test_ key. Every call goes to the same base URL you will use in production:
1

Get a test key

API keys are issued by VitaRelay, not through the API and not self-serve. Ask your VitaRelay representative for a test key with the patients:write, intakes:write, and orders:write scopes. The raw key is shown once — store it in an environment variable.
See API Keys for how keys are issued and scoped.
2

Create a patient

Send your own stable identifier as external_patient_id. It makes the call idempotent and lets you reference the patient later without storing our id.
Response — 201 Created:
With a vr_live_ key, data.id is a UUID and sandbox is absent.
3

Submit an intake

Reference the patient by the external_patient_id you just used.
Response — 201 Created:
4

Place an order

Order items are product_id plus quantity. Product ids come from GET /products.
Response — 201 Created:
With a live key, order creation charges the clinic’s card on file synchronously. A successful charge returns 201 with status: "paid"; a failure returns 402 with card_required or payment_declined. If billing dry-run is enabled for the clinic, the order is created with status: "awaiting_payment" and billing_dry_run: true.
5

Receive webhooks

Once a VitaRelay admin has configured your endpoint and subscribed it to the events you care about, VitaRelay signs and POSTs each event to you.In the sandbox, the simulated lifecycle fires them for you a few seconds apart: intake.reviewed for the intake, then order.paid, order.shipped, and order.delivered for the order — each carrying sandbox: true.
Verify the signature before processing — see Webhook Security.

Replaying a request

All three write endpoints are idempotent on their external id. Sending the same body again returns the original record with 200 instead of 201, so retries after a network failure are safe. Reusing an external id with a different body returns 409 duplicate_request.

Next steps

REST API

Full endpoint reference, pagination, and response fields.

Webhooks

Event types, signature verification, and retry behavior.

Sandbox

Everything a vr_test_ key does differently.

Errors

Every error code and how to handle it.