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:

  1. Add NIP + REGON + PESEL fields to customer entity (or B2B company on Adobe Commerce).
  2. Validate NIP via GUS API + Biała lista, rejects invalid / blacklisted companies, auto-fills name + address.
  3. Validate REGON via GUS BIR, cross-checks against the NIP.
  4. Validate PESEL via checksum + birthdate sanity check.
  5. Apply 0% VAT on B2B intra-EU sales with a VIES-validated NIP-EU; 23% on PL→PL and B2C.
  6. Cache validations 7-30 days; re-validate on any company-data change.
Kishan Savaliya
Kishan Savaliya
Adobe Certified Magento Commerce Developer
Ahmedabad [IN]working hours, replies within four hours
When do you need it

Read personally. Never shared. Or email the brief.

More on magento developer poland

Need it fixed, not just explained?

Send the brief with your store URL; the written quote comes back within 24 hours.