Blog/WooCommerce Prescription Verification: A Complete Setup Guide
TutorialsFebruary 25, 2026|8 min read

WooCommerce Prescription Verification: A Complete Setup Guide

Rx

RxCompliant Team

Prescription verification experts

WooCommerce powers over 5 million online stores, and a growing number of them sell medical devices that require prescription verification. If you are running a WooCommerce store and need to comply with FDA requirements for prescription medical devices, this guide walks you through the complete setup.

Prerequisites

Before you begin, make sure you have:

  • A WooCommerce store running WordPress 6.0 or later
  • WooCommerce 8.0 or later installed and configured
  • An SSL certificate (HTTPS) — required for handling sensitive medical data
  • A RxCompliant account (free tier is fine for getting started)

Method 1: JavaScript Widget (Recommended)

The simplest integration method is adding the RxCompliant widget script to your WooCommerce product pages.

Step 1: Add the Script to Your Theme

In your WordPress admin, go to Appearance > Theme File Editor and open your theme's functions.php file. Add the following code:

function rxcompliant_enqueue_script() {
    if (is_product()) {
        wp_enqueue_script(
            'rxcompliant-widget',
            'https://rxcompliant.com/embed/rx-widget.js',
            array(),
            null,
            true
        );
    }
}
add_action('wp_enqueue_scripts', 'rxcompliant_enqueue_script');

Step 2: Add the Widget Container

You need to add a container div to your product pages where the widget will render. Add this to your functions.php:

function rxcompliant_widget_container() {
    global $product;
    if ($product && $product->get_meta('_rx_required') === 'yes') {
        echo '<div id="rx-widget"
              data-store-id="YOUR_STORE_ID"
              data-product-id="' . $product->get_id() . '">
             </div>';
    }
}
add_action('woocommerce_before_add_to_cart_button', 'rxcompliant_widget_container');

Step 3: Mark Products as Prescription-Required

For each product that requires a prescription, add a custom field:

  1. Edit the product in WooCommerce
  2. Scroll to the Product data section
  3. Click the Custom fields tab (you may need the Advanced Custom Fields plugin)
  4. Add a field named _rx_required with value yes

Method 2: WooCommerce Webhook Integration

For more advanced integration, you can use WooCommerce webhooks to connect with the RxCompliant API. This method gives you greater control over the checkout flow.

Configure Webhooks

In your WordPress admin, go to WooCommerce > Settings > Advanced > Webhooks and create a webhook for the order.created event. Point it to your RxCompliant webhook endpoint, which you can find in your dashboard under Settings > Integrations.

Order Status Flow

With webhook integration, the order flow becomes:

  1. Customer places order — status set to "On Hold"
  2. RxCompliant receives the webhook and sends the customer a prescription upload link
  3. Customer uploads prescription, AI verifies it
  4. If approved, RxCompliant sends a webhook back updating the order to "Processing"
  5. If rejected, the customer is notified and can re-upload

Method 3: REST API Integration

For fully custom WooCommerce setups, the RxCompliant REST API provides complete control. You can create verifications, check status, and manage rules programmatically.

Key API endpoints:

  • POST /api/v1/verifications — create a new prescription verification
  • GET /api/v1/verifications/:id — check verification status
  • POST /api/v1/verifications/:id/approve — manually approve a verification
  • GET /api/v1/products — list products requiring prescriptions

Testing Your Integration

Before going live, thoroughly test every scenario:

  • Product page displays the prescription widget correctly
  • Uploading a valid prescription enables the Add to Cart button
  • Uploading an invalid document shows an appropriate error message
  • Prescriptions with expired dates are correctly rejected
  • NPI verification is working (check your RxCompliant dashboard)
  • Orders are held appropriately until prescriptions are verified
  • Email notifications are being sent to customers and staff

Going Live

Once testing is complete, your WooCommerce store is ready to sell prescription-required medical devices compliantly. Monitor your RxCompliant dashboard during the first few days to catch any edge cases, and review the AI's verification decisions to fine-tune your auto-approve rules.

Need help with your WooCommerce integration? Sign up for RxCompliant and contact our support team — we are happy to walk you through the setup.

Start verifying prescriptions today

Add AI-powered prescription verification to your store in under 10 minutes. Free to start, no credit card required.

Create free account →

Related articles