AffinityRx
Products
AffinityRx for Clinics30+ pharmacies in our network. One dashboard / API. Partners save an average of 30%.AffinityRx for TelehealthOne API. 30+ pharmacies in our network. Fewer backorders.AffinityRx for Whitelabel TelehealthOne pharmacy API for every brand you serve.AffinityRx for PharmaciesReach independent practices through one connection.
Company
About UsWhy we built AffinityRx and how it works.Our TeamThe people behind AffinityRx.Contact UsReach our support team directly.CareersDo your life's work at AffinityRx.Partner ProgramEarn 30% of our margin on referrals for 1 year.InvestorsThe business model, market, and team.
Resources
MedicationsThe full catalog and every medication page.PharmaciesPharmacy profiles, state coverage, and FDA actions.SolutionsHow AffinityRx works for each kind of clinic and brand.BlogGuides to compounding pharmacies, pricing, and ordering.
Products
AffinityRx for Clinics30+ pharmacies in our network. One dashboard / API. Partners save an average of 30%.AffinityRx for TelehealthOne API. 30+ pharmacies in our network. Fewer backorders.AffinityRx for Whitelabel TelehealthOne pharmacy API for every brand you serve.AffinityRx for PharmaciesReach independent practices through one connection.
Company
About UsWhy we built AffinityRx and how it works.Our TeamThe people behind AffinityRx.Contact UsReach our support team directly.CareersDo your life's work at AffinityRx.Partner ProgramEarn 30% of our margin on referrals for 1 year.InvestorsThe business model, market, and team.
Resources
MedicationsThe full catalog and every medication page.PharmaciesPharmacy profiles, state coverage, and FDA actions.SolutionsHow AffinityRx works for each kind of clinic and brand.BlogGuides to compounding pharmacies, pricing, and ordering.
Products
AffinityRx for Clinics30+ pharmacies in our network. One dashboard / API. Partners save an average of 30%.AffinityRx for TelehealthOne API. 30+ pharmacies in our network. Fewer backorders.AffinityRx for Whitelabel TelehealthOne pharmacy API for every brand you serve.AffinityRx for PharmaciesReach independent practices through one connection.
Company
About UsWhy we built AffinityRx and how it works.Our TeamThe people behind AffinityRx.Contact UsReach our support team directly.CareersDo your life's work at AffinityRx.Partner ProgramEarn 30% of our margin on referrals for 1 year.InvestorsThe business model, market, and team.
Resources
MedicationsThe full catalog and every medication page.PharmaciesPharmacy profiles, state coverage, and FDA actions.SolutionsHow AffinityRx works for each kind of clinic and brand.BlogGuides to compounding pharmacies, pricing, and ordering.
PricingDocs
Talk to salesGet started
AffinityRx
Talk to salesGet started
Home/Blog/Compounding pharmacy failover: how to plan backup pharmacies without duplicate orders

Compounding pharmacy failover: how to plan backup pharmacies without duplicate orders

BackupRx

AffinityRx has no automatic failover; the clinic picks the pharmacy. How to plan backup pharmacies and switch an order safely, stage by stage.

Get started

By Tim Yoon. Published September 30, 2026. Updated November 22, 2026

Keep reading

  • How to Verify a Compounding Pharmacy's License, 503B Registration and AccreditationsCompliance
  • Tracking AffinityRx Orders: Tracking Numbers, Delivery Issues and ReshipsAffinityRx
  • AffinityRx Objections Answered: "We Already Have a Pharmacy" and MoreAffinityRx
  • How does a telehealth platform pay for and manage its practices' orders under one account?Engineering
PreviousAffinityRx pricing guide: what clinics and platforms pay, and how billing worksNextCompounding pharmacy API integration guide: orders, webhooks and Test mode

Every compounding pharmacy in one dashboard

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

Get started

On this page

  1. Why not switch pharmacies automatically?
  2. How does a pharmacy switch work on AffinityRx?
  3. Step 1: Build a backup matrix before you need it
  4. Step 2: Decide by order stage
  5. Step 3: Prevent duplicates
  6. Step 4: Know the real state of every open order
  7. Step 5: Tell the patient once
  8. Step 6: Rehearse the switch
  9. Questions to ask any pharmacy platform about failover
  10. FAQs
  11. Get started
AffinityRx

30+ pharmacies in our network. One dashboard / API. Save time and money.

Verify Approval for www.affinityrx.com

