Xero API Aging Reports: Overcome AR/AP Data Extraction Limitations 2025

Xero’s API Limitations on Accounts Receivable and Payable API and How to Overcome It

If you’ve been working with Xero’s API, you might have hit a roadblock.

It’s a tricky one that leaves you scratching your head.

The issue? In Xero, You can’t easily pull comprehensive accounts receivable (AR) and accounts payable (AP) aging reports. And when you’re trying to get a clear picture of your finances, that’s a big deal!

During my consulting with SaaS companies, I found that such Xero API limitations are problematic in developing the AR and AP automation in Xero.

Which business in the world will not like to get paid early?

Did you know? Over 60% of businesses report that late payments impact their cash flow. That’s a huge problem when you can’t get a proper overview of your outstanding debts and credits in one place.

And here’s another fact: 90% of businesses rely on Xero AR AP aging reports to prioritize collections and make informed decisions. So, when you can’t easily access this data via Xero’s API, it can cause unnecessary headaches and lost opportunities for businesses of all sizes.

Now, don’t worry. In this article, I’m going to walk you through the problem, and more importantly, how you can overcome these limitations and use the full potential of your Xero data.

Understanding the Core Problem with Xero’s API

Here’s where the real frustration lies: When you want to pull an aged accounts receivable or payable report for all your contacts, Xero’s API doesn’t let you do this in one go.

Instead, you’re left with a process where you can only get aged data for one contact at a time.

Xero API AgedReceivablesByContact endpoint documentation highlighting contactID requirement for AR aging reports

You might think, “Okay, no big deal, just loop through each contact and grab the data, right?” Well, that’s exactly where things get tricky.

The Contact API Limitation

At first you need to have contact id in order to retrieve AR. To do so, you need to get all contacts from Contact API.

The Contact API has ability to get all contacts with Xero contact API pagination of 1000, which is good. But I found that there is already field called “balance” in Get API response.

But it is not good because it comes with:

** (The following are only retrieved on GET requests for a single contact or when pagination is used)

Xero API balances field description showing raw AccountsReceivable and AccountsPayable outstanding amounts

Well, it gives you the contacts and the total amount owed by each of them, but it doesn’t go deeper than that. You get a list of names with the total amount they owe but no breakdown of the age of those debts.

So, you won’t know if a client owes $1,000 and if that’s overdue by 30 days or 90 days.

Xero API JSON response showing aged receivables data structure with totalDetail and totalOther objects

And for businesses that rely on understanding aging data to prioritize collections or payments, that’s a huge gap.

The last thing you want is to waste time chasing clients who owe you money but are still within your payment terms while overlooking those who are way overdue.

Community Feedback: Years of Frustration

The frustration about this limitation isn’t just a few isolated comments. Developers and users have been raising their voices for years. Here’s some proof:

Xero Community Forum Evidence

One discussion that started back in March 2016 (yes, it’s been that long!) talks about the need for an API endpoint where the Contact_ID isn’t required, so you can get the aged amounts for all contacts in a single call.

Unfortunately, this thread is now archived, meaning the Xero team hasn’t resolved it.

 Xero Community Forum post requesting aged report API for all contacts where unpaid amounts greater than zero

Steve Hart user, made a sarcastic comment on the same issue, highlighting the ongoing frustration in the developer community.

Steve Hart comment from 2049 about Xero still not providing API access for aged reports

Xero UserVoice Requests

A feature request made on UserVoice (a platform where Xero users can suggest and vote on new features) has 60 votes as of June 2025, showing just how much demand there is for this feature.

One comment from a developer says it all: “Was tasked with getting this report out which exists in the back office. I assumed it would be an easy API call. But no. This makes this exercise needlessly wasteful.” It’s clear that this limitation has been a real headache for developers.

Check out the full feature suggestion here.

Xero UserVoice feature request for aged receivables payables by all contacts API with 60 votes

GitHub Issue Documentation

A feature request from February 2021 on GitHub specifically asks for the ability to extract aged payables for all contacts in one call—just like the functionality available on the Xero website.

Developers are calling it a time-consuming and frustrating process to make multiple API calls for each contact, and they’re hoping Xero will fix this.

GitHub feature request for Xero API to extract aged payables for all contacts in one API call

Practical Solutions to Overcome Xero’s API

Solution 1: Programmatic API Call Aggregation

For small businesses or scenarios with a limited number of contacts, you can programmatically aggregate data by making individual API calls for each contact. Here’s how:

  • Retrieve Contacts: Use the GET /contacts endpoint to fetch all contacts
  • Fetch Aged Data: For each contact, call the GET /agedreceivablesbycontact and GET /agedpayablesbycontact endpoints
  • Aggregate Data: Combine the results to create a comprehensive aging report

Limitations of This Approach:

  • Scalability: This approach is feasible only for a small set of customers due to the overhead of multiple API calls
  • Performance: As the number of contacts grows, the process becomes inefficient and time-consuming

Solution 2: Robotic Process Automation (RPA) Implementation

Tools like Manus Agent can automate the process by signing into your Xero account and exporting AR and AP reports in Excel format. This method involves:

  1. Automated Login: The bot logs into your Xero account
  2. Report Generation: It navigates to the AR and AP aging reports
  3. Data Export: Exports the reports to Excel files

Limitations of RPA:

  • Manual Intervention: Requires initial setup and periodic maintenance
  • Scalability: Not practical for SaaS applications managing multiple companies
  • Automation Challenges: Frequent UI changes in Xero can disrupt the automation process

