WooCommerce Address Validation

Overview

↑ Back to top
The WooCommerce Postcode / Address Validation extension connects your store to one of several providers, letting you easily provide US address validation, postcode lookup for the UK or NL, or offer international address lookup.
Heads up! The SmartyStreets integration was retired on October 4, 2022. US stores must switch to Loqate to continue using Postcode/Address Validation with WooCommerce. Learn more about the retirement or view instructions for setting up Loqate

As of WooCommerce 8.3, Cart and Checkout blocks are available as the default experience. WooCommerce Address Validation has not yet been updated to be compatible with those blocks, so we recommend following this guide to revert to Cart/Checkout shortcodes. Additional plugin updates will soon be released to ensure compatibility with the new block checkout. Please check out this page for the latest updates or reach out to our support team with any questions!

Provider comparison

↑ Back to top
To perform lookups or validation, this plugin will connect your store to your account with one of the following services:
Provider Services offered Countries Free Lookups?
Loqate Address auto-complete Classify addresses all countries
Loqate (legacy) Postcode lookup UK
Postcode.NL Postcode lookup NL
Postcode Software Postcode lookup UK
Fetchify Postcode lookup UK 30 total

Installation

↑ Back to top
  1. Download the extension from your WooCommerce dashboard
  2. Go to Plugins > Add New > Upload and select the ZIP file you just downloaded
  3. Click Install Now, and then Activate
  4. Click the Configure link and read the next section to learn how to setup and configure the plugin.

Setup and Configuration

↑ Back to top
Plugin settings can be found under WooCommerce > Settings > Address Validation. Here you’ll select your provider and configure general settings, along with some provider-specific settings. General Settings can change based on your selected provider.
  • Provider – Select the provider you’d like to use for address validation or postcode lookup.
  • Debug Mode – Enable this to output debugging information on the checkout page. As a best practice, you should leave this disabled unless you experience issues with the plugin.
  • Classify Addresses? – (US providers) Enable this to save an address classification (Residential or Commercial) to the order.
  • Force Customer to lookup address via postcode – (Postcode lookup providers) Enable this to force customers to use postcode lookup; address fields will be hidden until lookup is used. Note that once the customer clicks “Lookup Address”, the address fields are displayed regardless of whether the lookup is successful.
WooCommerce Address Validation: General settings - postcode lookup
General Settings 2

Loqate Settings

↑ Back to top
Upon signup, Loqate offers a limited amount of free lookup credits during the trial period. Once the credit or trial has expired, depending on region, a paid account will be required. Loqate can be used for address lookup / auto-complete in any country with a paid account. Please ensure you have enough credits in your account to allow for uninterrupted use of the service.
If you had previously signed up with the Addressy service, Loqate has grandfathered in a small number of free lookups each month for legacy users of this service. New users to the Loqate service are not entitled to these free lookups each month and are instead granted free credits upon signup.
WooCommerce Address Validation: Loqate settings
Loqate settings
  • Service Key – Enter your service key from Loqate. You can follow the instructions below to get this.
  • Validate International Addresses – Enable this to allow address auto-complete for addresses outside of the US. When disabled, only US addresses will use Loqate to lookup addresses.

Postcode.NL Settings

↑ Back to top
Postcode.NL offers NL address lookup via postcode. A customer can enter his or her postcode to lookup a full address; this auto-completes the checkout fields when selected. WooCommerce Address Validation: Postcode.nl settings

Loqate (legacy) Settings

↑ Back to top
The legacy Loqate integration offers UK address lookup via postcode. A customer can enter his or her postcode to lookup a full address; this auto-completes the checkout fields when selected.
WooCommerce address validation: Loqate legacy settings
Loqate (legacy) settings
  • API Key – Enter the API key from your Loqate Account. You can follow the instructions below to get this.
  • API Username – Enter the username associated with your Royal Mail account. If you do not have a Royal Mail account, leave this blank.

Postcode Software Settings

↑ Back to top
Postcode Software offers UK address lookup via postcode. A customer can enter his or her postcode to lookup a full address; this auto-completes the checkout fields when selected. WooCommerce Address Validation: PostcodeSoftware settings

Fetchify Settings

