How do I validate NIP + REGON + PESEL at Magento checkout?
Three Polish identifiers, three validators:
- NIP (Numer Identyfikacji Podatkowej), 10-digit Polish tax-ID / VAT number. Format:
NNN-NNN-NN-NN(or no dashes). Has a checksum digit. Validated against the GUS (Główny Urząd Statystyczny) API and the VAT whitelist (Biała lista) from Ministerstwo Finansów. - REGON, 9-digit (or 14-digit for branches) Polish company registry number. Validated against GUS BIR API. Auto-fills company name + address.
- PESEL, 11-digit national-ID, mainly for sole-traders (JDG, Jednoosobowa Działalność Gospodarcza). Format encodes date of birth + gender + checksum.
For Magento B2B we:
- Add NIP + REGON + PESEL fields to
customerentity (or B2Bcompanyon Adobe Commerce). - Validate NIP via GUS API + Biała lista, rejects invalid / blacklisted companies, auto-fills name + address.
- Validate REGON via GUS BIR, cross-checks against the NIP.
- Validate PESEL via checksum + birthdate sanity check.
- Apply 0% VAT on B2B intra-EU sales with a VIES-validated NIP-EU; 23% on PL→PL and B2C.
- Cache validations 7-30 days; re-validate on any company-data change.