eInvoice Viewer — Identifier Check – Manual
1 · Overview
The Identifier Check is an add-on for the WordPress plugin "eInvoice Viewer for PEPPOL & EN16931". It checks every identifier an invoice carries for length, structure and, where a published procedure exists, its check digit. It marks a wrong identifier in red directly at its field in the invoice, just as the viewer marks missing mandatory fields or wrong totals. No click is needed for this. If you like, the add-on also asks online the register that is responsible for an identifier.
The background: an invoice can pass every official rule set and still carry a VAT ID, a GLN or an IBAN with a typo, because these rule sets check the structure, not the check digits.
Who it is for: for everyone who looks at e-invoices in the viewer and wants to know whether the identifiers in them can be right.
What it does:
- It checks eighteen identifier fields of the invoice: the identifiers of seller, buyer, payee, tax representative, delivery location, bank accounts, SEPA creditor and items.
- It knows the check digits of 22 kinds of identifier, among them GLN, SIREN and SIRET, LEI, the Swedish, Finnish, Danish and Norwegian company numbers, the Swiss UID, IBAN, SEPA creditor identifier and the creditor reference according to ISO 11649.
- It checks length and structure of 16 further schemes and of the BIC.
- It checks VAT IDs of EU countries by country prefix, length and structure, and a British VAT ID by its check digits.
- It marks every wrong identifier directly at its field and says below the invoice header how many there are.
- It optionally confirms VAT IDs with the European Commission's VIES, company numbers with the commercial registers of eleven countries, the LEI with GLEIF and every other identifier with a scheme code in the Peppol Directory. It asks the registers itself; the service of invoicePress.de is an alternative.
- It can be restricted to logged-in users.
What it does not do:
- It does not read the invoice itself. It works with what the viewer has already read.
- It does not compute a check digit for an EU VAT ID. The reliable answer here comes from the online check.
- It does not check German tax numbers. Every German state has its own procedure, and the usual short form on an invoice does not say which state issued it.
- It does not check whether the invoice follows the rules of its specification. That is the task of a validator.
Requirements:
| Requirement | Detail |
|---|---|
| WordPress | a running WordPress installation |
| PHP | 8.2 or newer |
| eInvoice Viewer for PEPPOL & EN16931 | from version 2.34.0, installed and active; without it the add-on does nothing |
| For the online check | a connection from your server to the internet; for five registers access data you apply for there yourself ( see chapter 5 ). For the way through invoicePress.de an API key for the E-Invoice API service instead |
screenshots/ic-markierungen.en.pngA sample invoice in the viewer; at the top the yellow note "The Identifier Check marked 4 identifiers.", further down the VAT IDs of buyer and seller marked in red with the bold heading "Identifier Check" and the sentence saying what is wrong2 · Installation
The Identifier Check is a paid product. You receive it as a ZIP file from the shop on invoicePress.de. It is not in the wordpress.org plugin directory.
Option A: upload the ZIP
Option B: copy the folder
Caution: Out of the box every visitor of the page with the viewer gets the Identifier Check. If the online check is switched on, every click on its button sends requests to the registers, and on the way through invoicePress.de it uses up part of your API key's daily quota. Tick the box Logged-in users only if visitors who are not logged in should get neither the marks nor the button. After installation the box is not ticked.
Note: The plugin names the viewer as a required plugin in its header. Without the viewer there are neither the marks nor the section in the settings.
Option C: in the viewer app
For the viewer app the add-on is a ZIP file of its own in the shop. There it checks length, structure and check digit of every identifier entirely in the browser, without WordPress and without a server.
The app checks on this computer only. The online check in the public register exists only in the plugin, because it runs over the invoicePress REST API, which answers no page opened from the disk.
Updating
You get the new version as a ZIP from the shop and upload it the same way as at the first installation; the plugin offers no update in the admin area. The settings are stored in the WordPress database and not in the plugin folder; replacing the folder does not touch them.
Removing
You deactivate the plugin under Plugins and delete it there. The marks, the online-check button and the section in the settings disappear; the viewer keeps working unchanged. The plugin stores its settings in the database (see chapters 5 and 10) and, once the online check has asked the registers, a table …spic_lookup_cache with their answers. On deletion settings and table stay, including the API key and the access data, because the plugin brings no clean-up routine. Empty the fields of the key and the access data before deleting.
3 · First steps
The Identifier Check needs no settings. After activation you reach a first result like this:
screenshots/ic-feld.en.pngA field of a sample invoice marked in red: the VAT ID "ATU123456789", below it "Identifier Check This VAT identifier does not have the length or structure of AT."If nothing stands below the header and no field is marked by the Identifier Check, every identifier for which a rule exists has passed the check.
4 · Working with Identifier Check
When the check runs
Every time the viewer shows an invoice, without a click. The check runs in the visitor's browser; the viewer sends nothing to the server for it.
Reading the marks
A wrong identifier has a red border. Below its value it says "Identifier Check" in bold, and a sentence:
| Sentence | Meaning |
|---|---|
| This value does not have the length or structure of scheme … | The identifier does not fit the form its scheme code requires, such as a GLN with 19 instead of 13 digits. |
| The check digit of this value does not match scheme … | The form is right but the check digit is not; usually a typo. |
| This VAT identifier does not have the length or structure of … | The VAT ID does not fit the form of its country, such as an Austrian one with nine instead of eight digits after "ATU". |
| The check digits of this VAT identifier do not match. | A British VAT ID with wrong check digits. |
| The length or the check digits of this IBAN do not match (ISO 13616). | The IBAN is too long, too short or has wrong check digits. |
| This is not a valid BIC (ISO 9362). | The BIC does not have 8 or 11 characters of the prescribed kind. |
| This is not a valid SEPA creditor identifier. / The check digits of this SEPA creditor identifier do not match. | The SEPA creditor ID has the wrong form or wrong check digits. |
| The check digits of this creditor reference do not match (ISO 11649). | The remittance information begins with "RF" and two digits, but the check digits do not fit. |
| The online check did not confirm this identifier. | See "The online check" below. |
Note: No mark does not always mean "checked and correct". For an identifier without a scheme code, for a German tax number and for schemes without a published rule there is nothing to check; the Identifier Check then deliberately marks nothing instead of guessing.
The tab "Identifier Check"
From version 2.38.0 of the viewer the tab Identifier Check appears next to "INVOICE" and "XML" as soon as the invoice contains an identifier. It stays closed until you click it. The tab shows every identifier of the invoice as a card, the way the Inbound Check shows its messages, the correct ones as well. The top of the card carries the BT number and "OK" in green or "Error" in red. Below follow the name of the field, for example "VAT ID", the sentence of the check and the value as it stands in the invoice. After a click on Check identifiers online every card also says "Online check: Confirmed", "Not confirmed" or "Not checked", and the tab opens by itself.
"No problem found" says the same as a missing mark: the check found nothing, also when there was nothing to check for this identifier.
screenshots/ic-reiter.en.pngThe tab "Identifier Check" of a sample invoice: one card per identifier as in the Inbound Check, the correct ones green with "OK", the wrong ones red with "Error" and the sentence saying what is wrongWhich fields are checked
Eighteen EN 16931 fields are checked. They belong to seller, buyer, payee, tax representative, delivery location, bank accounts, SEPA creditor and items:
BT-29, BT-30, BT-31, BT-34, BT-46, BT-47, BT-48, BT-49, BT-60, BT-61, BT-63, BT-71, BT-83, BT-84, BT-86, BT-90, BT-91 and BT-157.
An identifier field such as BT-29 is checked when the invoice gives it a scheme code. The viewer shows the code in the row below, such as "0088 - EAN Location Code".
What the check recognises
The check runs in the browser, without a network connection, with the same rules as the identifier fields of the other eInvoice tools.
| Identifier | What is checked |
|---|---|
| GLN and other GLN keys (0088, 0209) | length, structure and check digit |
| SIREN and SIRET (0002, 0009) | length, structure and check digit |
| Company numbers from Sweden (0007), Finland (0037), Czechia (0154), Slovakia (0158), Denmark (0184, 0198), Norway (0192) and Latvia (0218) | length, structure and check digit |
| Swiss UID (0183), Japanese Corporate Number (0188), LEI (0199), Belgian company number (0208), Partita IVA (0211), Australian Business Number (0151) | length, structure and check digit |
| 16 further schemes, among them DUNS (0060) and Leitweg-ID (0204) | length and structure |
| IBAN | length and check digits according to ISO 13616 |
| BIC | the structure |
| SEPA creditor ID | structure and check digits |
| Creditor reference in the remittance information (BT-83) | check digits according to ISO 11649, only if it begins with "RF" |
| EU VAT ID | country prefix, length and structure; no check digit |
| British VAT ID | check digits |
Note: A VAT ID from another country outside the EU, such as Norway or Switzerland, is not marked, because there is no rule for it.
The online check
The online check is optional and switched off by default. If it is switched on, the viewer shows the button Check identifiers online in its toolbar. A click on it asks for every identifier the responsible register:
| Identifier | Register |
|---|---|
| EU VAT ID, also as electronic address ( EAS 9906 to 9957 ), Belgian company number ( 0208 ), Partita IVA ( 0211 ) | the European Commission's VIES |
| British VAT ID | HMRC, with access data |
| SIREN and SIRET ( 0002, 0009 ) | INSEE, with access data |
| LEI ( 0199 ) | GLEIF |
| Company numbers from Norway ( 0192 ), Finland ( 0037 ), Czechia ( 0154 ), Slovakia ( 0158 ), Denmark ( 0184, 0198 ) and Latvia ( 0218 ) | the country's commercial register |
| Organisation number from Sweden ( 0007 ) | Bolagsverket, with access data |
| UEN from Singapore ( 0195 ) | data.gov.sg |
| Corporate Number from Japan ( 0188 ) | NTA, with access data |
| Australian Business Number ( 0151 ) | ABR, with access data |
| every other identifier with a scheme code | Peppol Directory |
Out of the box your site asks the registers itself. Under Way of the online check you can choose the invoicePress E-Invoice API service instead; it knows fewer registers. A register that requires access data does not answer without them, and its identifiers stay without an online verdict. The Peppol Directory only says whether a participant is published under an identifier; if it is missing there, the identifier is not wrong for that reason and is not marked. Below the toolbar it then says how many identifiers are confirmed and how many are not. A field whose identifier is not confirmed additionally carries the sentence "The online check did not confirm this identifier." IBAN, BIC and SEPA creditor IDs are never checked online. Without the online check switched on there is no button.
screenshots/ic-online.en.pngThe viewer's toolbar with the button "Check identifiers online"; below it the line with the result, for a sample invoice "Online check: 0 confirmed, 2 not confirmed. Not confirmed identifiers are marked at their fields."Restricting the circle of users
If the box Logged-in users only is ticked, only logged-in users get the Identifier Check. Visitors who are not logged in then see the viewer without its marks and without the online-check button.
Switching it off on one page
In the shortcode of the viewer you switch off on a single page what this add-on shows, for example [spev_einvoice_viewer tab_identifier_check="no"]. Without the attribute everything stays on.
| Switch | What the page leaves out |
|---|---|
tab_identifier_check | the tab "Identifier Check" |
button_spic_annotate | the red mark at the field; the tab stays |
button_spev_identifier_check | the button "Check identifiers online" |
A switch only takes something off this page. Who may use the add-on at all is set with "Available from role" in the settings of the viewer. The viewer app uses the same names in config.js, for example features: { tab_identifier_check: false }. Only the value false without quotes switches off.
5 · Settings
The Identifier Check has no settings page of its own. Its settings stand as a section of their own on the viewer's settings page.
eInvoice Viewer → Viewer, section eInvoice Viewer — Identifier Check
| Setting | Default | Effect |
|---|---|---|
| Logged-in users only | off | When ticked, only logged-in users get the check, and visitors see the viewer without its marks and without the button. As long as it is not ticked, every visitor of the page gets the check. |
| Online check | off | Additionally confirms the identifiers online with the registers and shows the button "Check identifiers online" in the viewer for this. |
| Way of the online check | directly with the registers | Directly with the registers: your site asks VIES, the commercial registers and the Peppol Directory itself. Through the REST service of invoicePress.de: your site asks the service with the API key below; without a key there is then no online check. An installation that worked with a key before version 1.4.0 stays with the service until you switch. |
| Access data of the registers | empty | Only for the direct way: INSEE API key, ABR GUID, NTA application ID and client ID and client secret of Bolagsverket and HMRC. You apply for them at the register concerned. The fields show the values masked. |
| einvoice-api key | empty | Your API key for the E-Invoice API service. It stays on your server and never reaches the visitors' browsers. The field shows the key masked. |
| einvoice-api base URL | empty | The service's address. Empty means https://api.invoicepress.de/v1. Leave the field empty unless you have been given another address. |
Above the fields there is a short description of the check and a status line. It is green when the viewer is active and red when it is not.
screenshots/ic-einstellungen.en.pngThe page eInvoice Viewer → Viewer with the section "eInvoice Viewer — Identifier Check": description, green status line, the boxes "Logged-in users only" and "Online check", the choice of the way, the access data of the registers, the masked key field and the base URL fieldShortcodes
The Identifier Check brings no shortcode of its own and therefore has no attributes either. It hooks into the viewer's shortcode. The marks appear wherever the viewer is embedded:
[spev_einvoice_viewer]The attributes of this shortcode are described in the viewer's manual.
6 · Special cases
You want to restrict the check to a particular group of users
Under eInvoice Viewer → Viewer, tick the box Logged-in users only. In addition, a developer returns through the filter spic_capability a capability a user must have. The example is in chapter 10.
You run the viewer publicly and want to use the online check
Bear in mind that every visitor's click on Check identifiers online then sends requests from your server to the registers; some registers limit the number of requests. On the way through invoicePress.de every click goes against your API key's daily quota. If you do not want that, tick Logged-in users only. Or leave the online check switched off; the marks at the fields need neither key nor network connection.
You want to know whether a VAT ID has really been issued
The check in the browser only says whether country prefix, length and structure are right. Switch on the Online check and click Check identifiers online in the viewer. Your site then asks the European Commission's VIES. If the number is not known there, its field is marked.
You look at an invoice from a supplier in Switzerland
The VAT ID is not marked. That is correct: there is no VAT ID rule for Switzerland, and the Identifier Check then gives no verdict. An identifier with the scheme code 0183, the Swiss UID, on the other hand is checked for its check digit.
A sample invoice is full of marks
Many public sample invoices carry placeholders instead of real identifiers, such as "BIC324098" or a GLN with 19 digits. The marks are then correct; a real invoice should carry none of them.
7 · Working with other packages
| Package | Relationship | What is added |
|---|---|---|
| eInvoice Viewer for PEPPOL & EN16931 from 2.34.0 | requirement | The viewer reads the invoice and draws the marks. The Identifier Check supplies the check. |
| invoicePress E-Invoice API service | optional, as another way | the online check through the service instead of directly with the registers |
A shared function with another viewer add-on is not described in the documents of this version.
8 · Troubleshooting
The plugin's messages exist in English, German and French. The table gives them as they appear on an English page.
| Sign | Cause | Remedy |
|---|---|---|
| No invoice ever shows an Identifier Check mark, not even one with an obviously wrong identifier. | The viewer is older than 2.34.0, or the Identifier Check is not activated, or the visitor may not get the check. | Update the viewer, activate both plugins; the status line in the settings section must be green. |
| The marks are missing only for visitors who are not logged in. | Logged-in users only is ticked. | That is the intended effect. Untick the box if visitors should get the check. |
| The marks are missing for individual logged-in users. | The filter spic_capability requires a capability the user does not have. | Give the user the capability or adjust the filter. |
| The button Check identifiers online is missing. | The online check is switched off, or the way through invoicePress.de is chosen and no key is entered. | Tick the box; for the way through invoicePress.de enter the key. |
| An identifier from France, Sweden, Japan, Australia or the United Kingdom stays without an online verdict. | The register requires access data, and they are not entered. | Apply for the access data at the register and enter them under Access data of the registers. |
| Message "Security check failed. Please reload the page." | The request's security check failed, for example because the page was open for a long time. | Reload the page and open the invoice again. |
| Message "Please log in to use the Identifier Check." | The check is restricted to logged-in users, and the visitor is not logged in. | Log in. |
| Message "You are not allowed to do this." | The logged-in user does not have the required capability. | Grant the capability or adjust the filter spic_capability. |
| Message "None of the identifiers on this invoice can be checked online." | The invoice has no identifier for which a register exists, or no register answered. | If the invoice carries a VAT ID, check again later. On the way through invoicePress.de check key and base URL. |
| The line below the toolbar counts fewer identifiers than the invoice carries. | There is no online check for IBAN, BIC and SEPA creditor ID, and a failed request counts neither as confirmed nor as not confirmed. | Check again later; on the way through invoicePress.de check key and base URL. |
9 · Privacy and security
What stays in the browser: The invoice and its identifiers. The viewer reads the invoice in the browser, and the Identifier Check runs there; nothing goes to your server for this.
What goes to your own server: Only on a click on Check identifiers online does the list of identifiers from the invoice go from the visitor's browser to your own WordPress server. Each identifier comes with its field number, the value, the type and code of its scheme and, where applicable, the invoice line.
What leaves your server: Only on this click and only with the online check switched on. On the direct way every identifier goes on its own to the register responsible for it ( table in chapter 4 ), such as the European Commission's VIES, GLEIF or a country's commercial register, for five registers together with the access data you entered for them. On the way through invoicePress.de every VAT ID and every identifier with a scheme code goes, together with your API key, to the E-Invoice API service (api.invoicepress.de). The rest of the invoice is never sent. IBAN, BIC and SEPA creditor IDs are never checked online.
What is stored: On the direct way the plugin caches every answer of a register in the table …spic_lookup_cache of your database: the identifier, the verdict and the details the register sends along, such as the name and address of the company. It is kept for one day, an answer from INSEE for 35 days; so a second click does not ask again. Answers of the Peppol Directory are not stored. Besides that the database holds the settings, including API key and access data. On deleting the plugin everything stays, because it brings no clean-up routine; so empty the fields of the key and the access data before deleting.
Security:
- The API key and the access data of the registers stay on your server and never reach the browser.
- Every online-check request carries a WordPress security token, which the server verifies.
- If Logged-in users only is ticked, the server rejects requests from visitors who are not logged in, even if someone sends them by hand, bypassing the button.
Caution: With the online check switched on and open access, any visitor can send requests to the registers and, on the way through invoicePress.de, use up your daily quota. A script could also do this deliberately. In this case restrict access to logged-in users.
10 · For developers
| Kind | Name | Meaning |
|---|---|---|
| Filter | spic_capability | Returns the capability a logged-in user needs. The default is the empty string: any logged-in user. The filter is only asked while "Logged-in users only" is ticked. It can only narrow the circle; it never admits visitors who are not logged in. |
| Viewer action | spev_register_settings | Here the Identifier Check registers its section and its settings on the viewer's settings page. |
| AJAX action | spic_nonce | Returns a fresh security token, so the online check also works on a cached page. |
| AJAX action | spic_check | The online check. Expects by POST nonce, lang and identifiers (JSON list with entries of bt, value, schemeType, schemeCode, line). Answers with identifiers; every entry additionally carries local and, with the online check switched on, online. Entries without value or schemeType are skipped. |
| Status codes | 400, 401, 403 | 400: no or unreadable list. 401: not logged in. 403: capability missing or security check failed. |
| Event | spic-online-results | The viewer fires it after an online check on the element einvoice-viewer; detail.identifiers is the answer of spic_check. The add-on's module then marks identifiers that are not confirmed. |
| Option | spic_logged_in_only | Box "Logged-in users only"; default off |
| Option | spic_online_enabled | Box "Online check"; default off |
| Option | spic_online_source | Way of the online check: direct or invoicepress; empty means invoicepress if an API key is entered, otherwise direct |
| Options | spic_insee_key, spic_abr_guid, spic_nta_app_id, spic_bolagsverket_id, spic_bolagsverket_secret, spic_hmrc_id, spic_hmrc_secret | Access data of the registers; default empty |
| Option | spic_api_key | API key; default empty |
| Option | spic_api_base_url | Base URL; default empty |
| Constants | SPIC_VERSION, SPIC_FILE, SPIC_DIR, SPIC_URL | Version, main file, directory and URL of the plugin |
| Class | SPIC_Plugin | Only loaded on init and only for users who may check. SPIC_Plugin::online_active() tells the viewer whether it shows the online-check button, SPIC_Plugin::online_source() names the way. |
| Table | {prefix}spic_lookup_cache | Cache of the registers' answers; created by the first request on the direct way |
| Script | spic-annotate | Module for the marks at the fields; depends on spev-uploader. Its settings are in window.SPIC_ANNOTATE (lang, labels, tables). It loads the rules from assets/data/identifier-rules.json. |
| Text domain | einvoice-viewer-identifier-check | Translations in the folder /languages |
Example: only users who may edit posts should be able to check.
add_filter( 'spic_capability', function () {
return 'edit_posts';
} );Caution: The filter must be registered before init with priority 1, that is in a plugin or in the theme's functions.php, not inside an init function of your own.
Licence: GPL-2.0-or-later. The bundled IBAN library php-iban is under the LGPL-3.0.
11 · Versions
| Version | Changes |
|---|---|
| 1.5.0 | The tab "Identifier Check" in the viewer shows every identifier of the invoice as a card with field, value and result, like the messages of the Inbound Check; after the online check every card carries its result as well. |
| 1.4.0 | The online check asks the responsible register itself: VIES, the commercial registers of eleven countries, GLEIF and the Peppol Directory. No API key is needed for it any more. The service of invoicePress.de stays available as another way; a site that used it before the update stays with it. New fields for the access data of INSEE, ABR, NTA, Bolagsverket and HMRC. |
| 1.3.1 | A Czech IČO whose check digit is 0 or 1 under the official rule is no longer marked as wrong. A Slovak IČO is now checked by its check digit. |
| 1.3.0 | Every identifier is checked as soon as the invoice appears, and a wrong one is marked in red directly at its field; the table above the viewer is gone. The check knows the check digits of 21 kinds of identifier instead of five. The button is called "Check identifiers online" and only appears with the online check switched on. This needs the eInvoice Viewer from 2.34.0. The plugin's settings and messages now also exist in French. |
| 1.2.2 | The bundled translations now also appear when network-activated and on older WordPress versions. |
| 1.2.1 | A VAT ID from a country outside the EU, such as Great Britain, Norway or Switzerland, is no longer reported as invalid but listed without a verdict. |
| 1.2.0 | New setting "Logged-in users only". It is off by default. |
| 1.1.1 | The section in the settings names the right shortcode, lists exactly the identifiers checked and no longer reports the viewer as inactive. |
| 1.1.0 | The check no longer uploads the invoice a second time; it uses the identifiers the viewer has already found. |
| 1.0.0 | First version: the button "Identifier Check" with the format check of every identifier field and the optional online check. |
12 · List of images
This list shows which screenshots this manual expects and which were found in the folder screenshots/ of the package. An image is always named key.language.png, for example ic-markierungen.en.png. The images show sample data only.
| Status | File | What it shows |
|---|---|---|
| – | ic-markierungen.en.png | A sample invoice in the viewer; at the top the yellow note "The Identifier Check marked 4 identifiers.", further down the VAT IDs of buyer and seller marked in red with the bold heading "Identifier Check" and the sentence saying what is wrong |
| – | ic-feld.en.png | A field of a sample invoice marked in red: the VAT ID "ATU123456789", below it "Identifier Check This VAT identifier does not have the length or structure of AT." |
| – | ic-reiter.en.png | The tab "Identifier Check" of a sample invoice: one card per identifier as in the Inbound Check, the correct ones green with "OK", the wrong ones red with "Error" and the sentence saying what is wrong |
| – | ic-online.en.png | The viewer's toolbar with the button "Check identifiers online"; below it the line with the result, for a sample invoice "Online check: 0 confirmed, 2 not confirmed. Not confirmed identifiers are marked at their fields." |
| – | ic-einstellungen.en.png | The page eInvoice Viewer → Viewer with the section "eInvoice Viewer — Identifier Check": description, green status line, the boxes "Logged-in users only" and "Online check", the choice of the way, the access data of the registers, the masked key field and the base URL field |