How do I validate AFM (Αριθμός Φορολογικού Μητρώου) + VIES for EU B2B?
Two Greek B2B identifiers, two validators:
- AFM (Αριθμός Φορολογικού Μητρώου), 9-digit Greek tax-ID. Algorithmic checksum (last digit is mod-11 of weighted sum). Validated against the AADE business directory via the AADE web service.
- VIES VAT, EU-wide validator (
EL + 9-digit AFMfor Greek-issued numbers). Required for cross-border zero-rated B2B sales (intra-EU reverse charge).
For Magento B2B we:
- Add AFM field to
customerentity (and B2Bcompanyon Adobe Commerce). - Run the AFM checksum client-side on register; reject invalid format before round-trip.
- Call AADE web service to verify the AFM is active and fetch the registered name + DOY (tax office). Cache 30 days.
- Call VIES for cross-border B2B; apply 0% ΦΠΑ with reverse charge note on the invoice when VIES is valid.
- Show the legal name on storefront once AFM is confirmed, reduces fraud + builds trust.
Required on every invoice over €100, we make the AFM block at checkout in the FR Greek view.