↑ Back to top
Fetchify offers UK address lookup via postcode. A customer can enter his or her postcode to lookup a full address; this auto-completes the checkout fields when selected. WooCommerce Address Validation: Fetchify Settings

Connect to a Service

↑ Back to top
To complete set up, you’ll need credentials from your chosen service to connect the plugin to your account. Please read the instructions for your service to get account API or Service Key credentials for your store.

Loqate

↑ Back to top
A Loqate account is required to use address auto-complete via Loqate. Merchants in any country can use Loqate to auto-complete addresses in all countries they sell to. Sign into your Loqate account and follow these steps:
  1. Click the “Add service” button at the top of your account dashboard. WooCommerce Address Validation: Loqate Key step 1
  2. Click on “API key” to create a new key for your store. WooCommerce Address Validation: Loqate Key step 2
  3. Copy the service key generated by Loqate: WooCommerce Address Validation: Loqate Key step 3
  4. Enter this service key in the plugin settings, then save your settings.
  5. Optional: You can adjust the name of this key under “Configuration”, and set limits under “Limits”, such as restricting the number of lookups per day, limiting this key to a single URL for your site (recommended), or limiting the number of lookups by customer.
That’s it! You can now lookup and auto-complete addresses via Loqate.

Postcode.NL

↑ Back to top
Log in to your Postcode.nl account and create an application for use with your web store. After signing up, you will receive an email containing an application key and secret, which is needed to integrate with this extension. Once you have this information, you can add it into the text box on the WooCommerce > Settings > Address Validation > Postcode.nl page and save your settings. That’s it! Your customers can now lookup their address via Postcode on the checkout page.

Loqate (legacy UK)

↑ Back to top
Please follow the setup steps described above for your Loqate account — you’ll use your new “Service Key” in the “API key” field within the plugin settings.

Postcode Software

↑ Back to top
Enter your PostcodeSoftware.net username and password into the text boxes on the WooCommerce > Settings > Address Validation > PostcodeSoftware.net, then save your settings. That’s it! Your customers can now lookup their address via Postcode on the checkout page. You may want to test your checkout to make sure everything is working correctly.

Fetchify

↑ Back to top
First, login to your Fetchify account (you can sign up for a free trial with 30 lookups), then follow these steps:
  1. Click “Access Tokens & Statistics” on the left, then click on your access token: WooCommerce Address Validation: Fetchify setup 1
  2. Copy the token value: WooCommerce Address Validation: Fetchify setup 2
  3. Enter this token in the plugin settings and save them.
Click on your token and copy the Access Token information: That’s it! Your customers can now lookup their address via Postcode on the checkout page.

Customer Experience

↑ Back to top
Postcode lookup, address auto-complete, or address verification will help your customers complete checkout accurately, ensuring that your shipments are going to the right place. Each provider works slightly differently, but here are examples of how each type of lookup will function on your checkout.

Loqate Auto-complete

↑ Back to top
Loqate provides address auto-completion for customers in any country. At checkout, customers can begin to enter an address, and Loqate will display a list of suggestions for the currently selected country. Customers can then select an address from the list, and address fields will be populated automatically.

Postcode Lookup

↑ Back to top
Postcode lookup works the same way for UK and NL providers: Postcode.NL, Postcode Software, and Fetchify. Postcode lookup allows the customer to enter a postcode, and then select an address from a list of suggestions. This will populate all checkout fields once an address is selected. You can even opt to hide the address fields until the lookup is used.

My Account Pages

↑ Back to top
Postcode or address lookup is available via the “My Account” section for your site as well. While editing or adding new addresses, customers can use your configured provider to lookup or validate an address.
WooCommerce Address Validation: Account page address completion
Account Page Lookup (Loqate)
Postcode lookup can be used as well based on your settings and configured provider.
WooCommerce postcode lookup shipping address
“My Account” Postcode Lookup

Troubleshooting

