# Integration with Billmanager 6 Hosting & Cloud
## Installation and Update

> For setting up the integration on the Billmanager 6 Hosting & Cloud side, you will need an employee with full administrator rights in the billing system and SSH access to the server console.

<br>

To install the Swarmica module, download and unpack the archive on the server with Billmanager 6 Hosting & Cloud installed:

```txt
wget https://support.swarmica.com/attachments/L/I/LI3IZ0MMJ84Mku4K_a/swarmica_billmanager.v1.3.10.zip
unzip swarmica_billmanager.v1.3.10.zip
```

Then run the `install.sh` command:

```txt
chmod +x install.sh
./install.sh
```

Changes will be applied after rebooting the billing system (the installation script will offer to do this automatically).

Alternatively, you can download and install a package for one of the [supported operating systems](https://wiki.astralinux.ru/ispsystem/billmanager-hosting-cloud/trebovaniya-k-serveru-339503824.html):

DEB: [https://support.swarmica.com/attachments/e/Z/eZ0Rgk0pw7OiDxUS_a/swarmica-billmanager-1.v1.3.10_amd64.deb](https://support.swarmica.com/attachments/e/Z/eZ0Rgk0pw7OiDxUS_a/swarmica-billmanager-1.v1.3.10_amd64.deb)

RPM: [https://support.swarmica.com/attachments/R/r/RroG_UyR7n6h9r9l_a/swarmica-billmanager-v1.3.10-302.x86_64.rpm](https://support.swarmica.com/attachments/R/r/RroG_UyR7n6h9r9l_a/swarmica-billmanager-v1.3.10-302.x86_64.rpm)

When initially installing, set up the integration in the web interface.

## Configuration on the Swarmica Side

### On the Server

1. Add the following flag to `/root/swarmica/.env` in FEATURES: `billmanager`
2. Execute the command 

```bash
docker compose down && docker compose up -d
```

### In the Interface

1. In the **Settings > Channels > Billmanager** section, create a new channel:

<img src="https://support.swarmica.com/attachments/0/G/0G7gE01Eliw7VRSS_a/image.png">

**Name** - arbitrary name for the channel to receive requests.

**Billing URL** - your unique URL for using Billmanager 6 Hosting & Cloud.

**Secret Key** - this is an arbitrary sequence of characters that will be responsible for Swarmica authorization on the Billmanager 6 Hosting & Cloud side. It can be generated automatically. If you change the secret key later, don't forget to update it on the Billmanager side as well.

To generate the key, go to the settings of the created channel by clicking on it, and then on the icon at the end of the Secret Key line:

<img src="https://support.swarmica.com/attachments/t/o/to1dDvr5kFBlLTgo_a/image.png">

Activate the **Enabled** switch to activate the integration.

Copy the secret key and channel UID from the browser address bar - this data will be needed for settings on the Billmanager side:

<img src="https://support.swarmica.com/attachments/5/I/5IH76czCSTcEIEKu_a/image.png">

2. In the **Settings > API** and integrations section, create a new API key and copy its code - it will also be needed for settings on the Billmanager side.

<img src="https://support.swarmica.com/attachments/h/n/hny4U6UxCjBEEfmP_a/image.png">

## Settings on the Billmanager 6 Hosting & Cloud Side

In the **Integration > Swarmica** section in the side menu, fill out the form:

<img src="https://support.swarmica.com/attachments/3/G/3GZgrRC3exQT_Czg_a/Screenshot_2025-02-01_at_12.16.15.png">

**URL** - your unique URL for logging into Swarmica along with the protocol (http:// or https://).

**API Token** - code obtained on the Swarmica side in the API and integrations section.

**UID of the Billmanager Channel in Swarmica** - UID from the address bar on the **Settings > Channels > Billmanager** page:

<img src="https://support.swarmica.com/attachments/k/1/k1ivdjwtRsEEToUO_a/image.png">

**Secret Key** - the key you generated in the Billmanager channel settings on the Swarmica side.

**Billing User ID** - ID of the privileged user on whose behalf service comments will be added. Administrator role required.

**MySQL TLS Connection** - if you have a separate MySQL server for Billmanager that requires TLS for connection - change this parameter to one of false, true, preferred, skip-verify depending on your MySQL server settings.

To enable integration, check the **Synchronization with Swarmica** box.

# Creating and Synchronizing Internal Users

To correctly create agency roles with appropriate rights, you need to:

1. Create an employee with the employee role on the Billmanager side
2. Grant him the appropriate rights to process tickets
3. The user will be synchronized with Swarmica - check and assign the desired role (Manager or Agent) in Swarmica