Shape, check digit, accepted and refused examples and the API call for NIF / CIF in Spain. Every example on this page is run through the same validators as the free identifier validator, so a value shown as accepted is a value the validator accepts.
| Field | Value |
|---|---|
| Register | Registro Mercantil (BORME) |
| Shape | L N{7} C |
| Check digit | Enforced. Odd positions of the 7 digits are doubled (a product above 9 loses 9) and the rest are added; control = (10 - sum mod 10) mod 10, written as that digit or as its letter (J A B C D E F G H I). |
| Worked example (accepted) | A28015865 |
| Normalised form | A28015865 |
| Also accepted as input | A-28015865 |
| A one-character slip | A28015866 is refused |
| Regex (normalised form) | ^[ABCDEFGHJNPQRSUVW][0-9]{7}[0-9A-J]$ |
| API call | GET /companies/search?country=ES&company_number=A28015865 · also taken by nif= |
| VAT number | ES + NIF — built from the identifier by rule; the registration is not confirmed |
The first letter is the legal form (A public limited company, B limited company). A personal DNI or NIE has a different check (a mod 23 letter) and is not a company identifier: the API refuses it.
curl "https://api.prometiam.com/functions/v1/risk-api/companies/search?country=ES&company_number=A28015865" \ -H "Authorization: Bearer YOUR_API_KEY"
Shape notation: N digit · L letter · X digit or letter · C check digit or character · {n} repeat n times.
A valid shape and check digit prove that a number is well-formed, not that a company holds it. Only a lookup in the register answers that.
Register data that the API serves for Spain carries this credit:
Based on data from the Agencia Estatal Boletín Oficial del Estado (BORME)
Start your 14-day free trial · API documentation
The free trial lasts 14 days and includes 500 credits. A card is required and nothing is charged during the trial; it then continues as Starter (EUR 9.99/month) unless you cancel.