cancel
Showing results for 
Search instead for 
Did you mean: 
My Areas

Sign in to follow product and topic areas and get a shortcut in this menu

Knowledge base in Visma eAccounting API

Labels
Sort by:
updated by Anour Hannouch VISMA ‎02-10-2019 11:33
Are you receiving a "ForbiddenRequestException - No access to module: api_standard" error message?   Go to “Apps and extensions” under the settings tab, and make sure that the API is activated. Another reason can be that you are trying to login to an account without a valid eAccounting license. Check again what company you are logging into and make sure it is not set to “Default company”.  
View full article
updated by Anour Hannouch VISMA ‎02-10-2019 11:31
A token can become  invalid when its lifecycle has expired or when you change the password (changing password invalidates tokens).
View full article
updated by Anour Hannouch VISMA ‎02-10-2019 11:30
Read about HTTP that the POST request should contain for access tokens
View full article
updated by Anour Hannouch VISMA ‎02-10-2019 11:26
A step-by-step guide how to complete the startup guide in order to resolve  "Error: the startup guide has not been completed" 
View full article
updated by Anour Hannouch VISMA ‎02-10-2019 11:26
If you have several companies available in eAccounting, you will be able to select which company to Authorize for the Auth endpoint. The list of companies is available from a dropdown menu in eAccounting after logging in. If this menu is missing, the Default company setting might be turned on.   After logging in to eAccounting, go to the menu in the top right corner.   Press "Choose default company"     press the blue star (the default company) to remove it as default. And save!
View full article
updated by Anour Hannouch VISMA ‎02-10-2019 11:25
For more information regarding error messages when authenticating, see HERE For more information regarding error messages from the API server, see HERE
View full article
updated by Anour Hannouch VISMA ‎02-10-2019 11:24
When you receive an error code in the API, you should also find a message in the HTTP response. This will inform you as to the general error that has occurred.   When debugging the API request, we recommend using Fiddler.   If you need to contact support, please attach both the HTTP request and the response retrieved from Fiddler.
View full article
updated by Anour Hannouch VISMA ‎02-10-2019 11:22
To be able to use eAccounting via the UI or the API, you will have to activate the company and complete the Startup Wizard.
View full article
updated by Anour Hannouch VISMA ‎02-10-2019 11:20
Watch this tutorial on POSTMAN; a free API client that will help you with testing endpoints.
View full article
updated by Anour Hannouch VISMA ‎02-10-2019 11:20
A description of what you can find and how to use this community.
View full article
updated by Anour Hannouch VISMA ‎02-10-2019 11:19
Relevant documentation and contact to support.
View full article
updated by Anour Hannouch VISMA ‎02-10-2019 11:19
A description of the authentication framework
View full article
updated by Anour Hannouch VISMA ‎02-10-2019 11:18
This post is a rendition of the main DOCUMENTATION .   The eAccounting API exists on a sandbox server ( https://eaccountingapi-sandbox.test.vismaonline.com/v2 ) and also on the  Production server ( https://eaccountingapi.vismaonline.com/v2 ).   To test the API we recommend you to use the Sandbox environment.   To be able to use the API you would need a Client ID, Client Secret, and a Redirect URI. Our API uses the OIDC framework , which in turn uses the OAuth2 protocol, we recommend you to get familiar with these.  OAuth2 supports several “flows” or methods, but as for the eAccounting API, we only allow and support the server-side flow, AKA Authorization code flow.   You can also check our MAIN DOCUMENTATION , here you can also register a sandbox client by yourselves.   The authentication The authentication consists of the following steps: 1. GET an Authorization code: When you have your unique client ID, secret and redirect URI you can construct the following URL:   https://identity-sandbox.test.vismaonline.com/connect/authorize?client_id=<client_id>&redirect_uri=<redirect_uri>&scope=ea:api%20offline_access%20ea:sales&state=<state_string>&response_type=code&prompt=login&acr_values=service:44643EB1-3F76-4C1C-A672-402AE8085934+forceselectcompany:true   <...> the angle brackets indicate where you should enter your unique values.* The example is based on authentication towards the Sandbox environment.* The State could be any random alphanumeric string.*   Visiting the previous URL you will be prompted a Visma login window, after entering your credentials you will be redirected to your redirect URI page with the authorization code in the URL. 2. Use the Authorization code to make a POST request to receive an Access Token: Using the code received in the previous step, we can now make a POST request to the server in order to receive a Token. This POST request should look like this:   HTTP Head POST https://identity-sandbox.test.vismaonline.com/connect/token HTTP/1.1 HTTP Headers Authorization: Basic base64(client_id:client_secret) Content-Type: application/x-www-form-urlencoded;charset=UTF-8 HTTP Body "grant_type=authorization_code&code=<authorization_code>&redirect_uri=<redirect_uri>"   As a response, our server sends a JSON file to the server on which the redirect URI is hosted. This JSON file contains the Token, Refresh Token and expiry time. 3. Use the Token to GET/POST/DELETE resources: To make a request to, an example, GET Accounts Endpoint, the HTTP request should look like this:   HTTP Head GET https://eaccountingapi.vismaonline.com/v2//accounts HTTP/1.1 HTTP Headers Authorization: Bearer <Access Token> Content-Type: application/x-www-form-urlencoded;charset=UTF-8 HTTP Body ….empty... 4. Use Token to GET a Refresh Token: An Access token is only valid for an hour, after that, you will have to get a new Access token, you can do this by going through the procedure we just went through or you can make a request using the refresh token. A request using the refresh token looks like this:   HTTP Head POST https://identity-sandbox.test.vismaonline.com/connect/token HTTP/1.1 HTTP Headers Authorization: Basic base64(client_id:client_secret) Content-Type: application/x-www-form-urlencoded;charset=UTF-8 HTTP Body "grant_type=refresh_token&refresh_token=<refresh_token>" For more technical information visit the MAIN DOCUMENTATION .
View full article
updated by Anour Hannouch VISMA ‎02-10-2019 11:09
Some of our customers have experienced that the customizedFields property for customers and contacts endpoints is not working.   If you experience this as well, please contact us and we will make sure this feature is enabled properly for your company.   Contact information: API_Advisor@visma.com
View full article
updated by Anour Hannouch VISMA ‎02-10-2019 11:07
As per today, there is no community area for the Advisor software. If you have any questions regarding the Advisor API, please contact the support at API_Advisor@visma.com For documentation about the API visit the Advisor API site
View full article
updated by Anour Hannouch VISMA ‎20-09-2019 11:08
Where to register bugs and requests
View full article
by Anour Hannouch VISMA
oData functionality is used to modify the size and objects you receive in your response JSON, it could be to reduce the amount of unused information or to increase speed of the response.   NOTE!  The oData functionality is only available on v2 of the API. For more information, check our main DOCUMENTATION , there is also a lot of resources on the internet about oData.   According to the documentation found HERE , the filtering possibilities are the following for the eAccounting API: Pagination Filtering Selecting Sorting Combine several oData functions   Pagination Pagination allows you to change the allowed page size for a JSON response, the standard is 50 objects.   The suffix that you need to use for this function is: endpoint ? $pagesize=<integer>   An example using pagination when making a GET to the Accounts endpoint on the Sandbox environment with a page size of 1000: https://eaccountingapi-sandbox.test.vismaonline.com/v2/accounts?$pagesize=1000   Filtering Filtering allows you to filter by the information that is in each object in a JSON file.  As an example, if you make a GET to the Accounts endpoint, you will receive all the accounts. But if you are interested in receiving only the ones that start with a specific number, then filtering is for you.   There are several kinds of queries you could make here, here are a few examples. Suffixes that you can use:: endpoint ? $filter=<property> condition <value> Example (“gt” is sjort for “greater than”): https://eaccountingapi-sandbox.test.vismaonline.com/v2/accounts?$filter= Number gt 1337   endpoint ? $filter=condition(<property>, <value>) Example: https://eaccountingapi-sandbox.test.vismaonline.com/v2/accounts?$filter=startswith(Number, ‘13’)   endpoint ? $filter=condition (<property>) condition <value> Example: https://eaccountingapi-sandbox.test.vismaonline.com/v2/accounts?$filter=length(Number) gt 4   Combined queries: endpoint ? $filter=<property> condition <value> and/or <property> condition <value> Example: https://eaccountingapi-sandbox.test.vismaonline.com/v2/accounts?$filter= Number gt 1337 AND Number lt 2000 You can find the available conditions on our DOCUMENTATION page or on the internet.   Selecting The Select function allows you to reduce the size of the JSON file you receive by only requesting the specific properties.   The suffix that you need to use for this function is: endpoint ? $select=<property1>, <property2>, <property3>, <property4> ….   An example using the Select function for receiving only the Name and Number of the accounts when making a GET to the Accounts endpoint on the Sandbox environment: https://eaccountingapi-sandbox.test.vismaonline.com/v2/accounts?$select=Name, Number Sorting The sorting function allows you to sort the Objects in the JSON response by different properties.   The suffix that you need to use is: endpoint? $orderby=<property>   An example, sorting Accounts by Numbers: https://eaccountingapi-sandbox.test.vismaonline.com/v2/accounts?$orderby=Number   Combine several oData functions It is possible to combine several of the above-mentioned oData functions in the same request. You can do this by adding an “&” between the functions.   Example: https://eaccountingapi-sandbox.test.vismaonline.com/v2/accounts?$filter= Number gt 2000 AND Number lt 3000&$orderby=Number
View full article
updated by Anour Hannouch VISMA ‎03-07-2019 11:12
Important Information We have implemented a new Identity Server that provides endpoints for authorization and authentication. This Identity Server will replace our existing ID/Auth Servers. We will shut down the ID/Auth servers in the production environment (https://id.vismaonline.com   and   https://auth.vismaonline.com) by the   30th of September 2018. Until then, please make sure to update your solutions that go towards these endpoints as soon as possible. We have updated our documentation when it comes to authorization and authentication towards the new Identity Server. When it comes to the sandbox environment we will do the same changes, but the shutdown date is the   1st of February 2018. If you have not implemented this change in your solutions, your existing test applications will stop working. The new Identity Server is used for: Authorize and Authenticate new customers. Receive Access Tokens, Identity Tokens and Refresh Tokens. The new Identity Server is located at another URL, in both Sandbox Environment and Production Environment.   Endpoints   Sandbox Environment: Authorization Endpoint:   https://identity-sandbox.test.vismaonline.com/connect/authorize. Token Endpoint:   https://identity-sandbox.test.vismaonline.com/connect/token. Production Environment: Authorization Endpoint:   https://identity.vismaonline.com/connect/authorize. Token Endpoint:   https://identity.vismaonline.com/connect/token.   New Required Features     Authorization and Token Requests   Token requests towards the new Identity Server must always be in Content-Type: x-www-form-urlencoded.   Scopes   We have changed the namings of the scopes, and two additional mandatory scopes are added. Below is a list of mandatory and selectable scopes: Mandatory scopes offline_access ea%3Aapi Selectable scopes ea%3Asales ea%3Asales_readonly ea%3Apurchase ea%3Apurchase_readonly ea%3Aaccounting ea%3Aaccounting_readonly   Tokens   When requesting tokens, the Refresh Tokens will be always be updated. It is really important to save both Access Token and Refresh Token, the same Refresh Token cannot be used more than once.   Force New Login   If you want the user to log in again (even if you're already logged in) to authenticate multiple times in different companies, for example. Then use prompt=login in the querystring when you ask for authentication code against the auhorize endpoint.   FAQ   Why does Visma change Identity Server? More secure and stronger algorithms of token signing with certificates instead of symmetric keys. The new Identity Server follows the OAuth 2.0 standard and the OpenID Connect protocol. Simplifies future integrations and single-sign-on against other Visma products. Ability to access more user and company information in new claims. What do you need to do? Change URL to authorize-endpoint:   https://identity.vismaonline.com/connect/authorize   in production and   https://identity-sandbox.test.vismaonline.com/connect/authorize   in the sandbox environment. Change URL to token-endpoint:   https://identity.vismaonline.com/connect/token   in production and   https://identity-sandbox.test.vismaonline.com/connect/token   in the sandbox environment. Provide the two new mandatory scopes “offline_access” and “ea:api” Prefix existing scopes with "ea:" If you extract the access token yourself and use something in it, there are some minor changes in some claims: The value in "sub" is now UserId, not the e-mail address as before and the e-mail address is found in a new claim called " email ". Previous claim "VismaCustomerId" has renamed "customer_id" and all scopes are prefixed with "ea:" except "offline_access" which is a global scope. When can I make the change? The API already supports tokens from the new Identity Server, so it's free to switch to the new one, the sooner the better. Do I need to contact Visma before I change? No, your clients are already registered in the new Identity Server with the same client id and client secret as you have in the current. What happens when I switched over to the new Identity Server? All applications need to authenticate again and then everything is as before. Due to Visma's security policy, it may be necessary to authenticate again against the Identity Server if the authenticated user changes the password or lock their Visma Online account. What happens if I do nothing? From the 30th of September 2018 in the production environment, the applications will not be able to request new access tokens (HTTP status 400) and therefore not able to use the eAccounting API. If you have any questions about this, don’t hesitate to contact us
View full article
by Anour Hannouch VISMA
Endpoint: PUT v2/fiscalyears/openingbalances   1. Usability The purpose of this endpoint is to allow the user to update its opening balances on the first fiscal year through the API using a simple collection of account numbers and their new opening balances. Below you can see the Opening Balance section as you would like to update in eAccounting. Opening Balance in eAccounting In order to achieve the same behavior through the API, the following payload should be used: Opening Balance in API As you can see the account numbers which we wanted to update in the web application can be found in the JSON, next to its balance. The new balances represent the new total amounts that we want to have on the specific accounts, which do not amount or diminish the previous ones but instead replacing them. You can also specify some or all the other accounts in the fiscal year, as long as the total amount balances or you set the balance as it currently is. The endpoint by default supports using inactive accounts in the JSON by automatically activating them. If you do not wish to allow this, set the parameter   enableInactiveAccounts   to false in which case validation will be thrown. Scenario 1 We have the following accounts with their current balances: account 1010 ; opening balance: 10 account 1229 ; opening balance: -10 all the other account have 0 opening balances We would like to update the balance on account 1010 to 20. In order to successfully accomplish that, we need to set up a new amount on another account based on the new difference. In this case we will use account 1229 to counter the new added amount. The required JSON will be : Scenario 1 Note: You can also use other accounts as long as the amounts balance or either their current amount is used. Scenario 2 We have the following accounts with their current balances: account 1010 ; opening balance: 10 account 1229 ; opening balance: 20 account 1210 ; opening balance: 30 account 1470; opening balance: -60 all the other accounts have 0 opening balances We would like to update the opening balance of another account, for example, 1220 to -20. Below is an example of a way of doing it: At a first glance, the amounts in the JSON do not balance. -20 + 50 = 30. But below you can observe all the accounts with their updated amounts: account 1010 ; opening balance: 10 account 1229 ; opening balance: 20 account 1210 ; opening balance: 50 (the account we have used to counterbalance the new amount) account 1470; opening balance: -60 account 1220; opening balance: -20 (the updated amount which we've entered) all the other accounts have 0 opening balances As a result 10 + 20 + 50 - 60 - 20 = 0. Success!   2. Quick tips and sum up about functionality since the opening balance always needs to sum up to 0, a minimum of 2 pairs of account - opening balance needs to be used. opening balance can only be updated on the first fiscal year, which depending on your case, might not be the current fiscal year. the endpoint supports the use of a minimum of 2 accounts up to the total number of accounts in the first fiscal year. Also, the use of inactive accounts is possible through the specific parameter, which will automatically activate it. the endpoint works by replacing the previous amounts, not by adding or subtracting to them. using the same amount on an account as it currently holds is possible, though it will not be updated. the whole chart of accounts on the fiscal year can be used in the JSON. This might be useful when complex amounts and calculations are required if validation is thrown stating that your new amounts do not balance, although the amounts in your JSON body do (example 1010: 20 ; 1020 : -20), please check the amounts currently hold on other accounts in the fiscal year. A good example is Scenario 2.
View full article
by Anour Hannouch VISMA
There are quite a few ways to pay invoices, so this endpoint deserves a cheat sheet. This FAQ does not cover all possible scenarios, but it should cover the most common ones.   Domestic Customer Invoice Payments   Scenario 1   Domestic debit invoice, full payment, no additions. Paid towards a cheque bank account. JSON data Voucher in eAccounting   Scenario 2   Domestic credit invoice, full payment, no additions. Payed towards cheque bank account. JSON data Voucher in eAccounting   Scenario 3   Domestic debit invoice, full payment with a factoring fee of 30 SEK. Paid towards a cheque bank account. We use 6064 as factoring account in this case, it is a commonly used account for this scenario in Sweden. Factoring fee is stated in the FactoringFeeAmount property and excluded from the PaymentAmount, as shown below. In the voucher, that amount is withdrawn from the cheque account row. JSON data Voucher in eAccounting   Scenario 4   Domestic debit invoice, partial payment, no additions. Paid towards a cheque bank account. JSON data Voucher in eAccounting   Scenario 5   Domestic debit invoice, full payment with 1 SEK in roundings, no additions. Paid towards a cheque bank account. JSON data Voucher in eAccounting   Non Domestic Customer Invoice Payments   Scenario 1   Non-domestic debit invoice in EUR currency with SEK as company base currency, full payment with no additions. Paid towards a cheque bank account. In this case, we receive exactly 1000 SEK in the bank when the currency is converted, which means that no currency profit/loss is registered by eAccounting. Quite rare scenario, unless the payment date is same as invoice date. JSON data Voucher in eAccounting   Scenario 2   Non-domestic debit invoice in EUR currency with SEK as company base currency, full payment, with 10 SEK bank fee. Paid towards a cheque bank account. In this case, we receive a bit less money in SEK, due to currency loss. Note that DomesticPaymentAmount is payment amount in SEK with withdrawal for bank fee (10 SEK) and currency loss (8 SEK). JSON data Voucher in eAccounting   Supplier Invoice Payments In general - Supplier invoice payments are the same as customer invoice payments. Some differences exist though:   FactoringFeeAmount   &   FactoringFeeAccountNumber   is not allowed in Supplier Invoice payments. Debit invoice amounts are specified in positive, credit invoice amounts are specified in negative.
View full article
Top Contributors