DEV Community

MattyIce
MattyIce

Posted on

Architecting Rx-Gated E-commerce with EMR Integration: Best Path for Authorize-Only Payments and Clinical Approval Workflow

How would you architect an e-commerce build for a longevity clinic given the following requirements?

Some SKUs require a prescription (including injectables), others are OTC, plus memberships and subscription packages.

The critical requirement is medical review prior to final payment capture for Rx-required SKUs.

High-level flow:

  • Customer places an order.
  • If the cart contains any Rx-required SKU, we must authorize the payment but not capture it.
  • A medical-risk assessment (rules-based binary decision model) runs using clinic-supplied thresholds and patient context.

Outcomes:

  • Approved: capture payment and fulfill.
  • More action required: hold authorization, trigger telehealth consult scheduling within 7 days, clinician manually approves or denies, then capture or void/refund.

Architecture pathways

  1. Custom or headless commerce with a middleware orchestration service (order state machine, rules engine, integrations).
  2. WooCommerce (self-hosted) with custom plugins for Rx gating, rules engine integration, and EMR sync.
  3. Split model: non-Rx storefront plus Rx enrollment portal (eligibility first, then charge), to reduce commerce platform policy risk.
  4. An alternative architecture pathway not yet considered?

Which architecture is most robust for authorize-only then capture after clinical approval, especially with telehealth escalation and manual overrides?

Top comments (0)