> ## Documentation Index
> Fetch the complete documentation index at: https://api.vitarelay.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Practice API

> Order for your own patients using your own prescribers. VitaRelay is logistics only.

## What is the Practice API?

The Practice API is for provider practices that have their **own licensed prescribers** on file. Your doctor writes the prescription in your own EMR; VitaRelay records it as an external-source prescription and handles fulfillment, routing, and shipping. You pay VitaRelay; VitaRelay routes to the pharmacy.

This is distinct from the VitaClinic API, where prescribing happens **through VitaRelay's Internal Doctor Network (IDN)**. The Practice API does **not** use the IDN — you use your own doctors, and your own licensed provider is the prescriber of record.

<Info>
  Your prescriber must already be on your practice roster in VitaRelay (with NPI, and DEA for controlled substances). The API resolves the prescriber by NPI against your roster — it never accepts prescriber identity from the request body.
</Info>

## How it works

<Steps>
  <Step title="Pull the catalog">
    List the unified catalog (`GET /catalog`) covering all product types — R\&D, 503B, and 503A. No pricing is exposed through this API.
  </Step>

  <Step title="Include prescriber + prescription lines">
    For any order containing 503A or 503B products, include your prescriber's NPI (`prescriber_npi`) and one `prescriptions` line per prescription product. The prescriber is resolved against your roster by NPI.
  </Step>

  <Step title="Submit the order">
    `POST /orders` records an external-source signed prescription for each Rx line and creates the order. VitaRelay fulfills it and charges your card on file. Pass `external_order_id` to make retries idempotent.
  </Step>

  <Step title="Track order status">
    Poll `GET /orders/{orderId}` for status, payment, and fulfillment/tracking details.
  </Step>
</Steps>

## Product types

| Type               | Description                               | Prescription required? | Prescriber NPI required?                                        |
| ------------------ | ----------------------------------------- | ---------------------- | --------------------------------------------------------------- |
| RUO / R\&D (`rnd`) | Research-use-only products                | No                     | No                                                              |
| 503B (`503b`)      | Office-use compounded products            | Yes (recorded)         | Yes                                                             |
| 503A (`503a`)      | Patient-specific compounded prescriptions | Yes (patient-specific) | Yes — plus DEA on file if the product is a controlled substance |

## Access & scopes

| Scope                               | Grants                              |
| ----------------------------------- | ----------------------------------- |
| `catalog:read` (or `products:read`) | `GET /catalog`, `GET /catalog/{id}` |
| `orders:read`                       | `GET /orders/{orderId}`             |
| `orders:write`                      | `POST /orders`                      |

<Info>
  Test keys run in a full sandbox — no real orders or prescriptions are created and nothing is charged. Live keys create real prescriptions, real orders, and charge your card.
</Info>

## Safety & compliance

* **Tenant isolation** — you can only reference your own patients and your own prescriber roster. Anything else returns `404`.
* **Server-derived prescriber identity** — name, DEA, and license are always resolved from your roster by NPI, never accepted from the request.
* **Controlled substances** — the resolved prescriber must have a DEA on file for the patient's state, or the order is rejected with `controlled_requires_dea` before anything is written.