↑ Back to top
Having trouble? Check if these pointers help you solve your problem before posting a support request:
  • Check that you have entered your API key/Access Token correctly.
  • Double-check that you have entered your API key correctly. 😉
  • Confirm that you have enough credits with your selected provider to perform verifications or lookups.
  • Double-check that you have enough credits with your selected provider. 😉 for example, Loqate will say it can’t retrieve an address when you’re out of credits: WooCommerce Address Validation: Loqate out of credits
  • Verify that there are no javascript errors on the checkout page — address lookup and verification rely on checkout javascript to be functioning properly. If you have a third-party theme or plugin that is breaking your javascript, it will likely affect this plugin as well.
  • Ensure that the country field is present on your checkout page so the plugin can get accurate results. If you’ve customized your checkout and removed this, it can cause issues with address lookup.
  • Worried about orders going through if US Validation fails? Please see our FAQ below.
  • Enable Debug mode by going to WooCommerce > Settings > Address Validation and checking the “Debug Mode” checkbox. This will output information to the checkout page that will help in locating the source of the issue.
  • If these steps don’t help narrow down the issue, please submit a help request and we’d be happy to assist.

PostcodeSoftware.net

↑ Back to top
If your postcode lookup results don’t have house number data, please ensure that your PostcodeSoftware account has Premise Level Credits added to it. This will ensure that premise-level data, such as the house numbers, is included in the results PostcodeSoftware returns.

Frequently Asked Questions

↑ Back to top
Q: Can I use postcode lookup or address validation while adding an order in the admin? A: Afraid not, sorry! This feature is available for customer use on the checkout and my account pages, but not from within the orders admin. If you’d like to see changes like this to our plugins, you can suggest them or vote on the ideas board.
Q: Help! My customers can still check out even though the address is not validated. A: This is the expected behavior of the plugin and is part of the way the address validation libraries work. Validation will suggest the “recommended” correction, but it will not block an order from processing if validation fails. The customer must ensure the address is correct, as there are legitimate reasons it may not validate; for example, it may be a new address / new construction that Loqate doesn’t have logged yet, and the order should not be blocked as a result. This also ensures that, if for some reason the validation service’s servers are ever unreachable, the checkout isn’t completely locked down if it can’t validate addresses.
Q: Can I use this with One Page Checkout? A: Yes! One Page Checkout is supported in Postcode / Address Validation from version 1.4.0 and onwards.
Q: Why isn’t the postcode lookup at the top of checkout? Why does it look strange on my checkout page? A: WooCommerce core places the country field first in the checkout since the selected country affects the remaining fields. Similarly, the Address Validation postcode lookup is tied to the selected country because the postcode lookup providers bundled in the extension only support a single country (but shops often sell to multiple countries). As we want the postcode lookup fields to only appear when the supported country is selected by the customer, we make sure the lookup fields are tied with the country field and are typically displayed first. If you’ve moved the country field away from the top of the page (for example, by using the Checkout Field Editor), then the Address Validation fields will go with it :). The extension assumes the billing and shipping country fields have not been moved and appends the postcode lookup fields below the country field. Placing the postcode lookup fields anywhere else breaks the user experience and defies the purpose of the plugin: to allow customers a quick way to lookup their address via a postcode rather than filling out all fields. We highly recommend that you keep the country field first on your checkout template. If this is impossible, you could use the snippet below (or something similar), but please note that customization requests / custom code are not included in our support policy:
<?php
function wc_address_validation_move_postcode_lookup() {
wc_enqueue_js( '
( function() {
var $billingLookup = $( "#wc_address_validation_postcode_lookup_billing" );
var $shippingLookup = $( "#wc_address_validation_postcode_lookup_shipping" );
$( "div.woocommerce-billing-fields").find( "h3" ).after( $billingLookup );
$( "div.woocommerce-shipping-fields").find( "h3" ).after( $shippingLookup );
} )();
' );
}
add_action( 'wp', 'wc_address_validation_move_postcode_lookup', 1000 );

Q: Why is SmartyStreets no longer available as a provider? A: SmartyStreets retired the API that was integrated with our plugin on October 4, 2022. They previously suspended new account connections through this API, and with the retirement all existing account connections ceased functioning as well. As a result, we removed SmartyStreets as a provider option. We recommend setting up a Loqate account and using their service as a provider to continue validating US addresses with our extension.

Questions & Support

↑ Back to top
Have a question before you buy? Please fill out this pre-sales form. Already purchased and need some assistance? Get in touch with support via the help desk.
Use of your personal data
We and our partners process your personal data (such as browsing data, IP Addresses, cookie information, and other unique identifiers) based on your consent and/or our legitimate interest to optimize our website, marketing activities, and your user experience.