Description
For shops in Romania that sell to companies. At the checkout the buyer ticks “Cumpăr pe firmă” and types the company’s fiscal code (CUI / CIF). The plugin asks apifirme.dev and fills in:
- the company’s name, as registered;
- its trade register number (J40/372/2002);
- the address: street, locality, county, postal code;
- the CUI as it is written on an invoice, with RO where the company is registered for VAT.
It also tells the buyer whether the company is a VAT payer, and warns when it is fiscally inactive or struck off. The CUI and the register number are kept with the order, shown on the order’s page and printed with the billing address in the order’s e-mails.
Pe scurt, în română: clientul bifează „Cumpăr pe firmă”, scrie CUI-ul, iar denumirea, numărul din registrul comerțului și adresa se completează din datele oficiale (ANAF, ONRC). Fără greșeli de tastare pe factură.
What it does not do
- It does not issue invoices; it gives your invoicing plugin correct data.
- On the block-based checkout it does not fill the fields yet: use the classic checkout (the
[woocommerce_checkout]shortcode) for now.
Care for the data
- The API key stays on your server. The browser talks to your shop, and your shop to apifirme.dev.
- The CUI’s check digit is verified in the shop before anything is asked, so a mistyped code costs nothing.
- A 13-digit number is a personal identity number (CNP), not a CUI: it is refused in the shop and never sent anywhere.
- An answer about a company is kept for a day, so the same company costs one request a day however often it buys.
- A visitor can look up at most 12 companies in ten minutes.
External services
This plugin connects to the apifirme.dev API (operated by Cubus Arts S.R.L., Romania) to obtain a company’s public registration data. It sends only the CUI typed at the checkout, together with your API key, when a buyer who ticked “Cumpăr pe firmă” leaves the CUI field. Nothing about the buyer, the cart or the shop is sent.
- Service: https://apifirme.dev
- Terms: https://apifirme.dev/termeni
- Privacy policy: https://apifirme.dev/confidentialitate
You need an API key from apifirme.dev. The free plan answers 100 requests a month.
Installation
- Install and activate the plugin. WooCommerce must be active.
- Open an account at apifirme.dev and create an API key.
- Go to WooCommerce > Settings > Advanced > apifirme and paste the key. (Or define
APIFIRME_API_KEYinwp-config.php, which keeps it out of the database.) - Place a test order as a company.
FAQ
What happens when the month’s requests are used up, or apifirme.dev cannot be reached?
The buyer is told to fill in the company’s details by hand, and the order goes through as before. The settings page shows how many requests are left.
Where are the CUI and the register number stored?
As order meta _billing_apifirme_cui and _billing_apifirme_reg. They are part of the order’s formatted billing address (placeholders {apifirme_cui} and {apifirme_reg} of Romania’s address format), so invoice plugins that print that address have them.
Can I use another address for the API?
Yes: the filter apifirme_wc_api_base.
Changelog
0.1.0
- First version: classic checkout, lookup by CUI, order meta, settings.