Solution 3: Data Synchronization and Report Recreation (Recommended)

For a scalable and efficient solution, consider syncing Xero data into a centralized database and recreating the aging reports. This Xero API workarounds approach is similar to how we handle Xero Journal API limitations.

For more Xero integration solutions strategies, see our guides on XERO invoice synchronization and trial balance data extraction.

Step-by-Step Implementation Guide

Step 1: Sync Xero Data into a Database

Create the following database structure:

  • Contacts Table: Store contact details
  • Invoices Table: Store invoice information
  • Payments Table: Store payment records

Important Xero API Knowledge:

Did You Know? Xero simplifies its API by using just one endpoint for both invoices and bills. Instead of separate APIs, Xero combines them into a single Invoice API with two types: ACCREC for Xero accounts receivable API (sales invoices) and ACCPAY for Xero accounts payable API (bills from suppliers).

Similarly, Xero doesn’t differentiate between customers and suppliers in separate tables. Instead, it uses a single Contacts Table, with two flags—isCustomer and isSupplier—to categorize contacts accordingly.

API Pagination: Xero now supports pagination with a maximum page size of 1000 records per request, allowing for faster data retrieval.

This feature was announced on Xero’s Developer Changelog and is detailed in their pagination documentation.

Xero Developer Changelog July 2024 showing API pagination changes with pagesize of 1000 for all endpoints

Step 2: Create Aging Reports with SQL

Once the Xero database synchronization is complete, you can use SQL queries to generate aging reports. Here’s an example:


SELECT
    c.ContactName,
    SUM(CASE WHEN DATEDIFF(CURDATE(), i.DueDate) <= 0 THEN i.AmountDue ELSE 0 END) AS Current,
    SUM(CASE WHEN DATEDIFF(CURDATE(), i.DueDate) BETWEEN 1 AND 30 THEN i.AmountDue ELSE 0 END) AS '1-30 Days',
    SUM(CASE WHEN DATEDIFF(CURDATE(), i.DueDate) BETWEEN 31 AND 60 THEN i.AmountDue ELSE 0 END) AS '31-60 Days',
    SUM(CASE WHEN DATEDIFF(CURDATE(), i.DueDate) BETWEEN 61 AND 90 THEN i.AmountDue ELSE 0 END) AS '61-90 Days',
    SUM(CASE WHEN DATEDIFF(CURDATE(), i.DueDate) > 90 THEN i.AmountDue ELSE 0 END) AS '91+ Days'
FROM
    Contacts c
JOIN
    Invoices i ON c.ContactID = i.ContactID
WHERE
    i.Status = 'AUTHORISED'
GROUP BY
    c.ContactName;

SQL Query Explanation:

  • DATEDIFF: Calculates the difference between the current date and the invoice due date
  • SUM: Aggregates the amounts due within each aging category
  • GROUP BY: Groups the results by contact name

Benefits of Data Synchronization Approach:

  • Efficiency: Reduces the number of API calls and processing time
  • Scalability: Easily handles large datasets
  • Real-Time Reporting: Provides up-to-date aging reports

Sample Database Structure and Output

Example Database Tables:

Contacts Table:

ContactIDContactName
1Client A
2Client B

Invoices Table:

InvoiceIDContactIDDueDateAmountDueStatusInvoiceType
10112025-05-01500AUTHORISEDACCREC
10222025-04-15300AUTHORISEDACCPAY

Payments Table:

PaymentIDInvoiceIDPaymentDateAmountPaymentType
2011012025-05-10500ACCREC
2021022025-04-20300ACCPAY

Aging Report Output:

ContactNameCurrent1-30 Days31-60 Days61-90 Days91+ Days
Client A00000
Client B3000000

Conclusion: Implementing Effective Financial Management

While Xero’s API limitations for AR and AP aging reports can be a challenge, practical solutions can help you work around them.

From combining API calls for smaller datasets to syncing Xero data into your database for real-time reporting, these options can help you take control of your receivables and payables.

The most effective solution for scaling up is syncing data into a centralized database and recreating reports. This method gives you full control, and once the initial sync is done, it’s all smooth sailing.

With proper Xero aging report automation and Xero API data extraction, businesses can overcome these limitations and achieve better financial visibility.

If you’re looking for professional help with Xero integration services, our team can help you implement these solutions effectively for your business needs.

Would you like help setting up this process? Let’s discuss how we can make it work for your business!

Article by

Chintan Prajapati

Chintan Prajapati, a seasoned computer engineer with over 20 years in the software industry, is the Founder and CEO of Satva Solutions. His expertise lies in Accounting & ERP Integrations, RPA, and developing technology solutions around leading ERP and accounting software, focusing on using Responsible AI and ML in fintech solutions. Chintan holds a BE in Computer Engineering and is a Microsoft Certified Professional, Microsoft Certified Technology Specialist, Certified Azure Solution Developer, Certified Intuit Developer, Certified QuickBooks ProAdvisor and Xero Developer.Throughout his career, Chintan has significantly impacted the accounting industry by consulting and delivering integrations and automation solutions that have saved thousands of man-hours. He aims to provide readers with insightful, practical advice on leveraging technology for business efficiency.Outside of his professional work, Chintan enjoys trekking and bird-watching. Guided by the philosophy, "Deliver the highest value to clients". Chintan continues to drive innovation and excellence in digital transformation strategies from his base in Ahmedabad, India.