Products

  • Clinics
  • Telehealth
  • Whitelabel Telehealth
  • Pharmacies
  • Pricing

Company

  • About Us
  • Our Team
  • Contact Us
  • Careers
  • Partner Program
  • Investors
  • Brand assets

Resources

  • Medications
  • Pharmacy directory
  • Solutions
  • Blog
  • Features
  • Challenges
  • How to choose a pharmacy
  • How to choose an ordering platform

Developers

  • API docs
  • Build an integration
  • Webhooks
  • MCP
  • Changelog

Support

  • Call us: 714-254-5656
  • Email us
  • Service availability
  • Terms of Service
  • Privacy Policy
© 2026 Incubator LLC d/b/a AffinityRx · support@affinityrx.com
Call 714-254-5656Get started

On AffinityRx there is no automatic failover: the clinic picks the pharmacy for each order, and AffinityRx never moves an order to another pharmacy on its own. Compounding pharmacy failover is a planned human decision: you choose a backup pharmacy for each medication in advance, and when the first pharmacy can't fill, you confirm that the first order is cancelled or failed before the prescriber signs a new order at the backup.

This guide shows how a clinic or telehealth platform plans that backup and switches without sending the same prescription twice. AffinityRx publishes it; the AffinityRx rules quoted here come from the public docs at docs.affinityrx.com.

Why not switch pharmacies automatically?

A compounded prescription is written and signed for one preparation from one pharmacy. Moving it can change the formulation, the price, the shipping and the patient's allergy handling. An automatic resend after a timeout can also produce two orders, two shipments and two charges if the first pharmacy was still working on it. FDA notes that it "does not verify the safety, effectiveness or quality of compounded drugs before they are marketed" (FDA, Compounding Q&A, checked 2026-11-22), so a backup pharmacy is a clinical and quality choice, not only a technical one.

How does a pharmacy switch work on AffinityRx?

FactWhat it means for your backup plan
The clinic picks the pharmacy for each orderYour backup choice is made by a person, per order
A medication ID names one strength, form, fill size and pharmacyThe same drug at a backup pharmacy has a different ID; check that it matches
expand=variants on a medication read lists its other pharmacies, strengths and fill sizesOne request finds the backup options for a medication
All prescriptions in one order go to one pharmacyA switch is a new order, not an edit
A signed order keeps its pharmacy, medication and pricesThe original order never changes pharmacy
Canceled or unfilled orders are refunded in fullYou do not pay twice for a switched order
A new order needs the prescriber's approval and signatureThe prescriber signs again for the backup pharmacy

AffinityRx works with a network of 30+ vetted pharmacies. Today a new clinic can order from four: Perfect Rx, ProCompounding, Rx Route and National Health Rx. A realistic backup plan uses those four, and some medications may have only one orderable pharmacy.

Step 1: Build a backup matrix before you need it

For each of your most-ordered medications, record:

ColumnExample of what to write
Medication, strength, form, fill sizeThe exact catalog entry you order
Primary pharmacyName and medication ID
Backup pharmacyName and medication ID of the matching variant
DifferencesFill size, strength text, receivesAllergies, requirements, restrictedStates
Price at each pharmacyFrom the catalog, so the prescriber and finance know the change
ShippingCold chain needed or not; shipping is the same flat rate at every pharmacy on AffinityRx
Who approves the switchThe prescriber, and who tells the patient

Check restrictedStates for every state you ship to. A backup that can't ship to the patient's state is not a backup. Also check receivesAllergies: when it is false, the patient's allergies do not reach that pharmacy, and the prescriber must know before signing.

Step 2: Decide by order stage

The safe action depends on the order's status.

Status of the first orderSafe action
Not sent yet (your own queue)Pick the backup pharmacy and send one order there
submittedRequest a cancel; wait for cancelled before sending a new order
processingThe pharmacy has it and may have filled it. Request a cancel and expect a possible refusal
shipped or deliveredDo not send a backup order. Handle a delivery problem as a delivery problem
failedRead failureReason, then send a new order at the right pharmacy
cancelledSend the new order. Keep watching events: a pharmacy can ship after it confirms a cancel
No response from your requestResend with the same Idempotency-Key and body; do not create a new order

