The Atria Kaseya BMS integration takes billing data from Atria and updates the corresponding Recurring Services contract in Kaseya. Once the contracts are updated, Kaseya can generate accurate invoices for customers.
This document will help you understand how the integration works and what you need to do to get it up and running.
Changes to provisioning occur in Atria, these are collated and stored in the database, tracking the change made and who made the change.
For example:
On a daily basis, Service changes are used to generate billing data for the current Billing Period. Non-billable data is filtered out based on pre-configured billing rules
Depending on the configured schedule, billing data is used to update Kaseya. The Contract quantities in Kaseya are updated to reflect the quantities returned from the Atria API.
A Job in Atria is a recurring task, this will perform the Kaseya update on a scheduled basis.
1. Navigate to Configuration > Jobs
2. Select Add a new Job to show the Job form:
Give a meaningful name – this will be used to identify the job. e.g "Transfer Billing Data to kaseya BMS on 27th of each month"
Select “Kaseya BMS Billing” from the drop down list of available Tasks.
To start with, Select Verbose, this will give increased logging – you can adjust this later.
This determines the frequency of execution. The expression “0 22 26 * *” means that the process will run automatically at 10pm on the 26 th of the month. More information on CRON expressions is available here https://support.automate101.com/portal/en/kb/articles/cron-expressions-in-atria
This contains the parameters for your scheduled task, each parameter can have a default value. Parameters are stored in JSON format https://en.wikipedia.org/wiki/JSON
Name | Purpose | Default Value |
ApiUrl | this is the URL for connecting to Kaseya BMS. this will typically be the same as the URL you use to access the Kaseya BMS User interface. | "" |
ContractType | Specify the contract type you want Atria to update. e.g. "Recurring Services" | "" |
BillingPeriod | Determines which billing period to use for the transfer from Atria. “Previous” – the previous closed billing period. “Current” – the current billing period “YYYY-MM-DD” – specify a date, the billing period will be selected based on the date. | “Current” |
CustomersFilter | Will only process records for the specified customers – based on Atria customer code, if blank or unspecified – all customers will be processed. | “” |
SKUFieldMatch | Determines the field used for mapping the Atria SKU with a Kaseya product/contract line. This can be set to: "ServiceName" - the Service name field in Kaseya is used to identify the correct service. "Description" - The description field is used to identify the correct service. "SKUDescription" - this expects the SKU field to be supplied as the parameter at the start of the product description. e.g. if the SKU in Atria was MB100, then the description field would be "MB100: this is the description of the MB100 product" | "ServiceName" |
Example Parameters
Value | Description |
Username | The API User configured in Kaseya |
Password | The corresponding password for the API User |
Tenant | A key to identify the Kaseya tenant. |
To create the Secrets parameter set – copy below, then replace the XXXX below with your values.
Press Save to create the Job
Manually run the job – the job may take a few moments to start, when the job has completed a link to the Log will be shown in the “Last Run Result” column. Click on this to view the runs of the job. From here you can select the run to see the detailed log entries.
Each line item in the log has a code, and a logging level.
Errors are likely to be technical issues – for example, if an API is unavailable this will result in an error and the process will end without completion.
Warnings are likely to need some intervention in order to resolve and are likely to be data related – e.g. Could not find something, a reference field is missing etc.
Verbose and Info provide information, but should not require any action.
In order to make sure the integration is successful, some work may need to be done to configure the two systems to link records correctly. Depending on how you operate today, this could be simple, or it may require more work to define products.
Ensure all Atria Customers are correctly mapped to the Kaseya Account Code.
For information on where to configure SKUs in Atria – read the Configuring Product SKUs in this guide https://support.automate101.com/portal/en/kb/articles/billing-setup-user-guide
Setup Billing Rules to mark all non-important items as non-billable – this will stop them from being transitioned to invoices and potentially creating “Noise” in the log files.
If you have completed the Setup Product Mapping in Atria, it may be adequate for you to just exclude all items which do not have a SKU assigned.
For information on billing rules, there is more information in this KB https://support.automate101.com/portal/en/kb/articles/billing-rule-engine-user-guide
On 25 th of month
On 26 th of month
Kaseya Billing process executes and updates contracts in Kaseya, processing the Billing Period that has just completed.
Review and Resolve Results:
ID | Task/Action |
1 | Export Log Entries
|
2 | Review Errors
|
3 | Review Warn level entries and action problems as below
|
4 | Review Informational Changes
|
5 |
|
Guidance for Resolving Data relationship issues between Kaseya and Atria. All possible codes are listed at the bottom of this article.
ID | Occurs When | Log Level | Resolution |
KS05 | A customer does not have a Billing Identifier | Warning | Locate the Account in Kaseya, copy the Account Code. Locate
Customer in Atria, paste the Account Code into the Billing Identifier field and
Save. |
KS06 | Customer Does not have a Recurring Service Contract in Kaseya that contains the service in Atria. | Warning | Check that the Account in Kaseya has a "Recurring Services" Contract configured and that a service line exists for the service specified. |
KS23 | SKU Missing in Atria | Warning | If you do not want this data in Kaseya, you can ignore or filter using an Atria billing rule. If this needs to be invoiced, ensure a service exists in Kaseya and that the SKU code is stored against the Service in Atria. |
KS14 | Service Does not exist in Kaseya | Warning | This means that the Service referenced din the SKU does not match anything in the Kaseya Service catalog. Check the Service Identifier stored in Atria or add the service to Kaseya if missing. |
KS15 | No record found in a billing period | Warning | This is a warning - it could mean that the billing process has not executed. Check the billing report in Atria for the specified period. |
Use the following features to ease the process.
1. The arrow buttons will order the results by error code, this will mean you can go through and fix all similar issues in one go – e.g. for customer identifier issues, order by Code, then go through and fix all missing Billing Identifier problems.
2. Similarly, you can order by Log Type, then scroll down to the warning level logs and review.
3. The search can be used to filter, the Code and Message fields are indexed, for example, typing in CW04 will show all CW04 lines. Or typing a product code may find a log entry.
4. Use the download button to download the data into spreadsheet format – then use Excel or similar to filter/review the data.
The Following table lists the possible codes returned from the Kaseya integration process.
Code | When | Log Level | Message |
KS01 | Process of updating billing items starts | Info | Billing Process Started: For Billing Period {date} |
KS02 | When a request from Atria to communicate with Kaseya fails | Error | Cannot connect to Kaseya. The error occurred is: {errorMessage} |
KS03 | Atria fails to retrieve billing information or an incorrect billing end period date is detected | Error | Failed to connect to Atria: Error reported was : {ErrorMessage} |
KS04 | No changes between Atria and Kaseya contract line quantity was found | Verbose | No changes made in quantity for Product {Product Name} - no update to contract required for Customer {Customer Name} |
KS05 | When Account Exists in Kaseya but no Contract for Account is found | Warning | Customer Contract for {Customer Name - Customer Billing ID} ({Contract Type}) does not exist in Kaseya portal. |
KS06 | When no service line is found for a contract | Warning | Product [0] not linked to a contract in Kaseya database for Customer Customer {11} |
KS07 | When contract line is found and updated successfully | Info | Product {Product Name} quantity updated from {Previous Quantity} to {Latest Quantity} for Customer {Customer Name} |
KS08 | When the request from Atria to update contract line quantity fails | Error | Failed to update service line quantity for Customer {Customer Name}. The error is: {Error Message} |
KS09 | There is a customer in Atria but it doesn't have any billing ID defined in Atria. | Warning | {CustomerCode} CompanyID Missing Unable to process records for Atria Customer {CustomerName} – Please add CompanyID from Kaseya into Billing Identifer field on Customer within Atria. |
KS10 | Validating billing period fails | Error | Incorrect billing period date or format recognized. |
KS11 | A removed line item in Atria is detected and process updates its quantity to zero in Kaseya portal | Warning | {CustomerName} Line located for {LineDescription} with Product ID {Sku} is been removed in the selected billing period. The Quantity is updated from {Quantity} to 0.00") |
KS12 | Task Parameter Validation | Error | Invalid contract type. Please check contract type in task parameters. |
KS13 | Process fails to desterilize a Json object retrieved from Kaseya | Error | Failed to Deserialize Job Task Parameters: Error reported was: {e.Message} |
KS14 | There is a billing item with SKU defined in Atria but no such a service is defined in Kaseya portal using SKUMatchField in Job Parameters | Error | Service Missing in Kaseya. Please check Kaseya portal to see if a Service with '{jobParameters.SkuFieldMatch}': '{item.Sku}' exists and is active. |
KS15 | A period is selected that doesn't have any billing item record. (Needs code update to reflect the following msg: No records found in Atria for billing period) | Warning | No invoice is received for the billing period: {invoiceDate} |
KS16 | When at least one of the secret values is null | Error | Failed to retrieve Kaseya secrets. Error occurred is: {e.Message} |
KS17 | Process of generating token to access Kaseya API fails | Error | Token could not be found |
KS18 | Process of Reducing deprovisioned items to zero starts | Verbose | Start Processing Deprovisioned Customers |
KS19 | Process of Reducing deprovisioned items to zero finishes | Verbose | Processing Deprovisioned Customers Completed |
KS20 | When API Url is empty | Info | Failed to Retrieve Job Task Parameters: Error reported was: api url is not available |
KS21 | When at least one of the Kaseya secrets has null value | Error | Failed to validate Kaseya secrets. |
KS22 | No Account is found in Kaseya that matches with the Billing ID of the customer in Atria | Error | Atria Customer for Account Code '{Billing ID}' is not defined as a valid Kaseya Account |
KS23 | SKU Missing in Atria : {CustomerName} : Skipped Line {LineDescription} for Customer {CustomerName} as no SKU was provided | Warning | {line.CustomerName} |
KS24 | The whole process of updating contract lines ends | Info | Billing Process Completed with status {Result} |