How to build your own integration
Below is the information required to build an integration from your ERP system into Konsolidator.
This guide is primarily for very technical finance professionals, programmers, and ERP consultants.
How to authenticate
There are two ways to authenticate:
- Bearer token
- API key authentication.
1. type: Bearer token authentication
In order to connect to the API, you need to have a valid token from our OAuth server. This token can be obtained by sending a POST message to the below link with the following information.
URL
https://konsolidatorsignin.b2clogin.com/konsolidatorsignin.onmicrosoft.com/B2C_1_ropc/oauth2/v2.0/token
Header
Content-Type:application/x-www-form-urlencoded
Body
grant_type:password
client_id:20e20379-2661-4066-b297-90c2e089e899
scope:https://konsolidatorsignin.onmicrosoft.com/1c72d99d-de80-416c-94d0-f84300b7d77e/User.Read
username:<username for login to Konsolidator>
password:<password for the given Konsolidator User>
Note: Only substitute the values above in green with the actual username and password. The actual value for grant type is the word password.
If the user is authenticated correctly, a JSON document will be returned. The information from this document should be used for connecting to the API. The JSON document contains three parts.
- Access_token: this is the authentication and should be passed to the API.
- Expires_in: the number of seconds before this token expires and a new token should be acquired.
- Token_type: the type of token. This should also be passed into the API for access.
The call to the API should add the following to the header:
Authorization:<Token_type> <access_token>
Note: There is a space between the <Token type> and the <access token>
2. type: API key authentication
An API key authentication requires an “x-api-key” header to be added to request. Note the “Authorization” header should be skipped.
Header example:
x-api-key:<api_key>
Uploading data
The service offered by the Upload API is an upload of trial balances. The API is REST compliant and is available from this base URL:
https://api.konsolidator.com/v2/upload-records
Data can be uploaded by issuing a POST to the base URL containing:
Header
Content-Type:application/json
Authorization:Bearer [<token>]
The [token] is retrieved from the authentication step.
Body
[
{
"companyShortName": "string",
"companyLegalName": "string",
"source": "string",
"year": 0,
"month": 0,
"accountCode": "string",
"accountName": "string",
"dimensionCode": "string",
"dimension": "string",
"dimensions": [
{
"dimensionsGroup": "string",
"dimensionCode": "string"
}
],
"amount": 0,
"currencyCode": "string",
"accountType": "string",
"structureName": "string",
"counterPartyShortName": "string"
}
]
Example
[
{
"companyShortName": "DK01",
"companyLegalName": "Mountain A/S",
"source": "Actual",
"year": 2022,
"month": 2,
"accountCode": "1130",
"AccountName": "Revenue",
"dimensionCode": "100",
"dimension": "Biking",
"dimensions": [
{
"dimensionsGroup": "Product",
"dimensionCode": "10"
}
],
"amount": -1000.00,
"currencyCode": "EUR",
"accountType": "P/L",
"structureName": "Default",
"counterPartyShortName": "US01"
},
{
"companyShortName": "CH01",
"companyLegalName": "Matterhorn",
"source": "Actual",
"year": 2022,
"month": 2,
"accountCode": "1130",
"AccountName": "Revenue",
"dimensionCode": "",
"dimension": "Biking",
"dimensions": [
{
"dimensionsGroup": "Product",
"dimensionCode": "10"
}
],
"amount": 244965.21,
"currencyCode": "CHF",
"accountType": "P/L",
"structureName": "Default",
"counterPartyShortName": ""
}
]
Field explanation
| Field name | Field description | Required |
| CompanyShortName | The short name used in Group Structure in Konsolidator® to identify the company which must be minimum of two digits | Yes |
| CopmanyLegalName | The legal name of the company used in Group Structure in Konsolidator® | No |
| Source | The name of the source inside Konsolidator®, defaults to Actual | Yes |
| Year | The year for the given period which must be four digits | Yes |
| Month | The month for the given period | Yes |
| AccountCode | The account code from the ERP system | Yes |
| AccountName | The account name from the ERP system | No |
| DimensionCode | The dimension code from Konsolidator® | No |
| Dimension | Name for the dimension from Konsolidator® | No |
| Amount | YTD value for the upload | Yes |
| AccountType | The account type of the upload must be either P/L or B/S | No |
| StructureName | The Company structure from within Konsolidator® to upload to | No |
| CounterPartyShortName | The CompanyShortName of the counterparty from inside Konsolidator® | No |
API documentation
For further reading, our full API documentation can always be found at Swagger UI - INDSÆT LINK