I am trying to filter credit notes by a date using ‘where’ but for some reason isn’t working it just returns all credit notes. Any idea why?
I have tried this api call…
https://api.xero.com/api.xro/2.0/CreditNotes?where=Date=DateTime(2024,07,12)
(I have to add text here to reach minimum character count)
user26382717 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
The where
clause should be url encoded
https://api.xero.com/api.xro/2.0/CreditNotes?where=Date%3DDateTime(2024,07,12)
1
I contacted Xero and at the moment the Credit Note endpoint doesn’t accept => ,=> , = but does accept < , >.
So at the moment the solution to filter by 2024-07-18 is to do this…
https://api.xero.com/api.xro/2.0/CreditNotes?where=Date>DateTime(2024,07,17)&&Date<DateTime(2024,07,19)
Tested and working
user26382717 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.