AffinityRx is a compounding pharmacy ordering platform, not a pharmacy. Licensed compounding pharmacies fill every order, and compounded medications are not FDA-approved.
How the platform model works
| Piece | How it works on AffinityRx |
|---|---|
| Account | One platform account holds all of your practices (clinics) |
| Practices | Create each once with POST /v1/practices; send your own ID as externalId |
| Orders | One POST /v1/orders per order, with practiceId; it creates, signs and sends the order |
| Pharmacies | A network of 30+ vetted pharmacies; four orderable today for a new account: Perfect Rx, ProCompounding, Rx Route and National Health Rx |
| Prices | The catalog quotes each pharmacy's price for the same medication; the order keeps the prices shown at signing |
| Status | Signed webhooks to your endpoints for each status change |
| Billing | The platform pays for its practices' Live orders: card, bank account, prepaid balance, or net 7 or net 30 terms on request |
| Test mode | Free; a sk_test_ key sends orders to a pharmacy simulator |
| AI assistants | MCP orders wait for an admin to approve them before they reach a pharmacy |
Step 1: Create your practices
Each clinic you serve is a practice. Create it once with a name, phone and address, and keep the returned prac_ ID:
curl https://api.affinityrx.com/v1/practices \
-H "Authorization: Bearer $AFFINITY_API_KEY" \
-H "Affinity-Version: 2026-11-01" \
-H "Idempotency-Key: practice-42-create" \
-H "Content-Type: application/json" \
--data '{"externalId":"practice-42","name":"Example Practice","phone":"+15125550123","address":{"line1":"200 Example Ave","city":"Austin","state":"TX","postalCode":"78701"}}'
Facts from the practices guide:
- Practices are shared across Test and Live. Create each one once.
externalIdis unique among your active practices. A second create with the same value returns409 practice_already_existswith the existing practice ID, so a retry never makes a duplicate clinic.- A new practice starts in Test. You turn on Live for each practice with
"liveEnabled": true, using a Live key.
Step 2: Send an order for a practice
One request creates, signs and sends the order. With a platform key, practiceId is required. The request names the prescriber by NPI and name and sends signatureAttestation: true, which states that the named prescriber approved and signed this order in your product.
Rules your engineers will hit first (from Send an order):
- An order has one practice, one patient, one prescriber and 1 to 20 prescriptions, all from one pharmacy. Send a separate order for each pharmacy.
Idempotency-Keyis required. A retry with the same key and body returns the original order instead of creating a second one.externalOrderIdis your order ID. A second order with the same value for the practice returns409 order_already_exists.- Send
patient.externalIdso later orders find and update the same patient. - Each API key can make 25 requests per second, with bursts of 50.
Step 3: Receive signed webhooks
Register an https endpoint with POST /v1/webhook-endpoints and store the signing secret it returns. Each event carries an Affinity-Signature header: an HMAC-SHA256 of the timestamp and raw body, which you check in constant time and reject if the timestamp is more than 300 seconds off.
| Event | Sent when |
|---|---|
order.submitted |
AffinityRx accepted the order and sends it to the pharmacy |
order.processing |
The pharmacy has the order |
order.shipped |
At least one package left the pharmacy |
order.delivered |
Every package AffinityRx knows about was delivered |
order.cancelled |
The order was cancelled |
order.failed |
The order could not proceed; read failureReason |
order.updated |
A shipment was added or changed, or a cancel was refused |
On a platform, every event for any of your practices goes to the platform's endpoints. Your practices don't run their own endpoints. Your platform tells the patient about each status. See Receive order updates.
Step 4: Billing for many clinics
The platform pays for its practices' Live orders. Billing for a platform-managed practice is managed in the platform's workspace.
- Each Live order is charged when AffinityRx sends it to the pharmacy, from account credit first, then the card or bank account on file.
- Net 7 or net 30 terms are available on request. When AffinityRx sets up the platform to pay by invoice, its practices' Live orders go on the platform's invoice, and no payment method is needed for each order.
- Joining is free, with no subscription and no minimums. Fees are included in the medication price.
- Shipping is a flat rate per order at every pharmacy: $15 ground or 2-day, $20 overnight, $25 cold-chain ground or 2-day, $30 cold-chain overnight.
- Canceled or unfilled orders are refunded in full. Test orders are never billed.
See the pricing guide for the full billing rules.
Optional: let an AI assistant prepare orders
A clinician or staff member can connect ChatGPT, Claude or another MCP assistant at https://api.affinityrx.com/v1/mcp. The assistant signs in as that person and can find medications and prepare orders. Every order it creates waits with the status awaiting_approval until an admin of the organization clicks Send in AffinityRx. Nothing reaches a pharmacy before that. For a platform, an assistant can also create and change practices. See Connect an AI agent.
What AffinityRx does not do for a telehealth platform
- It is not an EMR, intake form, prescriber network or patient messaging tool.
- It does not move an order to another pharmacy on its own. You pick the pharmacy for each order.
- It does not check state board rules on each order. Catalog items can carry per-state restrictions, and an order to a restricted destination state is refused.
- It does not handle controlled substances. Testosterone and other scheduled drugs can't be ordered.
- It does not show turnaround per pharmacy. Shipping options and their prices are shown before ordering.
Who AffinityRx suits, and who it doesn't
AffinityRx suits a platform that:
- runs its own front end and clinician approval flow and wants one API for compounded orders;
- serves several clinics and wants one account to pay for all of them;
- wants to compare pharmacy prices for the same medication before it sends each order.
Another option may fit better if:
- you need controlled substances, including TRT with testosterone;
- you want a full white-label stack with intake, clinicians and pharmacy bundled;
- you need a pharmacy that is not among the four orderable today.
FAQs
How does a telehealth platform send orders for many clinics through one API?
It creates each clinic as a practice with POST /v1/practices, then sends each order with POST /v1/orders and that practice's practiceId. One platform API key covers every practice, and one set of webhook endpoints receives every practice's events.
Who pays for a platform's clinic orders?
The platform pays for its practices' Live orders from its own billing, by card, bank account, prepaid balance or, on request, net 7 or net 30 terms.
Can we test the integration before sending real orders?
Yes, and it is optional. A sk_test_ key sends orders to a pharmacy simulator with the same validation, statuses and webhook events, and Test orders are never billed. Perfect Rx Test orders move to shipped and delivered on their own, at about 10 and 30 minutes.
Which pharmacies can our clinics order from?
AffinityRx works with a network of 30+ vetted pharmacies. Today a new account can order from four: Perfect Rx, ProCompounding, Rx Route and National Health Rx.
Does AffinityRx work for men's health brands?
For non-controlled medications, yes. Testosterone is a controlled substance and can't be ordered on AffinityRx. See the men's health telehealth page.
Do we need a demo or a sales call?
No. Sign up, read the public docs at docs.affinityrx.com, and send a first Live order the same day with a card or bank account. Enterprise clients get a dedicated account executive.
Get started
Sign up free and send a first order the same day. A demo is optional; request one here. For the full request and webhook flow, read the compounding pharmacy API integration guide and the telehealth platforms page.
Sources
- AffinityRx docs: "Practices", "Send an order", "Receive order updates", "Test and Live mode, and IDs" and "Connect an AI agent (MCP)", docs.affinityrx.com (checked 2026-11-22)
