How do I validate CVR (Erhvervsstyrelsen) at checkout for Danish B2B?
CVR (Centrale Virksomhedsregister) is the Danish national company register, managed by Erhvervsstyrelsen (Danish Business Authority). Every Danish company / ApS / A/S / I/S / sole-trader has an 8-digit CVR number. For B2B Magento we validate it at three points:
- At registration / company create, call Erhvervsstyrelsen’s free
cvrapi.dkor official CVR REST endpoint with the entered CVR, auto-fill company name + address + industry code + status. Reject closed (“Ophørt”) companies. - At checkout for invoice / Net-30, re-validate CVR is still active before extending credit.
- For VAT (Moms) handling on cross-border B2B, combine CVR with VIES validation (the EU-wide VAT-number checker). A Danish CVR has the format
DK + 8-digit CVRfor VIES purposes. Valid VIES → 0% Moms reverse-charge on intra-EU B2B.
Magento implementation: add cvr + vat_id fields to the customer entity (or B2B company on Adobe Commerce), wire validation via observer + a cached lookup (CVR data is stable, 30-day cache is fine). Show the company name back inline so the user sees the validation worked.