Your cookie preferences

Procura uses cookies that are essential for the site to work, and — with your consent — analytics cookies to understand what's useful to you. No third-party trackers, no sharing with advertisers. Learn more

Resources / How-to guide
Benin compliance

MECeF Benin: end-to-end DGI standardized invoicing

How Procura natively integrates Benin's DGI MECeF framework: setup, API flow, multi-country support, and the path to production.

Procura team · May 2026 · 9 min read
01 · What is MECeF and why it matters02 · The five fields you must configu03 · The submit-and-confirm flow04 · Multi-country: MECeF + FNE in pa05 · Go-live checklist for your finan
Real time
DGI transmission
13 caractères
IFU format
24 caractères
MECeF DGI code
10 years
Mandatory retention
Back to resources
01

What is MECeF and why it matters

MECeF (Machine Électronique Certifiée de Facturation) is the standardized electronic invoicing system enforced by Benin's Tax Office (DGI). Every VAT-liable company in Benin must transmit each B2B invoice in real time to the DGI through MECeF and carry an official identifier + QR code on the printed copy. Without that identifier, the invoice can no longer support a VAT deduction for the buyer.

The framework went live in stages from 2020 onward and has now reached full mandatory coverage. The DGI position is unambiguous: a non-MECeF invoice is a non-deductible expense and a non-creditable VAT charge. For the seller, that means lost revenue. For the buyer, it means an effective 18% surcharge on every transaction outside the system.

Beyond pure tax mechanics, MECeF is also a fraud-prevention tool. The unique identifier and the central counter make it nearly impossible to issue parallel ghost invoices, cancel invoices after the fact, or alter posted amounts. The DGI has access to a real-time stream of every invoice, which has dramatically narrowed the gap between declared and actual VAT.

Procura was built natively to integrate with MECeF: as soon as an organization in Procura is set to country = Benin, the e-invoicing section appears in its settings with the exact fields the DGI expects (IFU, API token, NIM, environment), and every approved invoice can be normalized in one click against the official endpoint.

02

The five fields you must configure

An MECeF integration in Procura is configured around five core fields. The IFU (Identifiant Fiscal Unique) is your 13-character tax ID, the same number that already appears on every invoice you issue. The API token is a Bearer secret the DGI delivers when your company is registered on the developer portal. The NIM (Numéro d'Identification Machine) ties your taxpayer account to a specific certified billing machine — Procura acts as that machine.

Two more fields complete the setup: the environment (Sandbox vs Production) and the active toggle. Sandbox lets you submit specimen invoices against the DGI test platform without any tax impact — you should always start there. Production fires real submissions and counts every invoice in the official register; the active toggle lets you save credentials without going live.

Procura also exposes a third environment, Procura Mock, that simulates MECeF locally so you can validate the full flow before contacting the DGI at all. The mock returns the same response shape (uid, codeMECeFDGI, qrCode, NIM, dateTime) the production API returns, so any integration that works against the mock will work against the real DGI.

The settings UI ships with a dedicated bilingual onboarding card describing the five steps from registration to production: register on impots.bj/mecef, submit specimens, receive Sandbox token, get NIM + production token, switch to Production. Each step has a direct link to the relevant DGI page.

03

The submit-and-confirm flow

MECeF uses a two-step state machine for every invoice. Step one is the submission: Procura POSTs the structured invoice payload (IFU, type FV/FA/EV/EA, line items, payment methods, client data) to /api/invoice and receives a uid. At that point the DGI has staged the invoice but not yet issued the official identifier — it's pending.

Step two is the confirmation: Procura PUTs against /api/invoice/{uid}/confirm and receives the official codeMECeFDGI (24-character signed code), the QR code as a base64 image, the NIM that signed the invoice, and the exact dateTime of normalization. From that moment the invoice is final, public on the DGI register, and supports VAT deduction.

Procura wraps both steps inside a single trpc.mecef.normalizeInvoice mutation that's idempotent at the row level: an invoice that already carries a mecefCode cannot be re-normalized. On failure, the invoice is marked with mecefStatus = error and the raw DGI response is stored in mecefRawResponse for diagnosis. Audit log entries are created on success and failure so the compliance team can replay any incident.

The cancellation path is also supported: as long as an invoice is still in the submitted state (uid received but not confirmed), Procura can call /cancel to drop it from the DGI register without consuming a sticker. Once confirmed, the invoice is permanent — corrections require a credit note (FA), which is itself an MECeF transaction.

04

Multi-country: MECeF + FNE in parallel

An organization that operates in both Benin and Côte d'Ivoire — for example a group with offices in Cotonou and Abidjan — needs both MECeF and FNE active at the same time. Procura supports this natively: MECeF and FNE are two distinct module slugs in the activeModules array, and both can be enabled on the same tenant.

The Settings → Finance sidebar shows MECeF (Bénin) and FNE (Côte d'Ivoire) as two separate sections. Each holds its own credentials (IFU + token for MECeF, NCC + token + production URL for FNE), its own environment switch, and its own audit trail. Invoices issued under one regime are never confused with those issued under the other.

Provisioning a multi-country organization from the Procura platform-admin console is a single form: pick a primary country, then tick whichever module slugs apply (mecef, fne, or both). The country gate accepts ISO codes and full names in both languages, so a Bénin org saved as 'BJ' or 'Benin' or 'Bénin' all unlock the MECeF section the same way.

Behind the scenes the gating logic is countryHit OR moduleHit: a section appears whenever the org's country matches the section's accepted variants OR any of its module slugs appear in activeModules. That second branch is what lets a multi-country organization with country='Bénin' but activeModules=['mecef','fne'] see both regimes side by side.

05

Go-live checklist for your finance team

Before flipping MECeF to production, run through a five-point checklist. First, validate the integration end to end against the Procura mock — every approved invoice should pick up a stub identifier, the QR placeholder should render on the PDF, and the audit log should record both the submit and the confirm step. Second, register on impots.bj/mecef and obtain the Sandbox API token from the DGI developer space.

Third, configure Sandbox in Procura with your real IFU and the Sandbox token, then re-run the integration test against actual specimen invoices. The DGI validates the structure, the line-item taxes (groups A through F), the payment-mode codes, and the supporting fields. Any mismatch surfaces as a clear error message that the Procura settings page exposes verbatim.

Fourth, request the NIM and the production token. The DGI assigns the NIM after specimen validation; the production token is delivered alongside. Plug both into Procura, switch the environment to Production, leave the active toggle off until you are ready, and run one final dry-run with an internal invoice to verify the full chain.

Fifth, flip the active toggle and start normalizing real invoices. From that moment, every approved invoice should be normalized within minutes, the codeMECeFDGI should appear on the printed invoice and on the supplier portal, and the monthly VAT recap exported by Procura should reconcile down to the cent against the DGI register. If anything drifts, the audit log replays the request and response of every transaction.

Ready to enable MECeF in Procura?

Test the full flow with the Procura mock today, then swap in real DGI credentials the moment they arrive — same form, no migration.