# Accounting systems



# Adding the WHMCS System

Installed Commitment Forecaster module, although it is installed in WHMCS, retrieves data through the API mechanism and not through direct references to the database.

<p class="callout info">Only the data on income invoices is downloaded from WHMCS. FV numbers, dates, and numeric values are taken. This data is only used to report the total value of revenues. Contractors' data is not collected and contractors between WHMCS and Commitment Forecaster are not compared in any way.</p>

Go to the **"Accounting Systems"** menu item and click **"List of systems"**.

Then click the **"Create apiWHMCS"** button

[![2021-11-05_13-13.png](https://doc.puq.info/uploads/images/gallery/2021-11/scaled-1680-/TJX2021-11-05-13-13.png)](https://doc.puq.info/uploads/images/gallery/2021-11/TJX2021-11-05-13-13.png)

##### Connection details

After creating the connection, you need to enter the connection details.

- Name
- Description
- URL (link to the API of the WHMCS system. Https: //XXX.XXX.XX/includes/api.php)
- Username (API user **Identifier**)
- Password (API user password **Secret**)
- Step (Number of invoices that will be synced for each sync step)
- Automatic synchronization (It is necessary to check the box for the automatic synchronization of invoices once a day, the synchronization follows all daily WHMCS cron tasks)
- Exchange rate (Specify the exchange rate if the currency is not the same as in the system. Set it to 1 if the currency is the same as in the system)

[![2021-11-05_13-32.png](https://doc.puq.info/uploads/images/gallery/2021-11/scaled-1680-/MS22021-11-05-13-32.png)](https://doc.puq.info/uploads/images/gallery/2021-11/MS22021-11-05-13-32.png)

You must click the **Save button** to save the changes.

# Sync/Full Sync

**Full synchronization** means that all invoices of the selected system will be completely synchronized.  
Synchronization takes place step by step.  
The number of steps depends on the number of invoices in the accounting system and the number of the STEP parameter.

**Sync** means that the missing invoices will be synchronized in the selected system.

[![2021-11-05_13-40.png](https://doc.puq.info/uploads/images/gallery/2021-11/scaled-1680-/YcH2021-11-05-13-40.png)](https://doc.puq.info/uploads/images/gallery/2021-11/YcH2021-11-05-13-40.png)

# Creating an API user in WHMCS

In order to be able to exchange information between the Commitment Forecaster and WHMCS, access to the API must be created.

##### Adding a new API access

1\. Log in as an administrator to the WHMCS system.

```
System Settings -> Administrator Users
```

2\. Add a new user

[![2021-11-05_13-59.png](https://doc.puq.info/uploads/images/gallery/2021-11/scaled-1680-/0id2021-11-05-13-59.png)](https://doc.puq.info/uploads/images/gallery/2021-11/0id2021-11-05-13-59.png)

3\. Move to:

```
System Settings -> Manage API Credentials -> APIQ Roles
```

Create a new role and select only **BILLING -&gt; GETInvoices**

[![2021-11-05_14-03.png](https://doc.puq.info/uploads/images/gallery/2021-11/scaled-1680-/65E2021-11-05-14-03.png)](https://doc.puq.info/uploads/images/gallery/2021-11/65E2021-11-05-14-03.png)

4\. Move to:

```
System Settings -> Manage API Credentials -> API Credentials
```

5\. Create your API credentials [![2021-11-05_14-06.png](https://doc.puq.info/uploads/images/gallery/2021-11/scaled-1680-/Z8Q2021-11-05-14-06.png)](https://doc.puq.info/uploads/images/gallery/2021-11/Z8Q2021-11-05-14-06.png)

[![2021-11-05_14-07.png](https://doc.puq.info/uploads/images/gallery/2021-11/scaled-1680-/BZt2021-11-05-14-07.png)](https://doc.puq.info/uploads/images/gallery/2021-11/BZt2021-11-05-14-07.png)

Select the previously created user and API role

Press the **"Generate"** button

6\. Write the data they need to connect to apiWHMCS Identifier Secret

#####  

##### Access to WHMCS from IP number

Then you should allow access to the IP address of the server with the module installed in the WHMCS system

Move to:

```
System Settings -> General Settings -> Security
```

Add the IP address of the server with the module installed to the **API IP Access Restriction list**

[![2021-11-05_14-23.png](https://doc.puq.info/uploads/images/gallery/2021-11/scaled-1680-/yY62021-11-05-14-23.png)](https://doc.puq.info/uploads/images/gallery/2021-11/yY62021-11-05-14-23.png)

