Title: WC &#8211; APG NIF/CIF/NIE Field
Author: Art Project Group
Published: <strong>August 12, 2016</strong>
Last modified: December 4, 2026

---

Search plugins

![](https://ps.w.org/wc-apg-nifcifnie-field/assets/banner-772x250.jpg?rev=2865750)

![](https://ps.w.org/wc-apg-nifcifnie-field/assets/icon-256x256.png?rev=2865750)

# WC – APG NIF/CIF/NIE Field

 By [Art Project Group](https://profiles.wordpress.org/artprojectgroup/)

[Download](https://downloads.wordpress.org/plugin/wc-apg-nifcifnie-field.5.0.1.zip)

 * [Details](https://wordpress.org/plugins/wc-apg-nifcifnie-field/#description)
 * [Reviews](https://wordpress.org/plugins/wc-apg-nifcifnie-field/#reviews)
 *  [Installation](https://wordpress.org/plugins/wc-apg-nifcifnie-field/#installation)
 * [Development](https://wordpress.org/plugins/wc-apg-nifcifnie-field/#developers)

 [Support](https://wordpress.org/support/plugin/wc-apg-nifcifnie-field/)

## Description

**WC – APG NIF/CIF/NIE Field** adds to your WooCommerce store a new NIF/CIF/NIE 
field in all billing and shipping forms, available to both the administrator and
the customer.

**Requirements:** the plugin needs WooCommerce 2.4.0 or higher and the [SoapClient](http://php.net/manual/en/class.soapclient.php)
PHP class for VIES/EORI validation.

#### Features

 * Fully compatible with the Checkout block of the WordPress block editor.
 * You can require the NIF/CIF/NIE field in the billing form.
 * You can require the NIF/CIF/NIE field in the billing form only from a given order
   amount.
 * You can require the NIF/CIF/NIE field in the shipping form.
 * You can hide the NIF/CIF/NIE field from the shipping form.
 * You can customize the priority (position) of the field.
 * You can validate the NIF/CIF/NIE field.
 * You can validate the VIES VAT number field to apply a tax exemption.
 * You can choose whether the VAT exemption follows the billing country or the address
   WooCommerce uses to calculate taxes.
 * Tax data check: a tab in the plugin settings that reviews your orders and tells
   you what each one lacks to issue a full invoice (tax number, name or company 
   name, address, VAT breakdown and gaps in the invoice numbering), without issuing
   or changing anything.
 * You can validate the EORI field to prevent the sale if a valid number is not 
   entered.
 * You can select the country(ies) where the EORI field will be validated.
 * You can customize the label and placeholder of the NIF/CIF/NIE, VIES VAT number
   or EORI field.
 * You can customize the error message of the field NIF/CIF/NIE, VIES VAT number
   or EORI.
 * You can customize the error message if the maximum number of requests to the 
   VIES VAT number verification API is exceeded.
 * Add and require phone and email fields in the shipping form.
 * You can remove the phone and email fields from the default address.
 * You can display and customize an error message for the billing form using the`
   apg_nif_display_error_message` and `apg_nif_error_message` filters.
 * You can remove the Email and Phone fields from the submission form with the `
   apg_nif_add_fields` filter.
 * You can skip validation by country or external condition with the `apg_nif_skip_validation`
   filter.
 * You can override the required status for billing or shipping with the `apg_nif_skip_required`
   filter.
 * You can change the order amount compared against the configured threshold with
   the `apg_nif_importe_del_pedido` filter.
 * You can limit how many VIES/EORI lookups a single IP can trigger per minute with
   the `apg_nif_maximo_consultas_por_minuto` filter (off by default).
 * You can add other invoicing plugins to the tax data check with the `apg_nif_claves_numero_factura`
   filter, and change how many orders it reviews at once with `apg_nif_comprobador_maximo`.
 * You can check that the number exists in the official business register of Norway,
   Switzerland, Thailand, Singapore, Israel, Colombia, France, Czechia and Finland,
   and add other registers with the `apg_nif_registros` filter.
 * When VIES does not answer, you can choose to charge VAT or to apply the exemption
   and check the number again every hour, with a note in the order and an email 
   if it turns out not to be valid.
 * You can answer instead of VIES (another lookup service, or tests) with the `apg_nif_vies_pre_consulta`
   filter, change the review period with `apg_nif_vies_plazo_revision` and who gets
   the warning email with `apg_nif_vies_destinatario_aviso`.
 * Adds a customer download button in WooCommerce (Customers) that includes the 
   NIF/CIF/NIE field in the CSV.
 * Each identifier is checked with the official algorithm of its country, not just
   its shape.
 * It validates documents from:
    - Albania.
    - Andorra.
    - Austria.
    - Argentina.
    - Åland Islands.
    - Brazil.
    - Belgium.
    - Bulgaria.
    - Belarus.
    - Switzerland.
    - Chile.
    - Colombia.
    - Cyprus.
    - Czech Republic.
    - Germany.
    - Denmark.
    - Estonia.
    - Spain.
    - European Union.
    - Finland.
    - Faroe Islands.
    - France.
    - Great Britain.
    - Greece.
    - Croatia.
    - Hungary.
    - Ireland.
    - Iceland.
    - Italy.
    - Liechtenstein.
    - Lithuania.
    - Luxembourg.
    - Latvia.
    - Monaco.
    - Moldova.
    - Montenegro.
    - North Macedonia.
    - Northern Ireland.
    - Malta.
    - Mexico.
    - Netherlands.
    - Peru.
    - Norway.
    - Poland.
    - Portugal.
    - Romania.
    - Serbia.
    - Sweden.
    - Slovenia.
    - Slovak Republic.
    - San Marino.
    - Ukraine.
    - Uruguay.
    - Australia.
    - Azerbaijan.
    - Canada.
    - China.
    - Ecuador.
    - Egypt.
    - Ghana.
    - Guatemala.
    - Israel.
    - India.
    - Japan.
    - Kenya.
    - South Korea.
    - Morocco.
    - New Zealand.
    - Pakistan.
    - Paraguay.
    - Russia.
    - Singapore.
    - El Salvador.
    - Thailand.
    - Tunisia.
    - Turkey.
    - Taiwan.
    - Venezuela.
    - Vietnam.
    - South Africa.
 * 100% compatible with [WooCommerce PDF Invoices & Packing Slips](https://es.wordpress.org/plugins/woocommerce-pdf-invoices-packing-slips/).
 * 100% compatible with [WPML](https://wpml.org/?aid=80296&affiliate_key=m66Ss5ps0xoS).
 * 100% compatible with [Checkout Field Editor (Checkout Manager) for WooCommerce](https://wordpress.org/plugins/woo-checkout-field-editor-pro/)
 * Contextual help on the settings page, explaining every setting without leaving
   the screen.

#### Translations

 * English: by [**Art Project Group**](https://artprojectgroup.com/) (default language).
 * Spanish: by [**Art Project Group**](https://artprojectgroup.com/).

#### More information

You can learn more about **WC – APG NIF/CIF/NIE Field** on our [official website](https://artprojectgroup.com/woocommerce-plugins/wc-apg-nif-cif-nie-field),
and follow the development on [GitHub](https://github.com/artprojectgroup/wc-apg-nifcifnie-field).

You can also read the [full documentation](https://artprojectgroup.com/documentation/wc-apg-nif-cif-nie-field),
with every setting explained one by one.

Or try it right now in the [live demo](https://demos.artprojectgroup.com/wc-apg-nifcifnie-field/):
a complete WordPress that opens in your own browser, with the plugin already installed
and set up.

### Thanks

Thanks to everyone who uses the plugin, helps improve it, makes a donation or encourages
us with their comments.

If you find this plugin useful, you can support its development with a [small donation](https://artprojectgroup.com/shop/donation).

### External Services

 1.  To the WordPress.org Plugins API to fetch plugin information.
 2.   * It sends the plugin slug when requesting data.
      * More information: https://wordpress.org/about/privacy/
 3.  To the European Commission VAT number validation API (VIES) and EORI number validation
     API.
 4.   * It sends the country and VAT number — VIES validation —.
      * It sends the EORI number.
      * More information: https://commission.europa.eu/privacy-policy-websites-managed-
        european-commission_es
 5.  To the UK Government EORI number validation API.
 6.   * It sends the EORI number.
      * More information: https://www.gov.uk/help/privacy-notice
 7.  To the official business registers of Norway (Brønnøysund Register Centre), Switzerland(
     UID register of the Federal Statistical Office) and Thailand (Revenue Department),
     to check numbers from those countries: as EORI numbers, and as tax numbers when“
     Check in official registers?” is ticked.
 8.   * It sends the business or tax number, without the customer’s name or address.
      * More information: https://data.brreg.no/enhetsregisteret/api/dokumentasjon/
        en/index.html, https://www.uid.admin.ch/ and https://www.rd.go.th/42535.html
 9.  To the open data portals of Singapore (data.gov.sg), Israel (data.gov.il) and 
     Colombia (datos.gov.co), to check business numbers from those countries when “
     Check in official registers?” is ticked.
 10.  * It sends the business number, without the customer’s name or address.
      * Contains information from the ACRA entities dataset accessed from data.gov.
        sg, made available under the terms of the Singapore Open Data Licence version
        1.0: https://data.gov.sg/open-data-licence
      * Contains information from the Registrar of Companies of the Israeli Ministry
        of Justice, published at data.gov.il: https://data.gov.il/
      * Contains data from the RUES (Confecámaras) published at datos.gov.co under 
        the CC BY-SA 4.0 licence: https://www.datos.gov.co/
 11. To the official business registers of France (Recherche d’entreprises API of the
     French government, on the INSEE SIRENE register), Czechia (ARES, Ministry of Finance)
     and Finland (open data of the Finnish Patent and Registration Office), to check
     business numbers from those countries when “Check in official registers?” is ticked.
 12.  * It sends the business number, without the customer’s name or address.
      * More information: https://recherche-entreprises.api.gouv.fr/, https://ares.
        gov.cz/ and https://avoindata.prh.fi/

## Screenshots

[⌊Settings: the field, when it is required, validation, official registers, VIES
VAT number and EORI number.⌉⌊Settings: the field, when it is required, validation,
official registers, VIES VAT number and EORI number.⌉[

Settings: the field, when it is required, validation, official registers, VIES VAT
number and EORI number.

[⌊Shipping and billing forms in the Checkout block, with the NIF/CIF/NIE/VAT number
field.⌉⌊Shipping and billing forms in the Checkout block, with the NIF/CIF/NIE/VAT
number field.⌉[

Shipping and billing forms in the Checkout block, with the NIF/CIF/NIE/VAT number
field.

[⌊Billing and shipping forms in the classic checkout.⌉⌊Billing and shipping forms
in the classic checkout.⌉[

Billing and shipping forms in the classic checkout.

[⌊Tax data check: what each order lacks to issue a full invoice, and gaps and duplicates
in the invoice numbering.⌉⌊Tax data check: what each order lacks to issue a full
invoice, and gaps and duplicates in the invoice numbering.⌉[

Tax data check: what each order lacks to issue a full invoice, and gaps and duplicates
in the invoice numbering.

[⌊Contextual help in the Help tab, with a panel for every section of the settings.⌉⌊
Contextual help in the Help tab, with a panel for every section of the settings.⌉[

Contextual help in the Help tab, with a panel for every section of the settings.

## Installation

 1. Install the plugin in one of the following ways:
 2.  * Upload the `wc-apg-nifcifnie-field` folder to the `/wp-content/plugins/` directory
       via FTP.
     * Upload the full ZIP file via _Plugins -> Add New -> Upload_ in the WordPress
       administration panel.
     * Search for **WC – APG NIF/CIF/NIE Field** in _Plugins -> Add New_ and click 
       _Install Now_.
 3. Activate the plugin through the _Plugins_ menu in the WordPress administration 
    panel.
 4. Configure the plugin in _WooCommerce -> NIF/CIF/NIE field_ or through the _Settings_
    link on the plugins page.

## FAQ

### How do I configure the plugin?

The plugin settings are very simple: you only need to indicate whether you want 
the NIF/CIF/NIE field to be validated or not, and configure the optional VIES and
EORI validation if you need them.

### How do I fix duplicate NIF metadata from older orders?

If your store placed orders via the Checkout block (or the classic checkout) with
an older version of the plugin, some orders may have duplicate or legacy `billing_nif`/`
shipping_nif` metadata rows that prevent the field from updating correctly in the
admin panel.

**Option 1 – Settings page (recommended):** Go to _WooCommerce -> NIF/CIF/NIE field_.
If duplicates are detected, a “Fix duplicate NIF metadata” button appears at the
bottom of the page. Click it to run the cleanup. The button disappears automatically
once there are no more duplicates.

**Option 2 – WP-CLI (large stores):** Run the following command from the root of
your WordPress installation to avoid HTTP timeouts:

    ```
    wp eval-file wp-content/plugins/wc-apg-nifcifnie-field/includes/admin/limpieza-meta-duplicados.php
    ```

### Which plugins has it been tested with?

Tested on WordPress 7.2, WooCommerce 11.3.1 and PHP 8.5, with real purchases in 
both the Checkout block and the classic checkout (wrong NIF, valid NIF, VIES-valid
VAT number and VAT number shipped to the store’s country):

 * WooCommerce PDF Invoices & Packing Slips 6.0.1: the NIF appears on the invoice,
   and the tax data check reads its invoice numbering.
 * Checkout Field Editor for WooCommerce (ThemeHigh) 2.2.1: works since 5.0.0, which
   stops orders without the NIF when it is required.
 * FunnelKit Funnel Builder 3.19.0.2 (Store Checkout, classic form): works since
   5.0.0.
 * Redsys Gateway Light 7.1.1, in the Redsys test terminal: the order reaches the
   gateway with the NIF saved and, with VIES, without VAT.
 * WooCommerce Stripe Gateway 11.2.0, paying in test mode. Apple Pay and Google 
   Pay not tested.
 * WooCommerce PayPal Payments 4.2.2, paying in the PayPal sandbox.

### Where can I get support?

**WC – APG NIF/CIF/NIE Field** is a free plugin. **Art Project Group** does not 
provide free technical support, but offers a paid [technical support](https://artprojectgroup.com/shop/technical-support)
service for installation and configuration.

## Reviews

![](https://secure.gravatar.com/avatar/0e474fda75aa9e037626da72f02c0554d80e3b047def737bab8f869fa40fe29b?
s=60&d=retro&r=g)

### 󠀁[Desarrollador excepcional y comprometido](https://wordpress.org/support/topic/desarrollador-excepcional-y-comprometido/)󠁿

 [newcelic](https://profiles.wordpress.org/newcelic/) May 29, 2025 1 reply

Un desarrollador excepcional y comprometido No suelo dejar reseñas, pero en este
caso es más que merecida. El trabajo que hay detrás de este plugin es impresionante:
funcional, estable y siempre actualizado. Se nota el cuidado, la atención al detalle
y, sobre todo, la pasión por ofrecer una herramienta útil y bien construida. Además,
la rapidez con la que se responden dudas o se solucionan problemas es digna de admiración.
No solo es un gran desarrollador, sino también alguien que valora a su comunidad
de usuarios. Agradezco profundamente el esfuerzo constante que pone en este proyecto.¡
Mi reconocimiento y apoyo total!

![](https://secure.gravatar.com/avatar/9c8404d4d84aced2a043b204248ede184f51e01aad98fb7330e3da207d4d45df?
s=60&d=retro&r=g)

### 󠀁[Increíble plugin y servicio](https://wordpress.org/support/topic/increible-plugin-y-servicio/)󠁿

 [Daniel Pereyra Costas](https://profiles.wordpress.org/danidub/) May 27, 2025

Un plugin súper profesional y que funciona a la perfección. Gran equipo detrás 👏

![](https://secure.gravatar.com/avatar/7ce2b5e27790f0beca1c9e00350331d9f6d6512c89f728949dde74a8613480ec?
s=60&d=retro&r=g)

### 󠀁[Estupendo servicio](https://wordpress.org/support/topic/estupendo-servicio/)󠁿

 [centrowebs](https://profiles.wordpress.org/centrowebs/) December 18, 2024

Tuve un problema al instalar el plugin, les pasé el código del error y en un par
de horas ya tenía la solución y el error quedó arreglado.

![](https://secure.gravatar.com/avatar/105830867cc638532597d1bd9b51fdc9a23e7e53770537c27dea9822783fa982?
s=60&d=retro&r=g)

### 󠀁[Gran plugin, mejor servicio técnico](https://wordpress.org/support/topic/gran-plugin-mejor-servicio-tecnico/)󠁿

 [factorchem](https://profiles.wordpress.org/factorchem/) September 18, 2024

El plugin hace lo que se le pide a la perfección y funciona genial con Woocommerce.
A destacar la rapidez del servicio técnico en un problema puntual que tuvimos con
el plugin, y que resolvieron en minutos sacando una nueva actualización del plugin.
10 de 10!

![](https://secure.gravatar.com/avatar/f49535d1ff7872933e3c9c851414a6a70c2d40f034e00a4b6a06e854d091dda8?
s=60&d=retro&r=g)

### 󠀁[Work great. Fast support](https://wordpress.org/support/topic/work-great-fast-support-2/)󠁿

 [Jesús](https://profiles.wordpress.org/jesusmartinezdiaz/) September 16, 2024

Work great. Fast support

![](https://secure.gravatar.com/avatar/2cf11bea7cf05bfc03d8d96b7bfe9b6fb39bf43eff058d93983a6b44ca841b02?
s=60&d=retro&r=g)

### 󠀁[Imprescindible en todos los proyectos](https://wordpress.org/support/topic/imprescindible-en-todos-los-proyectos/)󠁿

 [alfredo49](https://profiles.wordpress.org/alfredo49/) September 22, 2023 1 reply

Además se integra perfectamente con PDF Invoices & Packing Slips y Woocommerce!

 [ Read all 23 reviews ](https://wordpress.org/support/plugin/wc-apg-nifcifnie-field/reviews/)

## Contributors & Developers

“WC – APG NIF/CIF/NIE Field” is open source software. The following people have 
contributed to this plugin.

Contributors

 *   [ Art Project Group ](https://profiles.wordpress.org/artprojectgroup/)

“WC – APG NIF/CIF/NIE Field” has been translated into 4 locales. Thank you to [the translators](https://translate.wordpress.org/projects/wp-plugins/wc-apg-nifcifnie-field/contributors)
for their contributions.

[Translate “WC – APG NIF/CIF/NIE Field” into your language.](https://translate.wordpress.org/projects/wp-plugins/wc-apg-nifcifnie-field)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/wc-apg-nifcifnie-field/),
check out the [SVN repository](https://plugins.svn.wordpress.org/wc-apg-nifcifnie-field/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/wc-apg-nifcifnie-field/)
by [RSS](https://plugins.trac.wordpress.org/log/wc-apg-nifcifnie-field/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 5.0.1

 * Fixed: Dutch and Irish VAT numbers with + or * lost those signs since 5.0.0, 
   so they were saved and checked wrong.
 * Fixed: numbers typed with Arabic, Persian or full-width digits were wiped in 
   the checkout.
 * Fixed: with EORI on, French, Czech and Finnish EORI numbers are checked again
   in the European Commission EORI service, not in the business register.
 * Fixed: a Colombian personal NIT starting with 8 or 9 no longer stops the order,
   and Singapore companies struck off the register no longer count as existing.
 * Fixed: an order waiting for VIES could drop out of the hourly review if it arrived
   while the review was running.
 * Fixed: in the tax data check, numbers with the year after them (15/2026) form
   one series, the invoice year follows the shop time zone and repeated numbers 
   show the order number.
 * Fixed: the NIF is no longer required when a checkout field editor has removed
   it from the form.
 * Improved: contextual help for the three VIES warnings of the tax data check, 
   for the official registers (they only stop the order with “Validate field?” ticked)
   and for the six settings that depend on the VIES VAT number.
 * Security: the optional limit of VAT number checks per minute now counts the real
   visitor IP, not one taken from headers the visitor can forge.
 * Compatibility: provisional VIES exemption in the block checkout with WooCommerce
   older than 7.2, and a 10-second connection limit for VIES and EORI.

#### 5.0.0

 * New: Tax data check tab in the plugin settings that lists what each order lacks
   to issue a full invoice and finds gaps and duplicates in the invoice numbering.
   It only reads: it does not issue, sign or number invoices.
 * New: “Country that decides the VAT exemption” setting, to make the VIES exemption
   follow the address WooCommerce uses to calculate taxes. Billing address stays
   as the default, so nothing changes unless you choose it.
 * New: “If VIES does not answer” setting, to place the order without VAT and check
   the number again every hour for 7 days, with order notes, an email if it is not
   valid and its own warnings in the tax data check. Charging VAT stays as the default.
 * Fixed: Spanish CIF numbers whose letter check digit is J were rejected.
 * Fixed: Bulgarian VAT numbers of foreign residents and other ten-digit numbers
   were rejected.
 * Fixed: in the classic checkout, a valid VIES number did not remove the VAT unless
   the customer ticked “Ship to a different address?”.
 * Fixed: in the Checkout block, typing the VAT number right after the address could
   empty the address fields.
 * Fixed: with Checkout Field Editor or similar plugins, the classic checkout accepted
   orders without the NIF/CIF/NIE field even when it was required.
 * Fixed: with FunnelKit and other checkouts that only ask for the shipping address,
   the number was not validated, did not apply the VAT exemption and the order was
   saved without the billing NIF.
 * Fixed: the field label and messages can now be translated with WPML or Polylang,
   also in the Checkout block, including the errors shown when placing the order.
 * New: “Check in official registers?” setting, to check besides the format that
   the number exists in the official register of Norway, Switzerland, Thailand, 
   Singapore, Israel, Colombia, France, Czechia or Finland. Only business numbers
   are looked up. Off by default.
 * New: validation of the tax numbers of 27 more countries, with their check digit
   where the algorithm is public: Australia, Azerbaijan, Canada, China, Ecuador,
   Egypt, El Salvador, Ghana, Guatemala, India, Israel, Japan, Kenya, Morocco, New
   Zealand, Pakistan, Paraguay, Russia, Singapore, South Africa, South Korea, Taiwan,
   Thailand, Tunisia, Turkey, Venezuela and Vietnam. Kinds of number without a public
   algorithm are checked for their shape, so no real number is rejected.
 * New: numbers typed with Arabic or Persian digits, or with full-width digits and
   letters, are recognised.
 * Fixed: a number whose first letters match a country code (an Indian PAN starting
   with AT, a Ghana Card starting with GHA) was checked with that country’s rules
   and rejected.
 * Changed: EORI numbers of Norway, Switzerland, Thailand and Northern Ireland are
   now checked against official sources (the country’s register or the European 
   Commission) instead of vatapp.net, which the plugin no longer uses.
 * Improved: when the VIES service of a country is busy, the number is checked again
   one second later before applying VAT, so fewer valid exemptions are lost.
 * Fixed: a connection failure or an unclear answer from VIES showed the VAT number
   as not valid; now it is treated as VIES not answering.
 * Security: fixed a stored cross-site scripting through the NIF field (CVE-2026-
   140027); the number is now cleaned when it is saved and when it is read.
 * Improved: security hardening: the checkout and My Account only read the NIF fields
   they need, after checking the request themselves.
 * Fixed: in the Checkout block, the invalid number error appeared beside the field
   and squeezed it, instead of below it.

#### 4.18.1

 * The links to the website, the documentation, the donation and the support now
   open in the language of whoever is looking at the screen.

#### 4.18.0

 * Contextual help in the Help tab of the settings page, with a panel for every 
   section and a link to the full documentation.

#### 4.17.0

 * Fixed: valid identifiers from Cyprus, Malta and Serbia were rejected, because
   their check digit algorithms were not the official ones.
 * Fixed: Dutch VAT numbers issued since 2020, which are not derived from the personal
   identification number, are accepted now.
 * Fixed: Ireland, France, Portugal, Sweden, Slovenia, Latvia and Romania rejected
   valid forms of their identifiers.
 * Fixed: Spanish NIF numbers from the K, L and M series were checked with the company
   algorithm instead of the individual one.
 * Fixed: the + and * signs, which are part of some Irish and Dutch numbers, were
   stripped when the field was cleaned up.
 * New: check digit validation for Albania, Andorra, Belarus, Moldova, Montenegro,
   North Macedonia, San Marino and Ukraine.
 * New: Northern Ireland (XI) numbers are validated, instead of always rejected,
   and the Brazilian CNPJ accepts the numbers with letters issued from 2026.

#### 4.16.1

 * Fixed: the plugin redefined the Phone field and always left it as optional, ignoring
   the setting in Customize > WooCommerce > Checkout, and brought the field back
   even when it was set to hidden. WooCommerce already provides it, so the plugin
   no longer touches it.

#### 4.16.0

 * Security: the VAT exemption was kept in the customer session and was never rechecked
   when the order was placed, so an order could be completed without VAT using a
   number that did not match the order address. It is now recalculated from the 
   final order data in both checkouts.
 * Fixed: the United Kingdom check digit algorithm rejected valid VAT numbers (Tesco’s
   GB220430231 or the BBC’s GB333289454). It now follows the HMRC specification.
 * Fixed: a VIES or EORI outage could leave a valid number remembered as invalid.
   Only conclusive answers are cached now, for 30 days if valid and 24 hours if 
   not.
 * Fixed: on the first load of the Checkout block the shipping form was not validated,
   so a NIF/CIF/NIE coming from the customer’s saved address did not apply the exemption
   until the field was touched.
 * New check digit validation for Iceland, Brazil (CNPJ and CPF), Peru, Colombia
   and Uruguay. Monaco now uses the French algorithm and the Åland Islands the Finnish
   one.
 * Brazil, Mexico, Colombia, Peru and Uruguay added to the validated countries: 
   their identifiers used to be accepted without any checking. Mexico’s RFC is checked
   for structure and for a real date.
 * The EORI number is checked for shape before querying HMRC or the European Commission.
 * Security: data migrations no longer run for users without the `manage_woocommerce`
   capability, the customer CSV export neutralizes formula injection, the checkout
   scripts escape everything they print, and every `$_POST` read verifies its own
   nonce.
 * New `apg_nif_maximo_consultas_por_minuto` filter to cap external VIES/EORI lookups
   per IP address. Off by default.
 * Fixed: a field sharing its label with the NIF/CIF/NIE one disappeared from the
   order admin, the missing SoapClient notice showed the link markup as plain text,
   and a fatal error was possible on the VIES endpoint without a WooCommerce session.
 * Tested with WooCommerce 11.1.0. The translation template has been regenerated:
   nine strings that were in the plugin but missing from it are now translatable.

#### 4.15.0

 * New setting “Require billing field from this amount”: the NIF/CIF/NIE field becomes
   required in the billing form when the order total (taxes included) is equal to
   or greater than the amount entered, even if the “Require billing field?” option
   is not checked. Leave it empty to disable it. It never affects the shipping form,
   which keeps behaving as configured. The `apg_nif_importe_del_pedido` filter lets
   you compare a different amount (for example, the subtotal without taxes or without
   shipping costs).
 * Fixed: in the Checkout block, the billing field was not enforced as required 
   when “Show shipping field?” was unchecked and both required options were checked.
   The field was not registered as natively required and the plugin’s own check 
   was skipped, so the order could be placed with an empty NIF/CIF/NIE.
 * Fixed: in the Checkout block, the per-form required check only ran when some 
   validation (NIF/CIF/NIE, VIES or EORI) was enabled. Requiring the field in a 
   single form without any validation active had no effect.
 * Security: the AJAX endpoint that applies the VAT exemption in the Checkout block(`
   apg_nif_quita_iva_bloques`) trusted the value sent by the browser and did not
   check any nonce, so any visitor could remove the VAT from their own order without
   a valid VAT number. It now verifies the nonce and recalculates the exemption 
   on the server with the submitted VAT number and country.
 * The field label is now kept in sync with the order amount in both checkouts: 
   the “(optional)” text disappears as soon as the order reaches the configured 
   amount, and comes back if it drops below it (for example, after applying a coupon).
   The state is always calculated on the server, so the label and the validation
   can never disagree.
 * In the Checkout block, with “Use same address for billing” ticked only the shipping
   form is shown, and that address is also the billing one: its NIF/CIF/NIE field
   now follows the billing rules, as it should.
 * Fixed: when the field was required and left empty with validation enabled, two
   error messages were shown (the required one and the invalid format one). The 
   format is no longer validated on an empty field.
 * Fixed: uninstalling the plugin left behind the `apg_nif_meta_pedido_migrado` 
   option and the VIES/EORI cache transients.
 * The `json_split_objects()` helper function has been renamed to `apg_nif_json_split_objects()`.
   It was declared in the global namespace without a prefix, which could cause a
   fatal error if another plugin declared the same name.
 * Internal cleanup: removed unreachable code, unused globals and an unnecessary
   address-fields lookup in the shipping form.

#### 4.14.1

 * Fixed: the metadata cleanup and the one-time automatic migration did not actually
   process the HPOS order table (`wc_orders_meta`); they relied on the `$wpdb->wc_orders_meta`
   property, which WooCommerce does not set, so on HPOS stores the 4.14.0 migration
   touched only `postmeta` and left the orders untouched. The HPOS table is now 
   detected from the database prefix, and the automatic one-time cleanup runs again
   on update to 4.14.1 to migrate those orders to `_billing_nif` / `_shipping_nif`.

#### 4.14.0

 * The order meta key for the NIF/CIF/NIE is now `_billing_nif` / `_shipping_nif`(
   with a leading underscore), matching WooCommerce’s native order meta convention(`
   _billing_*`) so the value is read by ERP integrations such as Holded and others
   that expect the underscored key. Reading still falls back to the legacy `billing_nif`/`
   shipping_nif` for orders placed with previous versions.
 * The duplicate-metadata cleanup tool now migrates the legacy `billing_nif` / `
   shipping_nif` keys to the canonical `_billing_nif` / `_shipping_nif` (in both`
   postmeta` and HPOS `wc_orders_meta`). Run it from the plugin settings or via 
   WP-CLI on large stores.
 * This cleanup also runs automatically once, in the admin, right after updating
   to this version, so the migration happens without clicking the button (the settings
   button and the WP-CLI script remain available as an alternative for very large
   stores).
 * Customer (user) meta is unchanged: it stays `billing_nif` / `shipping_nif`, as
   WooCommerce stores customer billing fields without the underscore.

#### 4.13.0

 * Fixed the NIF/CIF/NIE field not being auto-filled when selecting a customer while
   creating or editing an order in the admin panel. The field is now rendered with
   the id that WooCommerce’s customer-details script expects (`_billing_nif` / `
   _shipping_nif`), while the value is still stored under the canonical `billing_nif`/`
   shipping_nif` keys.
 * Unified the NIF metadata key across every save path. The classic checkout no 
   longer leaves a legacy `_billing_nif` / `_shipping_nif` copy, and editing an 
   order from the admin panel no longer creates a second metadata entry.
 * Rewrote the duplicate NIF metadata detection and cleanup tool. Detection now 
   also finds orders where `billing_nif` and `_billing_nif` (or `shipping_nif` and`
   _shipping_nif`) coexist, works on both `postmeta` and `wc_orders_meta` (HPOS,
   including sync mode and configurations where the cleanup button previously failed
   to appear), and caches the query for one hour to avoid performance issues on 
   large stores. The cleanup migrates lone legacy keys to the canonical key, removes
   legacy keys when the canonical one already exists, and deduplicates repeated 
   rows, so detection and cleanup always agree (fixing the case where the button
   appeared but reported “0 fixed”).
 * Reviewed and corrected the plugin’s English texts. Fixed the wording of the settings
   description and field tooltips (e.g. “validate the field before submission”, “
   allow and validate the VIES VAT number / the EORI number”) and of the information
   box (“Contact us”, “If you enjoy this plugin and find it helpful”), and renamed
   the “End Purchase block” reference to the correct WooCommerce term “Checkout 
   block”.

#### 4.12.2

 * Fixed the root cause of the NIF field not saving when editing an existing order
   from the admin panel: the field definition was missing an explicit `id`, so WooCommerce
   was writing the admin-entered value to `_billing_nif` / `_shipping_nif` instead
   of `billing_nif` / `shipping_nif`. As a result, the display always showed the
   original checkout value unchanged.
 * Fixed the duplicate NIF metadata detection function so it checks both `postmeta`
   and `wc_orders_meta` (HPOS) regardless of the active storage mode. Previously
   the cleanup button could fail to appear on stores using HPOS sync mode or certain
   HPOS configurations.

#### 4.12.1

 * Fixed a regression introduced in 4.12.0 where editing the NIF field on an existing
   order from the admin panel and saving would silently discard the new value, leaving
   the old one in the database. This happened on stores with duplicate NIF metadata
   rows created by older versions of the plugin. The automatic deduplication hook
   has been removed; use the cleanup button in the plugin settings or the WP-CLI
   script instead.

#### 4.12.0

 * Fixed duplicate `billing_nif` / `shipping_nif` metadata rows generated when placing
   orders with Checkout Blocks, which caused the NIF field to appear unchanged after
   editing an order from the admin panel.
 * Added a “Fix duplicate NIF metadata” button in the plugin settings page to clean
   up existing duplicate rows in stores affected by previous versions.

#### 4.11.4

 * Fixed a Checkout Blocks regression introduced in 4.11.3 where the NIF/CIF/NIE
   field could be treated as a native address field during Store API requests and
   incorrectly trigger a required-field error on checkout.

#### 4.11.3

 * Fixed the NIF/CIF/NIE field in My Account address editing when the account page
   is rendered with the `[woocommerce_my_account]` shortcode on stores using Checkout
   Blocks.

#### 4.11.2

 * Fixed order admin and formatted address NIF loading for orders created with Checkout
   Blocks by reading `billing_nif` and `shipping_nif` first, with fallback to legacy
   meta keys.

#### 4.11.1

 * Fixed `requerido_envio` in classic checkout so the shipping NIF/CIF/NIE field
   is only required when the customer checks “Ship to a different address”.

#### 4.11.0

 * Added the `apg_nif_skip_required` filter to override the required status for 
   billing or shipping via hook.

#### 4.10.0

 * Added support for Italian `Codice Fiscale` validation.
 * Fixed international prefix detection so non-ISO leading letters are not treated
   as country prefixes.
 * Fixed Checkout Block VIES validation initialization in `valida-bloques-nif.js`.

#### 4.9.1

 * Fixed compatibility with FunnelKit Builder custom checkout validation when showing
   the shipping field.
 * Minor fixes.

#### 4.9.0

 * Added compatibility declaration for `product_instance_caching`.
 * Improved VIES, EORI and VAT exemption handling.

#### 4.8.3

 * Added a new option to hide the shipping NIF/CIF/NIE field.
 * Improved required billing/shipping field handling in the Checkout Block.
 * Fixed compatibility with Checkout Field Editor (Checkout Manager) for WooCommerce.
 * Minor fixes.

#### 4.8.2

 * Minor fixes.

#### 4.8.1

 * Added the `apg_nif_skip_validation` filter
 * Minor fixes.

#### 4.8.0

 * Fixed JavaScript validation.

#### 4.7.0.6

 * Minor fixes.

#### 4.7.0.5

 * Minor fixes.

#### 4.7.0.4

 * Minor fixes.

#### 4.7.0.3

 * Minor fixes.

#### 4.7.0.2

 * Minor fixes.

#### 4.7.0.1

 * Minor fixes.

#### 4.7.0

 * Addition of a customer download button in WooCommerce (Customers) that includes
   the NIF/CIF/NIE field in the CSV.
 * Minor fixes.

#### 4.6.0.1

 * Minor fixes.

#### 4.6.0

 * Addition of document validation for new countries.
 * Minor fixes.

#### 4.5.0.2

 * Minor fixes.

#### 4.5.0.1

 * Minor fixes.

#### 4.5.0

 * Added PHPDoc blocks throughout the code.
 * Fixed compatibility with Checkout Field Editor (Checkout Manager) for WooCommerce.
 * Minor fixes.

#### 4.4.0.1

 * Minor fixes.

#### 4.4.0

 * Fixed tax exemption handling.
 * Minor fixes.

#### 4.3.0

 * Fixed required field handling in the addresses on the My Account page.
 * Minor fixes.

#### 4.2.0

 * Fixed JavaScript validation.
 * Minor fixes.

#### 4.1.0.1

 * Correction and unification of user metas.

#### 4.1.0

 * Added shipping country check to the tax exemption.
 * Minor fixes.

#### 4.0.0.9

 * Minor fixes.

#### 4.0.0.8

 * Minor fixes.

#### 4.0.0.7

 * Minor fixes.

#### 4.0.0.6

 * Added the NIF field to the Checkout block address.

#### 4.0.0.5

 * Minor fixes.

#### 4.0.0.4

 * Added live validation.
 * Improved security.
 * Minor fixes.

#### 4.0.0.3

 * Minor fixes.

#### 4.0.0.2

 * Minor fixes.

#### 4.0.0.1

 * Minor fixes.

#### 4.0.0

 * Full compatibility added for VIES and EORI validation in the Checkout Block.
 * General performance improvements.
 * Full code compliance with WordPress security standards.
 * Addition of document validation for new countries.
 * Minor fixes.

#### 3.2.0.1

 * Small fixes.

#### 3.2.0

 * Added `apg_nif_add_fields` filter.
 * Improved validation.

#### 3.1.0.2

 * Small fixes.

#### 3.1.0.1

 * Small fixes.

#### 3.1.0

 * Improved security.
 * Improved international validation process.
 * Small fixes.

#### 3.0.15

 * Small fixes.

#### 3.0.14

 * Small fixes.

#### 3.0.13

 * Small fixes.

#### 3.0.12

 * Small fixes.

#### 3.0.11

 * Small fixes.

#### 3.0.10

 * Limits features to the Checkout Block.

#### 3.0.9

 * Small fixes.

#### 3.0.8

 * Small fixes.

#### 3.0.7

 * Small fixes.

#### 3.0.6

 * Small fixes.

#### 3.0.5

 * Small fixes.

#### 3.0.4

 * Improved compatibility with third party plugins.

#### 3.0.3

 * Improved compatibility with third party plugins.

#### 3.0.2

 * Small fixes.

#### 3.0.1

 * Fixed a bug affecting versions below WooCommerce 8.9.

#### 3.0.0

 * Added support for the Checkout block.
 * Improved compatibility with third party plugins.

#### 2.1.0.2

 * Small fixes.

#### 2.1.0.1

 * Small fixes.

#### 2.1.0

 * Added HPOS support.

#### 2.0.1

 * Small fixes.

#### 2.0.0

 * Added EORI number validation option **Upgrade sponsored by [OldWood – Ground, Oil Varnishes & Natural Colours](https://www.oldwood1700.com)**.
 * Added option to select priority of the field NIF/CIF/NIE.
 * Added two filters to display and customize an error message for the billing form:`
   apg_nif_display_error_message` and `apg_nif_error_message`.
 * Screenshot updated.

#### 1.7.4.1

 * Header updated.
 * Stylesheet updated.
 * Screenshot updated.

#### 1.7.4

 * Validates the shipping form only if it has been activated.
 * Validates VIES number only for supported countries.

#### 1.7.3.1

 * Indicates the corresponding form in the field validation.

#### 1.7.3

 * Add the NIF/CIF/NIE field in the order search.

#### 1.7.2.6

 * Small fixes.

#### 1.7.2.5

 * Small fixes.

#### 1.7.2.4

 * Small fixes.

#### 1.7.2.3

 * Added support for Polylang.

#### 1.7.2.2

 * Small fixes.

#### 1.7.2.1

 * Small fixes.

#### 1.7.2

 * VIES validation fix for Greece and Ireland.

#### 1.7.1

 * Adjustment to make the new option compatible with WooCommerce PDF Invoices & 
   Packing Slips.

#### 1.7.0

 * Now you can now remove the phone and email fields from the default address.

#### 1.6.0

 * Customizable error messages and translatable with WPML.
 * Small fixes.

#### 1.5.1

 * Added tax exemption on shipping costs.

#### 1.5.0

 * Removed tax exemption on shipping costs.
 * Added phone and email fields in international addresses.
 * Small fixes.

#### 1.4.2

 * Remove double phone and email address in the Thank you page.

#### 1.4.1

 * Text field name translatable with WPML.

#### 1.4.0.2

 * Updated email account template.
 * Small fixes.

#### 1.4.0.1

 * Small fixes.

#### 1.4.0

 * Added customization for the field label and placeholder.
 * Updated screenshot.

#### 1.3.0.2

 * Small fixes.
 * Removed all the changes of fields order.

#### 1.3.0.1

 * Small fixes.

#### 1.3.0

 * Added fields in WooCommerce PDF Invoices & Packing Slips for invoices with addresses
   outside Spain.

#### 1.2.1.3

 * Small fixes.

#### 1.2.1.2

 * Added error message and deactivation when SoapClient PHP class doesn’t exist.

#### 1.2.1.1

 * Added WooCommerce 3.4 compatibility.

#### 1.2.1

 * Small fixes.

#### 1.2.0.4

 * Remove double phone and email address in the order email.
 * Fixed CIF number validation.

#### 1.2.0.3

 * Remove double phone and email address in the order email.

#### 1.2.0.2

 * Header updated.
 * Stylesheet updated.
 * Screenshot updated.

#### 1.2.0.1

 * Fixed CIF number validation.

#### 1.2.0

 * Prevent NIF/CIF/NIE field validation out from Spain.
 * Minor fixes.

#### 1.1.0.6

 * Display the email field in manually created orders in WooCommerce 3.x.
 * Prevent NIF/CIF/NIE validation with VIES number validation selected.

#### 1.1.0.5

 * Text field name translatable.

#### 1.1.0.4

 * Improved performance.

#### 1.1.0.3

 * Fixed localization.

#### 1.1.0.2

 * Improved VIES number validation.

#### 1.1.0.1

 * Internationalization of VIES number validation.

#### 1.1.0

 * Added VIES VAT number validation option.

#### 1.0.1.3

 * Adjust to optimize WooCommerce 3.0 compatibility.

#### 1.0.1.2

 * Support for multisite installations.

#### 1.0.1.1

 * Display all fields in non registered users.

#### 1.0.1

 * Fixed email addresses format.
 * Fixed missed Spanish translations.

#### 1.0.0

 * Display the email field in manually created orders.
 * Display the email in customer data.
 * Removed all custom classes from fields to improve universal compatibility with
   templates.
 * Internal plugin structure fully rewritten for easy maintenance.

#### 0.3.0

 * Load the NIF/CIF/NIE field value in manually created orders.

#### 0.2.0

 * Added new setting options.
 * Updated translation.
 * Updated screenshot.

#### 0.1.0

 * Initial version.

## Meta

 *  Version **5.0.1**
 *  Last updated **18 hours ago**
 *  Active installations **10,000+**
 *  WordPress version ** 5.0 or higher **
 *  Tested up to **7.2**
 *  PHP version ** 7.4 or higher **
 *  Languages
 * [English (US)](https://wordpress.org/plugins/wc-apg-nifcifnie-field/), [Spanish (Chile)](https://cl.wordpress.org/plugins/wc-apg-nifcifnie-field/),
   [Spanish (Colombia)](https://es-co.wordpress.org/plugins/wc-apg-nifcifnie-field/),
   [Spanish (Spain)](https://es.wordpress.org/plugins/wc-apg-nifcifnie-field/), 
   and [Spanish (Venezuela)](https://ve.wordpress.org/plugins/wc-apg-nifcifnie-field/).
 *  [Translate into your language](https://translate.wordpress.org/projects/wp-plugins/wc-apg-nifcifnie-field)
 * Tags
 * [cif](https://wordpress.org/plugins/tags/cif/)[nie](https://wordpress.org/plugins/tags/nie/)
   [nif](https://wordpress.org/plugins/tags/nif/)[vies](https://wordpress.org/plugins/tags/vies/)
 *  [Advanced View](https://wordpress.org/plugins/wc-apg-nifcifnie-field/advanced/)

## Ratings

 4.8 out of 5 stars.

 *  [  22 5-star reviews     ](https://wordpress.org/support/plugin/wc-apg-nifcifnie-field/reviews/?filter=5)
 *  [  0 4-star reviews     ](https://wordpress.org/support/plugin/wc-apg-nifcifnie-field/reviews/?filter=4)
 *  [  0 3-star reviews     ](https://wordpress.org/support/plugin/wc-apg-nifcifnie-field/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/wc-apg-nifcifnie-field/reviews/?filter=2)
 *  [  1 1-star review     ](https://wordpress.org/support/plugin/wc-apg-nifcifnie-field/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/wc-apg-nifcifnie-field/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/wc-apg-nifcifnie-field/reviews/)

## Contributors

 *   [ Art Project Group ](https://profiles.wordpress.org/artprojectgroup/)

## Support

Issues resolved in last two months:

     1 out of 1

 [View support forum](https://wordpress.org/support/plugin/wc-apg-nifcifnie-field/)

## Donate

Would you like to support the advancement of this plugin?

 [ Donate to this plugin ](https://artprojectgroup.com/shop/donation)