WooCommerce + NPI API Numbers: WooCommerce Checkout with NPPES API

WooCommerce + NPI API Numbers: WooCommerce Checkout with NPPES API

NPI Numbers with WooCommerce Checkout - NPPES

While building www.regenmedtech.com last month, one essential need of our client was the ability to put purchases behind a check for registration of an active National Provider Identifier (NPI) number. Per the government website, “healthcare providers acquire their unique 10-digit NPIs to identify themselves in a standard way throughout their industry.”

This check allowed our client to make sure his product would only be available to registered healthcare providers. Thankfully, NPPES (National Plan and Provider Enumeration System) has an API (Application Programming Interface) that allowed us to easily hook in and check for an existing NPI number.

The Fun Part: Integrating NPI Numbers with WooCommerce Checkout

Now, the question was how to properly integrate this with WooCommerce to provide the best user experience. We tried a few different approaches to integrate this API to make the NPI number check.

First, we attempted to integrate this check into the WooCommerce Cart page. Using WooCommerce’s built-in hooks, we removed the proceed to checkout button. To make the button appear and allow a customer to continue checking out, they would need to enter their NPI number on the cart page, and then using the API, the number they entered was compared with the current NPPES registry. If the check came back successful, the “proceed to checkout” button appeared and allowed the user to continue the checkout process. If the check came back unsuccessful, the user received an error message telling them that they needed a valid NPI number to continue.

The Challenges That Arose

While simple to implement, a couple of problems became clear immediately. First, this created a bit of a cumbersome speed bump to the checkout process. Second, a clever user could simply bypass this check by directly going to the checkout URL in their browser. So, not ideal.

So, we decide to move the NPI check to the checkout page. This page already required the user to enter in information to purchase the product, so it only made sense that this would be the spot to also have the user enter in their API number.

To do this, a different approach was taken. Instead of simply hiding a button behind the NPI check, we had to create a custom checkout field. Thanks to <a href=”https://docs.woocommerce.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/“>WooCommerce fantastic documentation</a>, this was an extremely easy task. So, we added a custom field that contained our hook to the NPPES API. Now, the user was asked to enter in their NPI at checkout. If the field was left blank or a false number was entered, after clicking “place order” the user would be prompted to enter a valid NPI number.

This was the ideal solution. It put the NPI field on the checkout page that already had numerous fields that the user needed to fill out, and it seamlessly integrated into WooCommerce.

The End Result: Automated Process + Happy Client

The client was VERY happy with the end result. They originally imagined hiding this process behind a form that the user would need to fill out before being granted access to the product. This would require a human to take the users submitted NPI number and manually checking it to the NPPES registry. With our solution though, this became completely automated!

Let Us Streamline Your User Experience!

Need help streamlining your user experience? Want a fresh coat of paint on your site?

Drop us a line today!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

back to top