My Products
Help
Anonymous
Not applicable

Visma.NET API maximum date present in Endpoint: journaltransaction

by Anonymous

Hello my data-loving comrades!

 

At our company we assist customers in doing their business administration through Visma.Net Financials. Lately we've been using the API more-and-more to create dashboarding and insights which are helpful both to us and our customers. 

 

My problem: 

We control approximately 1000+ customers in which we would like to check when their latest booking was done to filter which customer require additional attention or help. We would like to base this of JournalTransactionv2 in which we would only like to get the first row which has the latest date available in the dataset.

 

the issue

- Journaltransaction consists of quite big datasets if I were to get them for all customers first. It doesn't sound efficient to acquire the data of that many if I only need 1 row containing the maximum transaction date present. Does anyone have an idea how to acquire the latest journalentry present in the customers administration? 

 

So far I've got a loop working which is able to acquire the data needed. Unfortunately, not all customers are using their business administration daily because we maintain them. 

 

The result I wish for:

- Customer Name and code (I could use the CONTEXT endpoint for this) 

- Column with the highest Transaction Datetime present  (so far I've come up with using Journaltransactions for this)

 

I've got everything working for the basics, but I want to be smart about this before retrieving lots of data I don't need. Any suggestions?

 

Thank you for reading and time invested. 

 

Kind regards,

 

Wouter

 

3 REPLIES 3

by Magnus Johnsen (Updated ‎11-06-2021 11:57 by Magnus Johnsen VISMA )

Hi,

Depending on the type of transactions you are looking for there might be some webhooks you are interested in, for example:

  • salesorder_changed
  • purchaseorder_changed
  • arinvoice_changed

You can read about how to set this up here:

Visma.net ERP API Webhooks Setup API & ERP UI (Event - Subscription - Notification)

 

If you want to use JournalTransactions, we would recommend that you check the endpoint with the "LastModifiedDateTime" & "LastModifiedDateTimeCondition", where you get the result since the last time you checked:

 

Update:

In JournalTransactions/V2, there is no need to specify the condition, it is set ">=" by default, the usage with the condition still applies to other endpoints. 

 

Example: GET  v2/journalTransactions?LastModifiedDateTime=2021-06-10

 

This would return only the transactions that have been modified since 2021-06-10.

 

Parameter usage:

 

  • LastModifiedDateTime=time

As of today Filtering Parameters does not accept certain characters such as W-Z

These are the formats for Filtering

*2001-01-01

*2001-01-01 13:13:13

*2001-01-01 13:13:13.133

  • LastModifiedDateTimeCondition=Operator

Supported comparative operators for LastModifiedDateTime Conditions on filtering 

> - Greater than

< - Less than

<= - Less than or equal to

>= - Greater than or equal to

 

Anonymous
Not applicable

by Anonymous

Hi Magnus, 

Thank you so much for your response on this topic. I will have a look at the desired webhook. The main purpose is to monitor usage of VismaNET. So the kind of journalentry doesn't really matter, only the latest activity in comparison to current date. 

So I want to know what their last booking was in comparison to today. In combination with a journal entry, a webhook might suffice. Is it possible to sort the rows? It would make it possible to just sort on DATE descending while retrieving only one row necessary per customer :). 

Accepted solution
Magnus Johnsen
VISMA

by Magnus Johnsen

Hi,

As of now, it is not possible to change the sort order, it is returning the dataset in ascending order.

I suppose what you could do is to

  • Get the transactions that have been modified since your last request with a page size of 1
  • Check the totalCount in the metaData returned
    • If the count is one, this is the only document that has changed and nothing else would be needed
    • If it is higher than one, request the last page and use that date

Then again, if the only need that you have is to check if they have had any new transactions since the last time you checked, you could always just check the endpoint everyday and update the datetime parameter, if the returned set is not empty they have posted to the journal.