Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > Getting Started >

Trial balance API with Account Type (not Account Class) information

Started by Chris Bell -   in Getting Started

Currently, when getting the trial balance via the Reports API, it seems to return accounts in the format "Name (code)", and only returns information about Account Classes (i.e. Asset/Liability), not about Account Types (i.e. prepayment/current asset/current liability etc).

This means, to get Account Type information, I need to regex out the account code, and then join that with a separate dataset from the Accounts API.

This is doable, but just massively slows down the runtime, so was hoping there would be an easier/more direct way.

Thanks!
Hey Chris,

No need to regex the account code. The "Value" of the "Attribute" is the AccountID for the account. You can match that the the chart of accounts from GET /Accounts.

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

 

Adam Moore (Community Manager)  

Thanks Adam!
 

Chris Bell