Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > API Endpoints >

Unable to filter the Journal endpoint with ‘Where’

Started by Anthony Lisbona -   in API Endpoints

Unable to filter the Journal endpoint with ‘Where’

I have a problem with the Journal endpoint years ago where the “where” clause would work for some clients but not others. It appears that clients who have created an account before 2016 have this problem.
I raised this issue a few years ago however it still appears to be a problem.
Effected clients will just return 0 records even though there is data.


I am using the Xero.API.SDK.Minimal v2.2.8 Nuget package

var dataQuery = XeroApi.Journals
.Offset((page - 1) * _MaxRecords)
.Where(string.Format("JournalDate >= DateTime.Parse(\"{0}\")", StartDate.ToString("yyyy-MM-dd")))
.And(string.Format("JournalDate <= DateTime.Parse(\"{0}\")", EndDate.ToString("yyyy-MM-dd")))
.Find()
.ToList();


Can Xero please advise what could be the problem?