web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

How can I get granular invoice aging data via API?

(4) ShareShare
ReportReport
Posted on by 10
I'm building a SaaS tool for SMBs on top of Business Central and I'm trying to compute granular aging metrics. What I'd like to retrieve is:
 
For a historic date,
For each customer,
For each invoice,
The amount due to that invoice and the number of days overdue, if any, at the time of reference ("historic date").
 
Or said another way: "How much did each customer on a given date owe, and how out of date are each of those remaining balances?"
 
 
What I've tried:
 
I can get historic data from companies({id})/agedAccountsReceivables, but it's already aggregated by time bucket and grouped by customer.
 
The AgedAccountsReceivable report in the UI with "Print Detail" turned on gives me a little more detail, with individual invoices, but still time bucketed.
 
I've read discussion about posting custom API pages, but given my SaaS app will be multi-tenant and connecting via application credentials, I'm wary of any solution that would require each of my users to do this.
 
Individual invoice records include amount due and due date, but can't be evaluated from a historical view ("How much of this was paid at the end of last month?").
 
I've looked at computing this manual from customer ledgers, but this approach feels fraught with complexity and I'd much rather rely on Microsoft computing balance.
I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    101,995 Super User 2026 Season 1 on at
    First, the standard API cannot meet all your needs. And as of now, the standard API cannot be extended.
    Dynamics 365 Business Central: Can we extend standard APIs? – Download Standard Source Code for APIs
    I recommend creating a custom API based on the Cust. Ledger Entry (21) table, which contains all the data you need. If you don't need specialized calculations, the Query API is more efficient.
    Dynamics 365 Business Central: API query type (Develop a custom API using Query)
     
    Hope this helps.
    Thanks.
    ZHU
     
  • Verified answer
    Rishabh Kanaskar Profile Picture
    6,231 Super User 2026 Season 1 on at
    You can’t get true historic aging at invoice-level from standard BC APIs out of the box, Microsoft only exposes the current state (Customer Ledger Entries / Aged AR report buckets).
     
    For your SaaS tool, the practical approach is:
    > Pull Customer Ledger Entries (CLEs) via API, including Remaining Amount, Due Date, Posting Date, and Closed at Date.
    > Rebuild historical position yourself by filtering CLEs where Posting Date ≤ Historic Date and either not closed or closed after Historic Date.
    > Compute Remaining Amount as of that date and Days Overdue = Historic Date – Due Date (if positive).
     
    This avoids custom BC pages per tenant and works with application permissions. You just need to run your own calculation layer once you have the ledger data, this is the only reliable way to get invoice-level aging snapshots for any past date.
     
    Thanks
    Rishabh

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,344 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,742 Super User 2026 Season 1

#3
AndrewThomas81 Profile Picture

AndrewThomas81 1,231

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans