Dolibarr
Dolibarr is an open source, free software package for companies of any size, foundations or freelancers. It includes different features for enterprise resource planning and customer relationship management. With Forms Bridge you can get your WordPress forms connected to your Dolibarr instance and convert web visitors to contacts and prospects or receive quotations and sell orders of your products directly from your website.

The addon
Dolibarr has a REST API as an optional module. Once enabled, a set of web services will be available to be called out of the box. This addon requires your instance to have this module enabled. Forms Bridge will use a variation of the generic REST API bridge class to work with this API. In addition, the addon comes with a suit of templates and workflow jobs to bridge your WordPress forms to the resources like contacts, prospects, quotations, sell orders and meetings.
Backend
To configure your Dolibarr’s REST API as a backend you will need to generate an API key. This API key is linked to a user. You can use your own user or create a new one for this purpose. To generate the key, you have to go to the user’s profile, click on Modify and then search for the Key for API field. You can manually type a key value, or click on the refresh button to get a random string. To finish, copy the key value and click on the Save button at the bottom of the screen.
Now go to the general settings page of Forms Bridge, open the backends panel and add a new backend with “Dolibarr” as name and your instance URL as the URL.
Once registered, on the headers table add a new header with DOLAPIKEY as name and your API key as the value. Now you have your backend ready to use.
You can achieve the same result using the template wizard with one of the addon’s template.
Bridges
The addon’s bridge is an extension of the REST API. Because of this they looks so similar. Like the REST API bridge, the addon’s bridge requires, in addition to the common fields (name, backend, form) an endpoint and an HTTP method.
The bridge endpoint have to match with one of the available endpoints of your instance API. To get an overview of this endpoints you can use the API explorer. To get there, open a web browser, go to your ERP’s admin UI and go to Tools > API explorer, copy your API key on the field from the header and click on explore. After that you will reach the following page:

Open a service, copy the endpoint and use it as your bridge endpoint. For example, to get your forms bridged to the contacts web service, you have to use /api/index.php/thirdparties
.
The bridge allows you to use 4 HTTP methods (GET, POST, PUT, DELETE). In most cases you only want to use the POST method as it is the standard method to write entries on a system through a REST API..
Templates
The addon comes packed with the following templates:
Appointments π
Appointments form template. The resulting bridge will convert form submissions into events on the calendar linked to new contacts.Company Prospects π
Leads form template. The resulting bridge will convert form submissions into company prospects linked to new contacts.Company Quotations π
Quotations form template. The resulting bridge will convert form submissions into quotations linked to new companies.Contacts π
Contact form template. The resulting bridge will convert form submissions into contacts.Customers π
Contact form template. The resulting bridge will convert form submissions into customers.Prospects π
Lead form template. The resulting bridge will convert form submissions into prospect contacts.Quotations π
Product quotations form template. The resulting bridge will convert form submissions into quotations linked to new contacts.Company Appointments π
Appointments form template. The resulting bridge will convert form submissions into events on the calendar linked to new companies.
Dolibarr is a modular system and the REST API may change in base on what modules are enabled on the instance.
Workflow jobs
The addon comes packed with the following workflow jobs:
Appointment attendee π
Create a contact and binds it to the appointment as an attendeeAppointment dates π
Sets appointment start, end time and duration from datetime and duration fields.Contact π
Creates a contact and adds its ID to the contact_ids field of the payloadContact’s company π
Creates a new company and bind the contact to itCountry ID π
Check if country id is valid or replace its value if a country name is passedNext code client π
Query for the next valid thirdparty code clientSkip if contact exists π
Aborts form submission if the contact existsSkip if thirdparty exists π
Aborts form submission if a thirdparty already existsFormat date fields π
Gets date, hour and minute fields and merge its values into a date with format Y-m-d H:M:SISO2 country code π
Gets the ISO2 country code from country names and replace its valueISO3 country code π
Gets the ISO3 country code from country names and replace its value