- What is Clearfacts?
- Why EMClearFacts?
- Prerequisites
- Installation
- Configuration
- Sending Invoices
- Queue and Tracking
- Diagnostics and Maintenance
- Troubleshooting
- FAQ
- Is Clearfacts required to use EMClearFacts?
- Is EMClearFacts compatible with EMPeppol?
- Can supplier invoices be sent to Clearfacts?
- Which invoice types are sent?
- Is the history kept when the module is updated?
- Does EMClearFacts work with Multicompany?
- How do I update the module?
- Where can I get help?
EMClearFacts — Send Invoices to Clearfacts from Dolibarr
EMClearFacts connects your Dolibarr ERP to the Clearfacts accounting platform through the official GraphQL API. Send your customer and supplier invoices to your accountant in one click, with full tracking and a permanent audit trail.

What is Clearfacts?
Clearfacts is a Belgian digital accounting platform used by thousands of accounting firms and businesses. It centralises the accounting documents (invoices, statements, receipts) sent by clients and feeds them directly into the accounting firm's software.
Why EMClearFacts?
- No more emailing invoices — Your invoices land directly in your accountant's Clearfacts space, in the right folder
- Customer and supplier invoices — EMClearFacts handles both flows in parallel, for every invoice type (invoices, credit notes, deposits, replacement invoices)
- Manual or automatic mode — Send on demand or as soon as an invoice is validated in Dolibarr
- Bulk sending — Select several invoices in the list and send them in one operation
- Two supported formats — UBL XML (preferred, when a UBL file is attached to the invoice, for example generated by EMPeppol) or PDF as fallback
- Comment for the accountant — Useful Dolibarr references (reference, third party, customer or supplier reference, date, public note…) travel with each document
- Permanent audit trail — Every send is recorded with its Clearfacts UUID, never purged, and can add an event on the invoice
- Smart queue — Automatic retries with increasing delays on temporary errors
Prerequisites
| Item | Minimum version |
|---|---|
| Dolibarr | Dolibarr ≥ 17 |
| PHP | PHP ≥ 8.1 |
| Dolibarr modules | Invoices (required), Scheduled jobs (for automatic mode) |
| Clearfacts account | Active, with API access |
You need a Clearfacts account with the API enabled. Two authentication methods are available: OAuth 2.0 (recommended) or Personal Access Token.
EMPeppol compatibility: If you also use EMPeppol, EMClearFacts can send the UBL XML file attached to the invoice instead of the PDF — no double generation.
Installation
From the DoliStore
- Go to the DoliStore and search for EMClearFacts
- Buy the module and download the ZIP archive
- Extract the archive into the
htdocs/custom/folder of your Dolibarr - The final folder must be
htdocs/custom/emclearfacts/
Activation
- Log in to Dolibarr as an administrator
- Go to Home → Setup → Modules/Applications
- Search for "EMClearFacts" and click Activate
A Clearfacts entry appears in the left menu of Billing | Payment, with the sub-menus Sent Invoices (history) and Clearfacts Queue. A Clearfacts tab is added on customer and supplier invoices.
On first activation, sending is enabled for customer and supplier invoices, in manual mode: nothing is transmitted without an action on your part.
The configuration is in Home → Setup → Modules/Applications → EMClearFacts, in five tabs: Connection, Sending, Options, Debug and About.
Configuration
OAuth 2.0 Authentication (recommended)
OAuth 2.0 is the recommended method for multi-user environments. No token needs to be entered: the connection goes through the E-dem OAuth relay.
- In the Connection tab, select OAuth 2.0
- Click Connect to Clearfacts
- Authorise the connection in the Clearfacts window that opens
- The target administration is retrieved automatically from the API; pick it from the list if your account manages several

Personal Access Token Authentication
For a quick single-user setup:
- Generate a Personal Access Token from your Clearfacts account
- Select Personal Access Token in the Connection tab
- Paste your token (80 characters) into the dedicated field
- Click Save — the target administration is retrieved automatically

The VAT number field remains available to enter the target administration by hand if needed (full format with country prefix, e.g. BE0123456789). The Test connection button checks the configuration; the Configuration status summary tells you whether everything is ready.
Sending Options
Configure customer and supplier invoices independently in the Sending tab:

| Option | Description |
|---|---|
| Manual mode | You send each invoice from its card — you stay in control |
| Automatic mode | The invoice is queued on validation and sent by the scheduled job |
| Prefer XML format | UBL XML when a UBL file is attached to the invoice (recommended), otherwise PDF |
| Delay before sending | Waiting time after validation before processing, so you can still correct the invoice (default: 15 min) |
Important: Automatic mode requires Dolibarr's Scheduled jobs module to be active and the Clearfacts - Process invoice upload queue scheduled job to run at least once a day (its default frequency). Otherwise invoices stay stuck in the queue.
Comment Attached to Documents
Clearfacts displays a free "comment" field on the document page. EMClearFacts uses it to pass your accountant the Dolibarr references useful for reconciliation.

- Send a comment: global switch
- Comment for sales / purchase invoices: independent activation and template for each type
- Template: free text and placeholders inserted in one click:
{ref},{ref_client},{ref_supplier},{thirdparty_name},{date},{note_public},{note_private},{total_ht},{total_ttc}. Empty segments are removed automatically - Live preview, and a Reset to default button to restore the original template
By default, the template uses the public note: your private notes are never sent to the accountant unless you add {note_private}. In Clearfacts, the comment is displayed on a single line.
Options

