Connect WooCommerce to ANAF e-Factura

Every completed order becomes a CIUS-RO e-invoice filed to the ANAF SPV — no manual uploads, no missed 5-working-day deadlines.

WordPress 6.5+
WooCommerce 7.0+
PHP 7.4+
CIUS-RO / UBL 2.1

Manual install for now: the WordPress.org directory listing is still in review, and this page will point there as soon as it goes live.

Three values the plugin needs

Tenant ID

The email address of your Autoanaf account. Orders the plugin pushes land in that tenant, so copy it exactly — a typo creates a separate, empty tenant and your orders never appear in your dashboard.


Webhook secret

Any long random string you invent. The plugin signs every push with it (HMAC-SHA256) and sends it in the URL, so treat it like a password. Generate one:


Company CIF / VAT ID

The CIF of the company that issues the invoice, authorised for e-Factura in the ANAF SPV — the same one you use when you send invoices by hand.

Setup

1
Create your account

Register with the email address you want as your tenant ID and confirm it — that address is both your login and the tenant the plugin pushes orders to.

2
Install the plugin

Download the zip above, then in WordPress go to Plugins → Add New → Upload Plugin → Install Now → Activate. Nothing is asked at install time.

3
Generate the webhook secret

Run the command above (or use your password manager) and keep the string — you paste it into the plugin in the next step.

openssl rand -base64 32
4
Fill in the settings

Settings → Autoanaf: tenant ID, webhook secret, issuer name, issuer CIF, street, city, country and — for a Romanian issuer — the county. ANAF rejects an e-invoice whose Romanian party has no country subdivision.

5
Save and check the status

The panel shows Active once every required field is filled. Until then the plugin refuses to push orders, so nothing half-configured reaches ANAF.

6
Send a test order

Complete an order and watch it appear under Invoices with its ANAF status; the order itself is marked as submitted in WooCommerce.

What actually happens

For every order that reaches “completed”, the plugin POSTs the WooCommerce order — signed with your secret — to your Autoanaf tenant, with your issuer details in the query string:

https://core.autoanaf.ro/v1/webhooks/woocommerce/you@example.com?secret=<your-secret>&issuerName=<company>&issuerVat=RO12345678&issuerCity=<city>&issuerCountry=RO&issuerCounty=RO-NT

Autoanaf maps it to EN 16931 / CIUS-RO UBL and submits it to the SPV. If ANAF is unavailable or rate-limits the call, the order stays in a retry queue instead of being lost.


Business buyers

A “CIF firmă” field at checkout validates the buyer's CIF (RO checksum) and travels with the order, so B2B invoices carry the buyer VAT id instead of being rejected by ANAF.

If something looks wrong

The panel says Not configured: a required field is empty — usually the county for a Romanian issuer. Saving an RO configuration without one is refused on purpose.

Orders complete but no invoice appears: the tenant ID is wrong (a typo silently creates a new tenant) or the store cannot reach core.autoanaf.ro. The order keeps a failure marker and gets retried.

The invoice was created but ANAF rejected it: open it in the dashboard — the SPV rejection codes and the XML are there, and the invoice can be corrected and resubmitted.

Unsure where a value comes from? The plugin's readme.txt documents every setting, and contact@autoanaf.ro answers.