I'm using Xero's private API to export bank transactions (so I can automate a bunch of financial reporting).
Retrieving the transactions works well (as documented here https://developer.xero.com/documentation/api/banktransactions) but this endpoint doesn't return the account
field associated with each transaction, which I want to use to group the transactions into e.g. "Cost of sale", "Operating expenses" and so on.
Does anyone know of a way to find the account
for a given transaction via the API?
Further info:
- If the transaction contains line items, then the account associated with each line item is returned by the endpoint above. I'm mostly interested in transactions that do not include line items (the LineItems field is an empty array)
- Most of the transactions i'm working with are of the "Spend Money" type
- I'm currently using pyxero SDK, but open to other options
- The
account
field is present in Xero's web interface, and on the CSV export available from the web interface. - Our
contacts
in Xero don't have default accounts.