There may come a time where you need to ensure that the postal codes entered in by your UK customers are valid. The code recipe below uses the free third-party Postcodes.io API to validate the postal code upon checkout. This code recipe could be adapted to validate for other regions.
This content requires a premium membership plan.
Author: Jarryd Long
Jarryd is a Technical Support Engineer at PMPro. He prides himself on offering the best support to our customers and has been a part of the WordPress space since his high school days. He's developed a variety of plugins as well as spoken on the topic of providing outstanding support to customers.