Facts behind this table, from the AffinityRx docs (checked 2026-11-22):

  • A cancel request is not final until the order is cancelled. While cancelRequestedAt is set, the pharmacy can still refuse, which returns 409 cancel_refused or sends order.updated.
  • Perfect Rx refuses a cancel after it fills and verifies the order.
  • A cancelled order can still become shipped or delivered if the pharmacy shipped it. If that happens, the order is billed because it shipped.
  • In Live mode, an order does not become failed automatically. A failed order carries a written reason in failureReason.

Step 3: Prevent duplicates

Duplicates are the main risk of any pharmacy switch. Use these controls:

  • One key per order attempt. Save the Idempotency-Key with the order before the first request. A retry with the same key and body returns the first order. A new key with the same body creates a second order.
  • Unique order IDs. externalOrderId is unique per practice. A second order with the same value returns 409 order_already_exists, and a cancelled or failed order keeps its ID. Give the replacement a new ID and record that it replaces the first.
  • Link the two orders. Store the first order's ID, its final status and the reason next to the replacement.
  • Never two open orders for one prescription. Block a replacement while the first order is submitted or processing without a confirmed cancel.

Step 4: Know the real state of every open order

  • Webhooks. Each status change sends a signed event. Process each event ID once and keep the copy with the newest updatedAt.
  • Polling. To recover missed events, list orders with GET /v1/orders?updatedAfter=… and follow every page.
  • Watch the slow ones. List GET /v1/orders?status=processing and review orders that have not moved in the time you expect for that medication.
  • Delivery reports vary. Some pharmacies never report delivery, so a Live order can stay shipped. Use each shipment's trackingUrl.

AffinityRx does not show turnaround per pharmacy. Build your own expected times from your order history.

Step 5: Tell the patient once

AffinityRx does not email or text patients. Your clinic or platform tells the patient about a delay, a cancel and a new pharmacy. Send one message per change, after the change is confirmed, so the patient never hears about two orders.

Step 6: Rehearse the switch

Run the switch in Test mode before you need it. Perfect Rx Test orders support outcome prefixes in notes:

  • test_fail_ makes the test pharmacy refuse the order, so you can practice a replacement.
  • test_cancel_refused_ makes a cancel fail after processing, so you can practice the "can't cancel" path.
  • test_split_shipment_ sends two packages, so you can practice partial delivery.

A rehearsal passes when your team can find the affected orders, confirm each one's final status, send one replacement per prescription, get the prescriber's signature, and tell each patient once.

Questions to ask any pharmacy platform about failover

  1. Does the platform ever move an order to another pharmacy without a person deciding? (On AffinityRx: no.)
  2. How do you make a retried request safe, and what key do you use?
  3. What does a cancel return when the pharmacy refuses it?
  4. Can a cancelled order still ship, and how will we hear about it?
  5. Who pays when an order is cancelled or can't be filled?
  6. Which pharmacies can we order each of our medications from today, by name?

FAQs

Does AffinityRx have automatic pharmacy failover?

No. The clinic picks the pharmacy for each order, and AffinityRx does not move orders between pharmacies on its own. If a pharmacy can't fill an order, the order is refunded in full, and the clinic can send a new order to another pharmacy after it sees that pharmacy's price.

How do I switch an order to another pharmacy on AffinityRx?

Cancel the first order and wait until it is cancelled, or read failureReason if it failed. Then send a new order for the matching medication at the other pharmacy, with a new externalOrderId and a new Idempotency-Key, signed by the prescriber.

Can I resend an order to a backup pharmacy after a timeout?

Not as a new order. Resend the same request with the same Idempotency-Key and body. AffinityRx returns the order the first request created, so you learn its real status without creating a duplicate.

How many backup pharmacies does a clinic need?

One per critical medication, at minimum, if the medication is available at more than one pharmacy you can order from. Today a new AffinityRx clinic can order from four pharmacies, so some medications may have one option only.

Can I cancel an order that is already processing?

You can ask. The pharmacy may already have filled it, and Perfect Rx refuses a cancel after filling and verification. Wait for the outcome before you send a replacement.

What does a pharmacy switch cost?

A canceled or unfilled order is refunded in full, and the new order is charged at the backup pharmacy's price plus the flat shipping rate. An order that ships after a cancel request is billed because it shipped.

Get started

Sign up free to see which pharmacies carry each of your medications and their prices, and send a first order the same day with a card or bank account at checkout. A demo is optional; request one here. For the API details, read the compounding pharmacy API integration guide. To compare pharmacies, see the pharmacy network.

This guide is operational guidance, not legal or clinical advice. Compounded medications are not FDA-approved.