Hi, I am attempting to fetch AR/AP, "Reskontro", for suppliers and customers. I have arrived at a possible solution, but I believe there must be a simpler way, so if someone has done it I would appreciate some feedback/comments. I need to find the remaining balance on all customer/supplier accounts on 31.12. Current solution: - Fetch from "v1/supplierDocument"(or customer) *supplier endpoint has no date filtering of sorts, so I fetch all supplier documents. - This means paging is a must, and I end up fetching thousands of records. - Then I filter them based on a logic with "closedFinancialPeriod" and "financialPeriod" - Since the response is "date-independent" and not point in time etc, the balance I get returned is wrong for invoices which are paid in intervals/some in 2022 and some in 2023. Example; an invoice from 04.2022, paid monthly for 12 months, is done in 03.2023. Which means at 31.12 there should be a remainder balance, but the endpoint returns balance as 0 (because it is paid of at the time of the api request). In order to figure out the remaining balance at 31.12 I have to fetch from "v1/supplierPayment". - This means an api call for each invoice in order to figure out if there was a remaining balance/calculate it. In conclusion I end up with a lot of api-calls. Non working attempts/endpoints: - "customerinvoices?status=Open" (or supplierinvoices) -> with or without financialPeriod filter. The problem is it checks the current status of invoices, not what they were at year end or sepcified financialPeriod. The customerInvoices endpoint also only contains invoices, so creditNotes are not returned even though there is a documentType filter. Anyone have a good way to fetch this data for a given date/period?
... View more