freakboy3742 / pyxero

Python API for accessing the REST API of the Xero accounting tool.
BSD 3-Clause "New" or "Revised" License
279 stars 209 forks source link

Can see invoice tracking categories #311

Open ptav opened 3 years ago

ptav commented 3 years ago

Invoices in my account have tracking categories but when I pull invoices using <Xero class instance>.invoices.all() I cannot see those (LineItems is shown but is an empty list in all cases). I can however pull down the list of categories using trackingcategories.all() and I can see the line items if I pull a single invoice.

How can I retrieve the categories alongside a list of invoices? I can clearly pull one at a time but would be more efficient to do that in one go

Many thanks. I'm new to pyxero (and the Xero API) and any help is greatly appreciated

PTav

neurocean commented 3 years ago

I'm running into a similar scenario where invoices.all() returns an empty list for LineItems but .get for an invoice returns all LineItems.

This behaviour is baffling.

Edit: Unfortunately it seems like .all() doesn't support the page parameter. Instead you can do invoices.filter(page=1) in a loop to get all invoices. I can't help but wonder if .all() could be made to support pagination.