[Skip to main content](#vessel-content)

#  Dolibarr plugin

Details    Written by: Administrator    Category: [Pther extensions](/support/documentation/hikashop/other-extensions)     Published: 17 November 2026     Hits: 6

The Dolibarr plugin keeps your shop in step with **Dolibarr**, which stays the master of your data. Customers, prices and stock come from Dolibarr; orders go to Dolibarr and their status comes back. Everything is set on the **Dolibarr** page of the HikaShop backend (System menu), which also shows what each synchronisation did.

## Installation

1. In Dolibarr, enable the **API REST** module (Home &gt; Setup &gt; Modules, "Multi-modules tools" section). Dolibarr 20 or later is needed.
2. Create a Dolibarr user for the shop, for instance "shop", and give it the rights the plugin uses: read the thirdparties, contacts, products, stock and categories; create and validate customer orders; create thirdparties and contacts. Add read and create rights on invoices and payments only if you want the shop to invoice its paid orders. Then open the user's card, click Edit, and generate its **API key**.
3. Download the plugin from our website via the download link given after the purchase, and install it with the extension manager of Joomla, or in HikaShop &gt; Plugins on WordPress. Enable it.
4. Open HikaShop &gt; System &gt; **Dolibarr**, enter the address of your Dolibarr and the API key, and click Save. The top of the page then shows the version of Dolibarr and the user the shop is connected as, and the settings offer the price levels, categories, warehouses, services and payment modes of your Dolibarr.
5. Make sure your products have, as their code in HikaShop, their reference in Dolibarr: that is how the plugin matches them.
6. Set up the HikaShop cron (System &gt; Configuration &gt; Advanced), ideally every 5 to 15 minutes: it runs the synchronisation. The "Run now" button does a run at once, handy for the first import.
7. In System &gt; Order statuses, tick in the **Dolibarr** column the statuses that send an order to Dolibarr (confirmed and shipped by default).

## The Dolibarr page

![The top of the Dolibarr page: the connection, the customers and products linked, and the orders in Dolibarr](/images/doc/plugins/dolibarr/dolibarr_status.png)

The top of the page shows the connection to Dolibarr, how many customers and products are linked, and how many orders are in Dolibarr. Below, the **Synchronisation** table gives, for each job, when it last ran and what it did. "Run now" runs a job at once; "Read everything again" makes the next runs read every customer or product again, for instance after you fixed many records in Dolibarr. The orders that could not be sent are listed with their error and a button to try them all again.

## Connection

- **Dolibarr address**: the address of your Dolibarr, as you open it in your browser.
- **API key**: the key of the Dolibarr user of step 2. Leave the field empty to keep the saved key.
- **Entity**: only with the Multicompany module of Dolibarr, when your Dolibarr hosts several companies: the number of your company's entity. 0 uses the entity of the API user, which is what you want when the API user belongs to your company only.
- **Debug mode**: writes every call to Dolibarr to the HikaShop log (System &gt; Logs).
- **Alert after (hours)** and **Alert email**: an email is sent when a synchronisation has not succeeded for this long (Dolibarr unreachable, key revoked, cron stopped), at most once a day.

## Customers

![The Customers settings: import, category, address, price levels, customer categories and customers not in Dolibarr](/images/doc/plugins/dolibarr/dolibarr_customers_settings.png)

- **Import the customers**: creates and updates a HikaShop customer for each Dolibarr thirdparty that is a customer and has an email (its own, or the email of one of its contacts). The customer gets a shop account when they register with that email: the account is linked to the Dolibarr customer at once.
- **Only this category**: imports only the customers of one Dolibarr category.
- **Import the address**: keeps the customer's billing address in step with the thirdparty's address in Dolibarr. The names come from the contact with the same email, or the first contact.
- **Price levels**: with several prices per product in Dolibarr (price levels), choose the user group of each level. Each customer is put in the group of their level and the products get the prices of each level for its group. Level 1 is the price for everyone. HikaShop gives each customer the lowest price they are entitled to, which is the rule when the levels are discounts. This needs HikaShop Business.
- **Customer categories**: puts the customers of a Dolibarr category in a user group, to give them a discount, a payment method or a shipping method of their own.
- **Customers not in Dolibarr**: when someone who is not in Dolibarr orders, the plugin can create them in Dolibarr, put the order on one Dolibarr customer of your choice (give its id below), or not send the order.
- **Other customer fields**: one line per field, `dolibarr_field=hikashop_column`, to copy more information onto the customer. `options_xxx` reads the Dolibarr extra field xxx; the HikaShop column is a customer custom field you created.

## Products, prices and stock

![The settings of the Dolibarr page: connection, customers, products, prices and stock](/images/doc/plugins/dolibarr/dolibarr_settings.png)

- **Update the products**: updates the HikaShop products whose code is a Dolibarr reference. Variants are matched the same way, on their own code.
- **Create the missing products**: creates the Dolibarr products for sale that are not in the shop, unpublished, in the category you choose, so you add pictures and a description before publishing them.
- **Fields Dolibarr updates**: what Dolibarr overwrites. Leave the name and the description off to write them in HikaShop. "Published" unpublishes a product when it is no longer for sale in Dolibarr.
- **VAT rates**: the HikaShop tax category of the products, from their VAT rate in Dolibarr.
- **Other product fields**: one line per field, `dolibarr_field=hikashop_column`, for instance a delivery time kept in a Dolibarr extra field copied into a product custom field.
- **Import the prices**: replaces the prices of the products with those of Dolibarr, excluding tax, in the main currency of the shop. Turn it off to manage the prices in HikaShop.
- **Customer prices** and **Quantity prices**: also import the prices Dolibarr has for some customers, and its prices by quantity. Customer prices need HikaShop Business.
- **Products checked per run**: a customer price changed in Dolibarr does not change the date of the product, so the products are read again in turn, this many at each run.
- **Import the stock** and **Warehouses**: the stock of the shop is the sum of the warehouses you tick, or of all of them. The plugin follows the stock movements of Dolibarr, so a stock change shows in the shop at the next run.

A product deleted in Dolibarr is unpublished in the shop, never deleted.

## Orders

![The Orders settings: sending, validation, services, payment modes, invoicing and status follow-up](/images/doc/plugins/dolibarr/dolibarr_orders_settings.png)

- **Send the orders**: an order is created in Dolibarr when it reaches one of the statuses ticked in the Dolibarr column of System &gt; Order statuses. Its customer reference is the order number of the shop.
- **Validate them**: validates the order in Dolibarr, which gives it its number. Off, it stays a draft for you to check.
- **Warehouse**: the warehouse the stock leaves from, when Dolibarr decreases the stock at the validation of an order.
- **Services** for the shipping, the payment fees and the discounts: Dolibarr services put these lines on the right accounting accounts. Without, they are free text lines.
- **Payment methods**: the Dolibarr payment mode of each payment method of the shop.
- **Shipping address**: when the order goes to another address than the billing one, it is added to the Dolibarr order as its shipping contact.
- **Invoice the paid orders** and **Bank account**: creates and validates the invoice of the paid orders in Dolibarr and records their payment on the bank account. This needs the Banks module in Dolibarr.
- **Other order fields**: one line per field, `hikashop_column=dolibarr_field`, to send order custom fields, for instance a site reference into a Dolibarr extra field.
- **Follow the status in Dolibarr**, **Statuses** and **Notify the customer**: the HikaShop status an order gets when its Dolibarr order is validated, in progress, delivered, billed or canceled, and whether the customer gets the status email.

![The order page of the backend with its Dolibarr order](/images/doc/plugins/dolibarr/dolibarr_order_page.png)

The order page of the backend shows its Dolibarr order, with a link to it in Dolibarr. When it could not be sent, the error is shown with a "Send to Dolibarr" button. An order is never sent twice: what was sent is kept, and an order created in Dolibarr just before a time-out is found again rather than created a second time.

## Customer account

**Show the Dolibarr documents** adds a "My documents" page to the account of the customers known in Dolibarr: their orders, invoices or proposals (as you choose), including those made outside the shop, with their PDF. A customer only ever sees their own documents.

## Instant updates (webhooks)

The cron is enough. To see changes made in Dolibarr at once, enable **Accept Dolibarr webhooks** and save: the page shows the address to give to Dolibarr. In Dolibarr, enable the **Webhook** module, add a target with this address, of type "Not blocking", with the triggers you want, for instance COMPANY\_MODIFY, CONTACT\_MODIFY, PRODUCT\_MODIFY, PRODUCT\_PRICE\_MODIFY, STOCK\_MOVEMENT, ORDER\_VALIDATE, ORDER\_CLOSE, ORDER\_CANCEL, ORDER\_CLASSIFY\_BILLED and SHIPPING\_VALIDATE. The address holds a secret key: keep it private, and make a new one if it leaked. Dolibarr does not try again a call that failed, so the cron keeps checking everything anyway.

## For developers

An add-on plugin of the hikashop group can change what is imported and sent with these events: `onDolibarrBeforeCustomerSave($thirdparty, &$data, &$extra, &$do)`, `onDolibarrAfterCustomerSave($thirdparty, $userId, $new)`, `onDolibarrBeforeProductSave($dolibarrProduct, &$columns, &$prices, &$do)`, `onDolibarrBeforeCustomerCreate($order, &$thirdparty)`, `onDolibarrOrderPayload($order, &$payload, &$do)`, `onDolibarrAfterOrderPush($order, $dolibarrOrderId)` and `onDolibarrOrderStatus($dolibarrOrder, $orderId, &$status, &$do)`.

## Troubleshooting

- "Connection failed": check the address, that the API REST module is enabled, and the key. An answer 401 means the key is wrong; 403 means the user lacks a right.
- A product is not updated: its code in HikaShop must be its reference in Dolibarr. The Synchronisation table counts the Dolibarr products "not in the shop".
- A customer is not imported: they must be a customer in Dolibarr (not only a prospect) and have an email, on the thirdparty or one of its contacts.
- An order was not sent: its error is on its page and in the list of the Dolibarr page. Fix the cause (often a product or a VAT rate missing in Dolibarr) and click "Send to Dolibarr".
- With Debug mode on, every call to Dolibarr is written to System &gt; Logs.
