Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > API Endpoints >

Account list doesn't return account id for “grouped” accounts

Started by Chris Pont -   in API Endpoints

I'm using the Xero API to do some integration and I'm using the accounts get feature to return a list of accounts. I'd like to join this to some of the reports, for example the profit and loss report which would allow me to then group the accounts returned by type. All looks good, other than some accounts have an extra "groupID" attribute. When an account has this extra attribute, the "account" attribute that usually contains a GUID which I can link to reports now contains what could be a GUID, only without the dashes, and doesn't link to any other report.

For example, this is an account that all works correctly...

This code is provided by the developer community - Xero does not warrant it in any way


This one doesn't, and the GUID isn't formatted as a GUID anymore...

This code is provided by the developer community - Xero does not warrant it in any way


Any idea what would cause that? Is there a way I can list "grouped" accounts?

Thanks in advance.
Hi Chris - X-posting the stack overflow post for anyone who comes across this.

https://stackoverflow.com/questions/65683992/account-list-doesnt-return-account-id-for-grouped-accounts/65689278?noredirect=1#comment116161238_65689278

I've got a question out to the API team and will try to update with any insight if I get more data about it.

Can you confirm if this org is multi currency or not? My last question in the S/O post
 

Christopher Knight (Xero Staff)  

Hi Chris,

At the moment, there is no current way to get the accountIDs in the Reports endpoints for accounts that have been grouped together.

But, there are 2 ways you can get that in the response. In the API request, if you send 'standardLayout=true', then that'll give you back the accountIDs.
Or on the Web app, in P&L edit layout mode, if you uncheck the 'Show Summary Only' box for the group of those accounts, that'll also work the same way and you should be able to see the accountIDs in the API response.

Hope this helps.

Thanks
Keertika
 

Keertika Chandola (Community Manager)