# How does a telehealth platform pay for and manage its practices' orders under one account?

URL: https://affinityrx.com/blog/telehealth-platform-pays-for-practice-orders
Last updated: 2026-11-22

On AffinityRx a platform creates its practices, turns on Live access for each, pays for their Live orders and gets every order event by webhook, in one account.

[Get started](https://app.affinityrx.com/sign-in)

By [Tim Yoon](https://affinityrx.com/blog/authors/tim-yoon). Published November 22, 2026

**Disclosure:** Published by AffinityRx, a compounding pharmacy ordering platform. AffinityRx is not a pharmacy.

## The short answer

On AffinityRx, a telehealth platform keeps all of its practices under its own account: it creates each practice, turns on Live orders for each one, and pays for every Live order its practices send. The platform pays with a card or bank account on file, with account credit that covers the full order, or by invoice when Affinity sets that up.

The platform sends every order with one API request, `POST /v1/orders`, naming the practice with `practiceId`. Every order event goes to the platform's webhook endpoints, so one integration sees every practice's orders.

## What does the platform own, and what does each practice own?

|                        | Platform                                         | Platform-managed practice                               |
| ---------------------- | ------------------------------------------------ | ------------------------------------------------------- |
| Account                | One organization with its own API keys           | Created by the platform, with a name, phone and address |
| Sending orders         | Sends each order with practiceId                 | Is named on each order                                  |
| Live access            | Turns Live on or off for each practice           | Starts in Test until the platform turns on Live         |
| Paying for Live orders | Pays for all of them                             | Pays nothing; billing is in the platform's workspace    |
| Prices                 | Its own price tier, or its own price for an item | Pays its platform's price; has no prices of its own     |
| Webhooks               | Receives every event for its practices' orders   | Can't have its own endpoints                            |

An independent practice, one without a platform, pays for its own orders and receives its own events.

## How does a platform add a practice?

Send `POST /v1/practices` with the practice's `name`, `phone` and `address`. All three are required, because the pharmacy needs them. `externalId`, your own ID for the practice, is optional and accepts up to 128 characters.

- **Create each practice once.** Practices are shared across Test and Live, with one ID and one `externalId`.
- **Retries don't make duplicates.** Every create needs an `Idempotency-Key`. Send the same key and body again after a timeout, and AffinityRx does not create a second practice.
- **One `externalId` per active practice.** A second create with a used `externalId` returns `409 practice_already_exists`, with the existing practice's ID in `data.practiceId`. Concurrent creates with one `externalId` create one practice.
- **Names don't identify practices.** Two practices can have the same name and address. Use the `prac_` ID or your `externalId`.

Find practices with `GET /v1/practices`, search them with `query`, or match your own ID exactly with `GET /v1/practices?externalId=practice-42`. Change one with `PATCH /v1/practices/{practiceId}`, sending only the fields that change.

## How does Live access work for each practice?

Live orders need Live access on both the platform and the practice.

1. **The platform.** A platform you create starts with Live access. If it is off, an admin adds a payment method in **Settings → Billing** and clicks **Turn on Live**.
2. **Each practice.** A new practice starts in Test, and Test orders work at once. To allow Live orders, send `"liveEnabled": true` on create or with `PATCH /v1/practices/{practiceId}`, using a Live API key. A Test key that changes `liveEnabled` gets `403 live_key_required`.

The `liveEnabled` field on a practice shows effective access: both the platform and the practice must have Live on. If Affinity turns off a platform's Live access, new Live orders for its practices get `403 mode_not_enabled`. Orders already sent to the pharmacy keep going.

## How does the platform pay for its practices' orders?

The platform pays for its practices' Live orders. A Live order needs one of these:

| Payment              | What the order needs                                                                                                     |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| Card or bank account | The platform's payment method on file. An admin adds it on the **Billing** page of the AffinityRx dashboard.             |
| Account credit       | Credit that pays the full order.                                                                                         |
| Invoice              | Nothing at order time, when Affinity has set up the platform to pay by invoice. The orders go on the platform's invoice. |

Without a payment method, credit or invoice billing, a Live order gets `409 payment_method_required`. Test orders are never billed.

Joining is free, and fees are included in the medication price. Net 7 and net 30 terms are available on request. Canceled or unfilled orders are refunded in full.

## What price does a practice's order use?

A platform-managed practice pays its platform's price. Each platform has a price tier that Affinity sets, and Affinity can also set the platform's own price for one medication or shipping option.

To quote an order for one practice, read the catalog with the platform key and send `practiceId` in the query. Order creation uses the target practice's prescription and shipping prices. A signed order keeps its prices: later catalog changes do not change the order or its invoice. All prices are integers in cents, and the order `total` is the prescription prices plus shipping.

## What does one order request look like for a platform?

One `POST /v1/orders` request creates the order, signs it for the prescriber and sends it to the pharmacy. There is no draft, sign or submit step in the API. A platform request carries:

- `practiceId`, the practice the order is for. A platform request without it returns `422`.
- `prescriber`, the NPI and name of the clinician who signs.
- `signatureAttestation: true`, stating that the named prescriber approved and signed this order in your product.
- `patient`, with your `externalId` for the patient, so later orders find the same patient in that practice.
- `prescriptions`, 1 to 20 lines, all from one pharmacy.
- `shipping.optionId`, a shipping option from the medication's catalog item.
- An `Idempotency-Key` header, so a retried request never creates a second order.

The full field rules are in [Send an order](https://docs.affinityrx.com/guides/send-an-order/).

## How do API keys and webhooks work across many practices?

**API keys.** A key acts for its own organization and mode. A key starting with `sk_test_` acts in Test; `sk_live_` acts in Live. The platform's keys cover every practice it manages, and each request names the practice. Create keys in **Settings → API**.

**Webhooks.** Each event goes to the platform of the order's practice. A platform-managed practice can't have endpoints, so the platform's endpoints receive every status change for every practice's orders. Events are signed, and Test and Live endpoints are separate.

**Patients.** AffinityRx does not email or text patients. The platform tells each patient about each status, including a failed or canceled order.

## How does a platform stop working with a practice?

A platform admin deletes a managed practice in the dashboard, on the practice's **Settings** page. This archives the practice in both Test and Live. API keys can't delete practices.

Live orders still `submitted` or `processing` block the deletion with `409 orders_in_progress`. Existing orders stay readable and keep the practice details they were signed with. Archiving frees the practice's `externalId` for a new practice.

## Frequently asked questions

### Does each practice need its own payment method?

No. The platform pays for its practices' Live orders, with its own payment method, account credit or invoice. A platform-managed practice's billing is managed in the platform's workspace.

### Can a platform pay by invoice instead of card?

Yes, when Affinity sets the platform up to pay by invoice. Then its practices' Live orders need no payment method and go on the platform's invoice.

### Does a practice start with Live access?

No. A practice a platform creates starts in Test. The platform turns on Live for it with a Live API key.

### Can a platform turn off Live for one practice?

Yes. Send `"liveEnabled": false` with `PATCH /v1/practices/{practiceId}` using a Live key. A platform can disable a practice's Live access even when its own Live access is off.

### Do practices see their own order updates?

The platform receives every event for its practices' orders. A platform-managed practice can't have its own webhook endpoints.

### Can an AI assistant manage practices?

Yes. Through MCP, an assistant connected to a platform can create a practice, change a practice, and turn Live orders on or off for a practice. Orders it creates wait for an admin to approve them. Read [Connect an AI agent (MCP)](https://docs.affinityrx.com/guides/connect-an-ai-agent/).

## Notes

Compounded medications are not FDA-approved. Licensed compounding pharmacies fill every order on AffinityRx. AffinityRx is HIPAA compliant and signs BAAs. Enterprise clients get a dedicated account executive. The API docs are public at [docs.affinityrx.com](https://docs.affinityrx.com/); start with [Practices](https://docs.affinityrx.com/guides/practices/).

## Get started

[Sign up free](https://affinityrx.com/auth/sign-up), create a Test API key and your first practice, and send a first order the same day. A demo is optional; you can book one through the [contact page](https://affinityrx.com/contact).

## Related reading

[Pharmacy API for telehealth platforms](https://affinityrx.com/businesses/telehealth-platforms) [How can a clinic order compounded medications through ChatGPT, Claude or another AI assistant?](https://affinityrx.com/blog/order-compounded-medications-with-ai-assistant-mcp) [Which compounding pharmacies can a new clinic order from on AffinityRx today?](https://affinityrx.com/blog/which-pharmacies-can-a-new-clinic-order-from)

## Keep reading

- [AffinityRx for Telehealth Platforms: One API for Compounded Orders Across Your Clinics](https://affinityrx.com/blog/affinityrx-for-telehealth-brands): AffinityRx
- [Compounding pharmacy failover: how to plan backup pharmacies without duplicate orders](https://affinityrx.com/blog/compounding-pharmacy-failover): Engineering
- [Compounding pharmacy API integration guide: orders, webhooks and Test mode](https://affinityrx.com/blog/compounding-pharmacy-routing-api-guide): Engineering
- [AffinityRx pricing guide: what clinics and platforms pay, and how billing works](https://affinityrx.com/blog/affinityrx-pricing-guide): AffinityRx

## Every compounding pharmacy in one dashboard

Sign up free to compare prices across the pharmacies live on AffinityRx.

[Get started](https://app.affinityrx.com/sign-in)
