Chat on WhatsApp

How do I validate CUI + VIES for Romanian and EU B2B in Magento?

CUI (Cod Unic de Înregistrare) is the Romanian company ID, 2-10 digits, optionally prefixed with RO for VAT-registered companies. Two separate validations matter:

  • CUI lookup against ANAF, the Romanian tax authority publishes a free API (webservicesp.anaf.ro/PlatitorTvaRest/api/v8/ws/tva) that returns company name, address, TVA registration status, and inactive-trader flag. We call this on Magento customer registration to auto-fill company name + address from CUI, and to reject inactive traders.
  • VIES validation, for EU intra-community B2B, the CUI prefixed with RO must validate via VIES (EU-wide VAT validation). Required for 0% TVA reverse-charge on cross-border B2B sales.

Magento integration steps:

  1. Add a cui attribute to customer entity (or B2B company if on Adobe Commerce).
  2. On registration, call ANAF API, auto-fill name + address, set is_tva_payer flag.
  3. Cache ANAF response 30 days; re-validate on address change.
  4. For cross-border EU B2B: call VIES, apply 0% TVA reverse-charge if valid + customer outside RO.
  5. For RO-domestic B2B: still apply 19% TVA but issue full fiscal factură with CUI.
Was this helpful?