CompanyData for WooCommerce - Company Lookup & Address Autofill
WordPress plugin: company name or registration number in, billing address out. Company lookup and address autofill on the WooCommerce checkout, powered by the CompanyData API.
by CompanyData · github.com/companydatacom/companydata-for-woocommerce · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/companydatacom/companydata-for-woocommerce/archive/refs/heads/main.zipCustomers type their company name or registration number at the WooCommerce checkout and the billing address fills itself from the CompanyData register of 400M+ companies. The registration number and CompanyData ID are saved on the order.
- API docs: https://companydata.com/api-docs/
- User docs, FAQ and the list of external services:
readme.txt(wordpress.org format)
How it works
- The checkout script watches the Company field (and the optional
registration-number field). After three characters and a short pause it
calls the plugin's own REST route,
/wp-json/companydata/v1/lookup. - The route checks the nonce, the per-IP and daily limits, then calls
GET /api/company/searchon app.companydata.com with the server-side key, filtered to the country the customer selected. Results are cached. - Picking a suggestion fills company, street, postcode, city, state and, when the match is registered elsewhere, the country. Two hidden inputs carry the CompanyData ID and registration number into the order.
Only the search endpoint is used. The address comes with the search result, so a checkout costs one search and no export credit.
Layout
companydata-for-woocommerce.php bootstrap, WooCommerce feature compatibility
uninstall.php removes options; order/customer meta only if opted in
includes/
class-plugin.php wiring, WooCommerce-missing notice
class-settings.php options + encrypted API key
class-api-client.php server-side HTTP to app.companydata.com, caching, counters
class-rest.php /wp-json/companydata/v1/lookup
class-checkout.php checkout fields, hidden inputs, order + customer meta, admin display
class-admin.php settings and usage screens under WooCommerce
class-privacy.php WP privacy exporter + eraser
helpers.php country mapping, throttles, credit line
assets/js/checkout.js the autocomplete (jQuery, because WooCommerce's checkout events are jQuery)
assets/css/ checkout.css, admin.css
No build step.
Local development
Any WordPress with WooCommerce and the classic checkout shortcode on the
checkout page. Symlink or copy this folder into wp-content/plugins/, activate,
paste a key under WooCommerce > CompanyData.
wp option update woocommerce_checkout_company_field optional
Run Plugin Check before a release.
Releasing
- Bump
Versionincompanydata-for-woocommerce.phpandCDWC_VERSION, andStable tag+ changelog inreadme.txt. git archive --format=zip --prefix=companydata-for-woocommerce/ -o companydata-for-woocommerce.zip HEAD
License
GPL-2.0-or-later, see LICENSE.