Ai trimis o factură prin e-Factura și după câteva ore primești răspuns: respinsă. Fișierul XML generat din WooCommerce nu respectă structura pe care o cere ANAF, și de multe ori vina nu e la plugin, e la datele pe care le-ai completat tu în magazin.
ANAF verifică fișierul automat, printr-un sistem numit Spații Virtuale Private (SPV) — locul unde încarci și primești facturile electronice. Sistemul nu ghicește nimic: dacă un câmp e gol, greșit formatat sau nu corespunde cu ce e trecut la Registrul Comerțului, factura pică.
De ce pică cel mai des facturile
Trei cauze se repetă la aproape toate magazinele pe care le-am văzut până acum:
- CUI-ul clientului nu are prefixul de țară (RO) sau are spații în el.
- Codul de TVA e setat greșit în WooCommerce, la Settings (Setări) → General, și nu corespunde cu ce declari real.
- Adresa de facturare a clientului nu are județul completat, iar ANAF cere acest câmp obligatoriu pentru firmele din România.
Dacă folosești un plugin de e-Factura (cele mai cunoscute generează XML-ul direct din comenzile WooCommerce), el ia exact datele din câmpurile astea. Nu le corectează, nu le completează, doar le transformă în format XML.
Ce completezi în WooCommerce înainte să exporți
- Deschizi WooCommerce → Settings → General și verifici că adresa firmei tale e completă: stradă, oraș, județ, cod poștal.
- Deschizi fiecare comandă la care ai emis factură și verifici la secțiunea Billing (Facturare) că CUI-ul clientului e scris fără spații, cu RO în față dacă firma e plătitoare de TVA.
- Verifici câmpul de județ (State/County) — la firmele din București trebuie ales sectorul corect, nu generic București.
- Setezi codul CPV sau codul de produs, dacă vinzi către instituții publice, în descrierea produsului, la câmpul SKU sau într-un câmp personalizat, în funcție de pluginul folosit.
- Exporți fișierul XML din pluginul de e-Factura și îl încarci manual o dată în SPV, ca test, înainte să automatizezi trimiterea.
Pasul cu testul manual nu e opțional. Am văzut magazine care au automatizat trimiterea din prima zi și au acumulat douăzeci de facturi respinse până să observe cineva.
Ce nu merită să faci
Nu merită să încerci să repari fișierul XML direct, cu un editor de text. Structura cerută de ANAF are reguli stricte de formatare (schema UBL 2.1), iar o virgulă în plus în locul nepotrivit invalidează tot fișierul. Corectezi datele din WooCommerce și regenerezi fișierul din plugin, nu invers.
Nu merită nici să presupui că un client vechi, cu factura validată de zece ori, va trece mereu. Dacă și-a schimbat sediul sau codul de TVA și nu ai actualizat adresa în contul lui de client, următoarea factură pică exact la fel ca la un client nou.
Cum verifici înainte să trimiți în masă
Cel mai sigur test: trimiți o singură factură către un client cu datele complete, aștepți confirmarea din SPV, și abia apoi pornești exportul pentru restul comenzilor din lună. La un magazin pe care l-am ajutat să treacă pe e-Factura, asta a scurtat de la trei zile de respingeri repetate la o singură rundă de corecții.
Mâine dimineață, înainte de orice altceva, deschide ultimele cinci comenzi facturate și verifică CUI-ul și județul clientului. Dacă sunt corecte acolo, fișierul de export va fi corect și la următoarea trimitere.
Întrebări frecvente
Trebuie să instalez un plugin separat sau WooCommerce face asta din start?
WooCommerce nu generează singur fișierul XML cerut de ANAF. Ai nevoie de un plugin dedicat de e-Factura care să transforme comenzile în formatul UBL 2.1 cerut de SPV.
Dacă am deja sute de comenzi vechi cu date greșite, trebuie să le corectez pe toate?
Doar pe cele pentru care mai emiți facturi acum sau retroactiv. Comenzile vechi, deja facturate și validate, nu se retrimit — corectezi datele doar înainte de export.
Cât de des se schimbă regulile ANAF pentru fișierul de export?
Nu foarte des, dar când se schimbă, pluginul trebuie actualizat rapid. Ține pluginul de e-Factura mereu la ultima versiune, nu doar WordPress și WooCommerce.
You send an invoice through e-Factura and a few hours later you get the answer: rejected. The XML file generated from WooCommerce doesn't match the structure required by ANAF (Romania's tax authority), and often the fault isn't the plugin's, it's the data you filled in on the store.
ANAF checks the file automatically, through a system called SPV (Virtual Private Space) — where you upload and receive electronic invoices. The system doesn't guess anything: if a field is empty, badly formatted, or doesn't match what's registered with the Trade Registry, the invoice fails.
Why invoices get rejected most often
Three causes come up on almost every store I've looked at:
- The customer's tax ID is missing the country prefix (RO) or has stray spaces in it.
- The VAT setting in WooCommerce, under Settings → General, doesn't match what you actually declare.
- The customer's billing address is missing the county field, which ANAF requires for Romanian companies.
If you use an e-Factura plugin (the common ones generate the XML straight from WooCommerce orders), it takes exactly what's in those fields. It doesn't fix anything, it doesn't fill gaps, it just converts what's there into XML.
What to fill in on WooCommerce before you export
- Open WooCommerce → Settings → General and check that your own company address is complete: street, city, county, postal code.
- Open every order you've invoiced and check, under Billing, that the customer's tax ID has no spaces and starts with RO if the company is VAT registered.
- Check the State/County field — companies in Bucharest need the exact sector selected, not just Bucharest generically.
- Set the product code, if you sell to public institutions, in the product's SKU field or a custom field, depending on which plugin you use.
- Export the XML from the e-Factura plugin and upload it manually once into SPV, as a test, before you automate sending.
The manual test step isn't optional. I've seen stores that automated sending from day one and piled up twenty rejected invoices before anyone noticed.
What's not worth doing
It's not worth trying to fix the XML file directly, in a text editor. The structure ANAF requires follows strict formatting rules (the UBL 2.1 schema), and one extra comma in the wrong place invalidates the whole file. You fix the data in WooCommerce and regenerate the file from the plugin, not the other way around.
It's also not worth assuming an old customer, validated ten times before, will always go through. If they've changed their registered address or VAT code and you haven't updated their customer record, the next invoice fails just like a new customer's would.
How to check before sending in bulk
The safest test: send a single invoice to a customer with complete data, wait for confirmation from SPV, and only then start the export for the rest of the month's orders. On one store I helped move to e-Factura, this cut what used to be three days of repeated rejections down to a single round of fixes.
Tomorrow morning, before anything else, open your last five invoiced orders and check the customer's tax ID and county. If those are right, the export file will be right the next time too.
Frequently asked
Do I need a separate plugin, or does WooCommerce handle this on its own?
WooCommerce doesn't generate the XML file ANAF requires on its own. You need a dedicated e-Factura plugin that converts orders into the UBL 2.1 format SPV expects.
If I already have hundreds of old orders with wrong data, do I need to fix all of them?
Only the ones you're invoicing now or retroactively. Old orders that were already invoiced and validated don't need resending — you only fix the data before exporting new ones.
How often do ANAF's rules for the export file change?
Not very often, but when they do, the plugin needs updating quickly. Keep the e-Factura plugin itself on the latest version, not just WordPress and WooCommerce.


