Skip to content

Installation and setup

  • CS-Cart or Multi-Vendor 4.17.2 or later (Ultimate or Multi-Vendor edition), PHP with the dom and curl extensions (zip to read ANAF’s error report).
  • Administrator access to the store’s admin panel, and a store that is reachable over https (ANAF only accepts https callback addresses).
  • A Romanian company registered in the ANAF Private Virtual Space (SPV) and a person with SPV rights (legal representative, designated representative or authorised person) who owns a qualified digital certificate. The certificate is used by that person in the browser at ANAF; it is never uploaded to the store.
  • An OAuth application registered in the ANAF portal (steps below).
  • A cron job on your server (see step 8).
  1. Download the kv_ro_efactura-<version>.zip package from your Kavio Labs or CS-Cart Marketplace account.
  2. In the admin panel, open Add-ons > Manage add-ons.
  3. Click the gear button and choose Manual installation, then upload the archive.
  4. Find RO e-Factura E-Invoicing for Romania in the list and make sure its status is Active.
  5. Enter your license key under Settings > License (Kavio Labs downloads) and click Check now.

Register an OAuth application at ANAF (once)

Section titled “Register an OAuth application at ANAF (once)”

These steps follow the ANAF document “Procedura de inregistrare a aplicatiilor in portalul ANAF” (static.anaf.ro, service page “Servicii web protejate de OAUTH”). Check that document for the current screens.

  1. On anaf.ro open Servicii Online > Inregistrare utilizatori > Dezvoltatori aplicatii and create or sign in to a developer account (username and password, e-mail confirmation).
  2. Open Editare profil OAuth and add an application: name, the service E-Factura, and the callback URL (below).
  3. ANAF shows the Client ID and Client Secret. Keep them; the secret is entered in the store and stored encrypted.

The callback URL must be https and must match exactly what the store sends. The Connection page shows the default (the address of the add-on’s callback in your admin panel). If ANAF does not accept that address, register any https address you control and use Paste tokens instead (the ANAF document describes getting the tokens with Postman, callback https://oauth.pstmn.io/v1/callback).

  1. Open Orders > RO e-Factura and the Connection tab.
  2. Choose Test and enter the Client ID and Client secret. Test and Live use separate fields; the same application can be entered in both.
  3. Fill in the seller data exactly as the company is registered: name, CIF without RO, VAT payer, street, city, county code (CJ, TM, B …), IBAN. For Bucharest enter the sector as city (SECTOR1 to SECTOR6). Save.
  4. Click Authorise with ANAF. Your browser goes to ANAF where you choose the qualified certificate; ANAF sends the browser back to the store, which stores the access token (valid 90 days) and refresh token (365 days) encrypted and renews them automatically. Authorise again if the refresh token expires or the application is changed.
  5. Click Test connection: the add-on calls ANAF’s test service and the message list of your CIF.
  6. Upload a test invoice (step “Check an invoice” in Usage) in Test mode and look at the result.
  7. Switch to Live and authorise again only after the tests; invoices sent in Live mode have legal effect.
  8. Add the cron job from the settings page (Cron section); every minute is fine, overlapping runs are prevented.

By default the marketplace owner connects one company for all orders (Marketplace owner mode on). Switch it off to let each vendor connect their own company, CIF and certificate in the vendor panel (Connection tab).

  1. Upload the new package the same way. Your settings, credentials, tokens and documents are kept.
  2. The add-on adds missing tables and settings by itself on the first request after the update.

See CHANGELOG for what changed in each version.

Open Add-ons > Manage add-ons, click the add-on’s gear button and choose Uninstall. This removes the add-on’s settings, language variables and database tables, including the stored credentials, tokens and the documents kept by the add-on. Keep your invoices: download the XML files and ANAF’s ZIP files first.