- Maximum retries: number of automatic attempts on error (default: 3), spaced 1, 5 then 15 minutes apart
- Show Clearfacts button on invoice card: show or hide
- Show Clearfacts status on invoice card: show or hide
- Audit trail — Log an event on the invoice when a send succeeds: an event (with the Clearfacts UUID) is added to the invoice's Events tab, whether the send was manual or automatic. Enabled by default
Sending Invoices
From an Invoice Card
On a validated invoice, the Clearfacts button appears in the action bar and opens the invoice's Clearfacts tab, from which you start the send.
The sending status is visible directly in the invoice header ("Sent" with the date, or "Not sent").

Clearfacts Tab
The Clearfacts tab of each invoice shows the full sending history: date, format, status, Clearfacts UUID and user. The Resend to Clearfacts button lets you resend an invoice that was already sent (after confirmation, a new document is created in Clearfacts).

Bulk Sending from the List
From the customer or supplier invoice list, select one or more invoices and use the Add to Clearfacts queue mass action. The invoices are added to the queue and processed in the background.
A Clearfacts column in the list shows the sending status of each invoice with coloured badges.

Queue and Tracking
Queue
The Clearfacts → Clearfacts Queue menu gathers pending, in-progress and failed sends. It cleans itself: an invoice sent successfully leaves it immediately, and an invoice already sent is not resent by the queue.

| Action | Description |
|---|---|
| Process now | Forces an immediate send without waiting for the retry delay |
| Retry all failed | Puts all failed items back to "pending" |
Each queue item shows: reference, origin (customer/supplier), priority, status, attempt counter, last error, date added and next attempt time. Failed items stay in the queue until you act on them (retry, discard).
Permanent History
The Clearfacts → Sent Invoices menu keeps every send as your audit trail. This history is never purged automatically.

Each entry contains:
- Exact date and time
- Invoice reference (direct link)
- Origin (customer/supplier), type (sale/purchase)
- Format sent (PDF or UBL XML)
- Status with coloured badge
- Clearfacts UUID — direct link to the document in your Clearfacts account
- User who initiated the send
Diagnostics and Maintenance
The Debug tab of the configuration gathers all tools on a single screen:

- Environment: Production or Sandbox. In Sandbox, a banner reminds you on every page of the module
- Debug mode: detailed logging in the Dolibarr log file
- Real-time statistics: total sends, successful, failed, pending
- Queue: size, pending, in progress, failed
- Test connection: one-click API check
- Fetch administrations: lists the Clearfacts folders accessible with your account
- Force retry failed uploads
- Last 10 sends history: instant diagnostics without leaving the page
Troubleshooting
The connection test fails (authentication error, 401) → Your token or OAuth session is invalid or has expired. With a Personal Access Token, generate a new one in Clearfacts and paste it in the Connection tab. With OAuth 2.0, click Disconnect then Connect to Clearfacts. Also check that the environment (Debug tab) matches your account: a production account does not work in Sandbox.
The connection test fails with a timeout → Your server cannot reach the Clearfacts API over HTTPS. Check that outgoing HTTPS connections (port 443) are allowed by your firewall and, if you go through a proxy, that PHP is configured to use it.
"No PDF or XML file found for this invoice" → The module found no document to send. Generate the PDF from the invoice card (Generate button in the documents area), then send again.
The XML format is not used → EMClearFacts only sends a UBL XML if a UBL file is attached to the invoice (for example generated by EMPeppol or DoliFalco, or the source XML of a supplier invoice received via Peppol) and Prefer XML format is set to Yes. Otherwise the PDF is sent automatically.
"This invoice has already been sent successfully" → To avoid duplicates, an invoice already sent is not resent. If a new send is really needed (for example after deletion on the Clearfacts side), use Resend to Clearfacts in the invoice's Clearfacts tab.
The invoice is sent to the wrong Clearfacts folder → Check the target administration in the Connection tab. Use Fetch administrations (Debug tab) to see the folders accessible with your account and their VAT numbers.
Automatic mode does not send invoices → Check in turn: Automatic mode is selected in the Sending tab; the Scheduled jobs module is active; the Clearfacts - Process invoice upload queue job is enabled (Home → Admin Tools → Scheduled jobs); Dolibarr's system cron is configured on your server. Remember the delay before sending (15 min by default) and the job frequency (once a day by default): sending is not immediate. To send right away, click Process now in the queue.
I click "Process now" but nothing happens → If the "Queue is empty" message is shown, there is nothing to process. Otherwise, temporarily enable Debug mode (Debug tab) to get the error details in the Dolibarr logs, then try again.
An item stays "Processing" forever → Processing was interrupted (crash, timeout). Items stuck "Processing" for more than 15 minutes automatically go back to "Pending" on the next run. Wait, or click Process now.
The history does not show recent sends → Successful sends leave the queue but appear in the history. Check Clearfacts → Sent Invoices, not the queue.
FAQ
Is Clearfacts required to use EMClearFacts?
Yes, you need an active Clearfacts account with the API enabled. EMClearFacts is a connector for that platform.
Is EMClearFacts compatible with EMPeppol?
Yes, and they work well together: EMClearFacts can send the UBL file attached to the invoice instead of the PDF, avoiding a double generation. Both buttons coexist on the invoice card.
Can supplier invoices be sent to Clearfacts?
Yes. Sending is configurable independently for customer and supplier invoices.
Which invoice types are sent?
All of them: standard invoices, credit notes, deposits and replacement invoices.
Is the history kept when the module is updated?
Yes. The history is stored in the Dolibarr database and is never purged automatically by the module.
Does EMClearFacts work with Multicompany?
Yes. Each entity has its own configuration (connection, target administration, sending options): configure the module in each entity.
How do I update the module?
- Download the new version from the DoliStore
- Replace the files in
htdocs/custom/emclearfacts/ - Deactivate and reactivate the module in Modules/Applications: your settings are kept and new options get their default value
Where can I get help?
- E-dem support: Contact us for any technical question
- Clearfacts documentation: clearfacts.be for the platform itself