How to create an analysis integration
In this guide, we’ll have a look at how to create a solid analysis integration with Dinero, such as a dashboard to present data, helping to create and fulfill a budget or maybe an integration that does deeper analysis of financial data.
It is actually quite simple.
For these purposes the most obvious thing to do is to get all the entries in the books for an organization. First we need to get all entries for the period that we’re interested in and then store them on our own end. After that we can subscribe to the entries webhook to be notified whenever a new entry is added to get them in real time.
Note that the webhook is only available for one-to-many integrations authorized through Visma Connect. If you have a personal integration or legacy api-key integration, you cannot use webhooks.
How to do the initial sync
First you need to get a list of entries that have happened up until this point. Most likely you want the current accounting year to start, you might also want to get the previous accounting year's entries in case you want to handle comparisons between the two. This is alright, but all this data should be stored on your end once you’ve fetched it.
From and to date should be added as query parameters, for instance, if I wanted to ask for all entries in the 2024 accounting year, including the primo entries, I would use the following parameters: …/v1/organizationId/entries?fromDate=2024-01-01&toDate=2024-12-31&includePrimo=true
From here, you can either get changes that have happened since your last synchronization, for instance once every day you can ask for the new changes. The better option, if you have a Visma Connect client, is to subscribe to our webhook to get new entries in real time.
The date range here is not the date of the entry but the date it was added. If I added an entry today, dated to the 1st of january 2024, it would be returned if I asked for entries added today.
How to subscribe to the webhook
First you need to ask for availability, as of writing the only supported webhook is the entries one, but more might be available in the future.
Then you can subscribe to the webhook via our subscription endpoint.
Simple as that. You now get entries in real time.
Your own service fee
If you charge for your service, say once a month, you can also automate this booking. This is simply done via our purchase voucher, which is quite intuitive.
You simply fill out any applicable fields, usually a cash purchase since it’s withdrawn at the same time as the date on the invoice from you, and book it into the Software account, 7320, with the amount charged. Remember to upload a file as before, and book this once it’s been sent over. This account assumes you charge Danish VAT on your service.
And with that you’re done. Congratulations, you now have all the financial data needed to create your dashboard or analysis.