Skip to main content
This cookbook is staged. You do not need most of it on day one — build intake first, get it working end to end, then come back for the next leg.

If you are an AI coding agent

Build in the stage order below. Every recipe names the exact /v0.1 path, the request body and the response shape, and the check that keeps it true. Key answers by link_id, return option codings as given, use provider_price_id at checkout, and treat a 201 as “accepted”, not “correct”. Read Known gaps and staging before deciding an empty collection is a bug. Order status is not a read: it arrives as prescription webhook events at an endpoint you register with OpenLoop (by arrangement), so do not build an order-polling loop. Recipe headings are numbered by stage on the seven stage pages (## Recipe 3.2 · …, where 3 is the stage) and unnumbered on the six When things go wrong pages (## Recipe · …), because a failure recipe belongs to a situation rather than to a stage.

What you’ll do

Build the stages in this order. Each is independently useful, and each assumes the one before it works.

1 · Start here

Authenticate, reach the API, and confirm your tenant is provisioned

2 · Intake

Create a patient, administer the right form, and submit it

3 · Payment

Take payment for a treatment. The order itself follows the clinician’s prescription

4 · Status and tracking

Status and tracking: prescription webhook events (by arrangement), and the clinician’s encounter note read by the encounter id your submit returned

5 · Scheduling

Offer availability and book visits

6 · Refills

Let a patient reapply, and track the resulting prescription

7 · Growth

Sell add-ons, upgrade a subscription, and run retention

Lab ordering

By arrangement, outside the stages: order lab tests for a patient you have already created

When things go wrong

Six pages that interrupt the stages above: payment failure, not eligible, cancel/pause/refund, order exceptions, retries and idempotency, and the error envelope itself

Recipe 1.1 · Day one

Read three pages, in this order:
  1. Getting started — hosts, credentials, the token exchange, and the response conventions every call shares
  2. Integration flow — the whole journey as a sequence diagram, plus the first-leg slice if you are staging your build
  3. Questionnaire workflow — who defines the questions and who controls presentation. Read this before you design any intake UI
Then run these five calls and confirm each one: If 3, 4 or 5 comes back empty, stop. That is not a fault in your code — your environment is not seeded yet. Raise it before writing anything, because everything downstream depends on it. Known gaps and staging explains what to ask for.
Locked by check day-one-five-calls.

What comes back

Four envelopes carry every answer in this cookbook. Learn these once and every page reads the same way.

Reference, when you need it

Gotchas

Four things worth knowing before you start. The partner surface is /v0.1, including authentication at /v0.1/auth/token. Other version prefixes are not for partners. Collections return items; writes return data. Two different envelopes, and pagination differs by resource; the product catalogue does not page yet. Getting started has the detail.
A 200 does not always mean your request was understood. Some endpoints ignore a query parameter they do not recognise and return the full collection. Check that a filtered result looks filtered.
Log request_id on every call. It is on every response, success or failure, and it is the fastest way for us to find your exact request.

What this cookbook is

Each page states what we have verified and what we have not. Where the published API reference and this cookbook disagree, tell us — we would rather fix it than have you work around it. Where a page says to ask your OLH implementation contact, that is a real handoff, not a deflection: some things are provisioned per customer and cannot be self-served yet. Those are called out explicitly rather than left for you to discover.

Getting started

Hosts, credentials, the token exchange, and the response conventions every call shares

Integration flow

The whole journey as a sequence diagram, plus the first-leg slice to build first

When things go wrong

The six failure pages, starting with the error envelope every endpoint shares