# WooCommerce

<figure><img src="/files/mklV3OhSs1hM4K8JhdJc" alt=""><figcaption></figcaption></figure>

[WooCommerce](https://woocommerce.com/) is a popular WordPress plugin that allows you to easily set up a webshop. Via the WooCommerce link in BestInvoicing, you can automatically convert an order from your WooCommerce webshop into an order confirmation, delivery note or invoice. This document can then be sent from BestInvoicing (automatically) to the customer via email.

## Activating the Connection with WooCommerce

This connection can be activated via the 'Apps and Integrations' menu.

1. Navigate to the top right corner of BestInvoicing and click your email address.
2. Select 'Apps and Integrations' in the menu.&#x20;
3. Go to the tab 'Advanced Settings' and click the green button 'Activate' next to 'WooCommerce'.

## Setting up the WooCommerce Connection

Once the link is activated, a yellow "Configure" button appears on the left side. Click it to set up the link.

<figure><img src="/files/MtZZlLn3EqqsRE2aDRIx" alt=""><figcaption></figcaption></figure>

## Webhook Settings

A "webhook" ensures that your WooCommerce webshop will forward all order information to BestInvoicing at the moment an order is placed.&#x20;

To set up the link between BestInvoicing and WooCommerce, you need to set up two webhooks, entering some data from BestInvoicing into your own WooCommerce environment.

<figure><img src="/files/UTUG5cKO7QYak0ZDl4Af" alt=""><figcaption></figcaption></figure>

Move to the admin panel of your webshop:

* Below 'WooCommerce', click 'Settings'. See step (1) in de image below.&#x20;
* Click the tab 'Advanced' (2)&#x20;
* In the menu below, navigate to 'Webhooks' (3)
* Click the button 'Add webhook' (4)

<figure><img src="/files/QnW7Ql1yaVmaxz4xyOW8" alt=""><figcaption></figcaption></figure>

Now you will see the following fields:

<figure><img src="/files/egsQSsCeiOfPns8rT3Ru" alt=""><figcaption></figcaption></figure>

* Name: free choice, use a name that's meaningful to you for this connection (e.g. 'BestInvoicing')&#x20;
* Status: select 'Active'
* Topic: select the appropriate action for your workflow.&#x20;
  * For the first webhook, select 'Order created'
  * For the second webhook, select 'Order updated'
* Delivery URL: copy the value from the 'Delivery URL' field in BestInvoicing to this field in WooCommerce&#x20;
* Secret: copy the value from the 'Secret' field in BestInvoicing to this field in WooCommerce API&#x20;
* Version: leave the suggested selection here (no need to change it)&#x20;

Click 'Save webhook' to save it in WooCommerce.&#x20;

{% hint style="info" %}
Repeat these steps to set up the second webhook.
{% endhint %}

You can now return to the configuration screen in BestInvoicing. Orders placed in WooCommerce will now be redirected to BestInvoicing.

## Order Settings&#x20;

In this section, choose what type of document should be created in BestInvoicing, when it should be created, and how it will be sent to your customer.

<figure><img src="/files/st9JSv5yS9FNC0xbt7pr" alt=""><figcaption></figcaption></figure>

Here you can choose to create an order form, a delivery note or an invoice.&#x20;

Next you select when the document should be created in BestInvoicing: as soon as an order is placed in WooCommerce, or only when this order has been paid.

If you check 'Send automatically via email', the document is immediately sent to the email address used to place the order in WooCommerce. If you do not check this box, the document will be created with 'Concept' status in BestInvoicing and you still need to send it yourself.&#x20;

If a customer in WooCommerce enters something in the field 'Order comment', this is displayed on the BestInvoicing documents in the field 'Additional text field above table'. In the BestInvoicing interface, this appears in the 'Internal note' field of the document.

## Bottom Texts and Emails

You can set the bottom text on the document itself, using different texts for documents of orders that have already been paid or are yet to be paid. If you have activated the app '[Foreign Language Customers'](/apps-integrations/foreign-language-customers.md), you can set these texts per language.

<figure><img src="/files/yv2YhvIlwwzJpj51nIdx" alt=""><figcaption></figcaption></figure>

You can also set the text for the accompanying email. Again, you can distinguish between an email text for an order already paid, or still to be paid.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://support.onfact.eu/connections/connections-for-webshops/woocommerce.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
